Questions tagged [qgridlayout]

A QGridLayout is a class from the Qt toolkit which lays out GUI widgets in a grid.

QGridLayout takes the space made available to it by its parent layout or widget, divides it up into rows and columns, and puts each widget it manages into the correct cell.

Each column and row has a minimum width/height and a stretch factor (which determines how much of the available space the column or row will get over and above its necessary minimum). It is also possible for widgets to span multiple rows and/or columns.

The official Qt documentation can be found here.

203 questions
1
vote
1 answer

How Can I get the Current Text of a QComboBox in QGridLayout?

At the moment I have a create Slot that is called when a button is pressed. The Slot function needs to get all the data from the ComboBoxes in the QGridLayout above it. In the items above not all them have QComboBoxes. Some of them are QLineEdit and…
BDD
  • 25
  • 1
  • 6
1
vote
1 answer

Qgridlayout control the size of the widget

I am trying to use Qgridlayout for my GUI. I wish to reduce the width of the Qspin as shown in the picture. Any suggestions how I can do it? thanks layout.addWidget(checkBoxVBG,1,0) layout.addWidget(checkBoxIREF,2,0) …
kristo
  • 57
  • 1
  • 5
1
vote
1 answer

How to resize and move QGridLayout dynamically to 1/4s

This is my current window layout, I want to have it split up into 1/4, and not 1/2 so to speak. This is how I want my window to look, but I can't seem to find a good way to resize the QGridLayout to the way I want, and the way setColumnStretch…
JareBear
  • 467
  • 9
  • 27
1
vote
1 answer

PyQt: Multiple QGridLayout

How can I have multiple QGridLayouts on a single widget? I want to have one grid layout on the left and one on the right. from PyQt5.QtGui import * from PyQt5.QtWidgets import * import sys class FormWidget(QWidget): def __init__(self): …
1
vote
1 answer

Is there a way to know the X and Y coordinates of an element in a QGridLayout?

I have a QGridLayout where I'm adding different elements and I need to know the elements and I need to know the coordinates of of a specific element. Is there a way of doing this? I read the documentation and tried using the pos() and geometry()…
Juan
  • 133
  • 1
  • 12
1
vote
1 answer

Aligning QGridLayout rows in QScrollArea

I am trying to create a lot of rows in a PyQt5 grid widget, but they try to expand as much as they can. How can I set a fixed cell height? They are represented like this: But I would like them to stick at the top, ordered like this: Code: name =…
Jaime02
  • 299
  • 7
  • 21
1
vote
1 answer

Why widgets overlaps in the OOP version

I stripped down my situation to a simple one: I want to program the GUI in PyQt5, where there is a main QGridLayout whose name is grid, in which there are another grid gridParamter and a QListView widget. In the gridParamter, there are 2 QLabel Here…
oyster
  • 537
  • 3
  • 15
1
vote
1 answer

Why does this scrollable area not keep the wanted size of my images?

I have developed a Qt application. I built a form with Qt Designer. The important fact is that I have a Scroll Area like this : 299 50
MysteryGuy
  • 1,091
  • 2
  • 18
  • 43
1
vote
1 answer

group widgets inside groupbox

I have a group box that looks like this: And here is the code that creates it: def create_settings_group(self): group_box_settings = QtGui.QGroupBox(self) group_box_settings.setTitle("Settings") grid = QtGui.QGridLayout() …
Bob Sacamano
  • 699
  • 15
  • 39
1
vote
0 answers

Deleting widgets from QGridLayout

I have a QGridLayout, that consists of buttons. Then, after pressing another button (which is not in this QGridLayout), all buttons should be removed from this Grid(e.g. there were 20 buttons) and new quantity of buttons should be added (e.g. there…
1
vote
1 answer

Setting same instance of widget not working

I have a pyqt application and when using the same instance of the QLabel class on the gridlayout it is not working. I see only one instance being displayed. import sys from PyQt5.QtWidgets import QApplication, QWidget, QToolTip, QPushButton,…
user1050619
  • 19,822
  • 85
  • 237
  • 413
1
vote
1 answer

How to add rows of widgets after deletion in a QGridLayout

I am adding rows of widgets to a QGridLayout like this (with a button): def ajouter_un_mot_vocab(self) : ''' ''' # Dictionnaire des mots de vocabulaire self.dico_vocab_mot = {} # Dictionnaire des définitions des mots de…
ekdmekdm
  • 171
  • 1
  • 9
1
vote
1 answer

How to Pack with PyQt - how to make QFrame/Layout adapt to content

I am building a grid of QTextEdit with HTML Subset to show some data within an interface in PyQt. At the moment I get the GridLayout and the QFrame that contains it doing whatever they want and there is no way for me to make them fit the QTextEdit…
user3755529
  • 1,050
  • 1
  • 10
  • 30
1
vote
1 answer

PyQt: setSpacing in QGridLayout

Can you tell me how to delete spaces between buttons im my Widget? I want to do it by seting command , setSpacing(0), but I don't know where I should set it. My code: import sys from PyQt5.QtCore import pyqtSignal, QObject from PyQt5.QtWidgets…
1
vote
1 answer

How can i toggle a widget visibility that is in a grid layout?

I want to do a list that changes it's fields numbers when the user changes a the value of a spinbox. Something like this: First 5 fields by default Then just 1 field for example And if the user wants to change it again, he can put 5 fields…
JavScars
  • 45
  • 4