All Questions
92 questions
0
votes
1
answer
76
views
What's the right way of switching between overlapping layouts? (stacking or replacing layouts)
I'm a PyQT amateur and I have a main layout which is a parent to a left layout and a right layout. With the press of a button, I want to replace the left layout with another one. The "overlapping&...
0
votes
0
answers
44
views
Change QTabWidget content background color
I've been trying to do this for a while but still haven't made it work.
I'm looking to "paint" the background of the tab content to black to be congruent with the graph. By searching online ...
0
votes
0
answers
21
views
Change in PyQt QDialog Layout Does Not Update Correctly -- bug or my error? [duplicate]
I created a dialog to show two columns of radio buttons with the text for each button obtained from a network server. The button text in one column is static. The other changes. The dialog updates its ...
0
votes
2
answers
399
views
PyQt5 - Items added to custom layout have different size if they are added after QWidget.show() has been called
I am trying to add items to a FlowLayout dynamically and I have stumbled upon a bug that is really annoying.
When I add items before calling the show() method of the parent widget, they do not have ...
1
vote
1
answer
2k
views
How to make the size of the parent widget not adjust to the child?
I want the child widget to just appear in the center of the parent widget with a horizontal pink stripe. But the widget of the parent becomes very small.
from PySide6 import QtWidgets, QtGui
import ...
1
vote
1
answer
2k
views
How to add custom widget (with layout) overlapping another custom widget (with layout) pyqt
I need to add two labels overlapping 2 QPushButton. If the user clicks on the right side of labels, they click the right button, if they click on the left side of labels, they click the left.
I hope ...
1
vote
3
answers
2k
views
PyQt5 : layout buttons with equal column width
I was using PyQt5 to create a grid layout for my username, password label and input fields and for my submit and cancel button.
I added equal row width of 1 for all my widgets, however for my cancel ...
1
vote
1
answer
319
views
How to align two widgets more closely in PyQt5 layouts?
How to align two widgets more closely? In my code, I want to align QLabel 1 and QLabel 2 more closely (i.e. QLabel 2 aligned just below the QLabel 1, with minimum spacing).
import sys
from PyQt5 ...
2
votes
2
answers
12k
views
Stretch the widgets properly in a horizontal layout of pyqt5
I tried to setup a main window, with a central widget. This contains a general widget and a label for help messages.
I wanted a stretch of 4:1. The base widget should get 4 times the space of the help ...
1
vote
1
answer
2k
views
How to control the proportions of a QFrame in a layout?
It's My Code. My Requirement: if the Window Grows the frame also expands as per ratio in both directions. I am trying with SetSize Policy, but nothing will happen. How to achieve it?
import sys
from ...
0
votes
1
answer
541
views
PyQt5 Button signal doesnt work in a Layout inside a Widget
I am trying to implement a layout inside a Widget which is then added to the Main Window. If I declare the buttons and the layout inside the Main Window it works without a problem. However, if I ...
0
votes
0
answers
156
views
Vertical layout poorly formats after dynamically adding widget
I'm having a problem with a QVBoxLayout that I'm hoping someone has insight on. I'm currently building a GUI for electrical tests. I have a main QTabWidget which contains two tabs - one for Electrodes ...
0
votes
1
answer
500
views
Draw QGraphicsWidget outside of parent
I'm working on a node editor and I'm currently creating my own system using QGraphicsWidget and QGraphicsScene. I find it very flexible to use a QGraphicsGridLayout in my Node class and just add sub-...
1
vote
1
answer
2k
views
Display a QLabel at the top-centre of the window
I'm having trouble setting up PyQt on my own. My idea its to creat a music-player with a song title and album cover. I have had success in creating my own window and adding the album cover. But I can'...
0
votes
1
answer
335
views
Need Switching between 2 Mainwindows in Pyqt5 [duplicate]
I have created 2 separate MainWindow(in 2 different programs). Now I need to switch between these 2 windows. Example: When a button in MainWindow1 is clicked , MainWindow2 should be opened and ...