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
5
votes
1 answer

Updating dynamic QGridLayout - Python PyQt

I recently started studying Python and now I'm making a software with a GUI using PyQt Libraries. Here's my problem: I create a Scrollarea, I put in this scrollarea a widget which contains a QGridLayout. sa = QtGui.QScrollArea() sa_widget =…
xuT
  • 318
  • 4
  • 15
4
votes
2 answers

PySide: Creating a list of checkboxes

I'm trying to create a list of checkboxes in PySide. These checkboxes will reside within a grid which is inside of a frame. Because I need over a hundred checkboxes, I thought it would be best to store these checkboxes in a list. Within class…
Arda Arslan
  • 1,331
  • 13
  • 24
4
votes
1 answer

Consistent row sizes in a QGridLayout

I have a dialog set up like this: Every components' properties are set to their defaults aside from the captions. I want the row containing label_3 to be the same height as the other three rows (and that bottom row to be expanded to take up the…
Jason C
  • 38,729
  • 14
  • 126
  • 182
4
votes
3 answers

pyside - how to delete widgets from gridLayout

I built a ui in QT Designer and then used pyside-uic turned it into a python file and have then written some code to edit it programmatically. In otherwords I have a pushbutton Add Row that when clicked will rename itself to Remove1 and create…
evan54
  • 3,585
  • 5
  • 34
  • 61
4
votes
1 answer

Add widgets to QFileDialog

I need to add a widget (QTableWidget) into QFileDialog's layout. I know that it is QGridLayout with sizes (3,4). The table must be in 3-rd row and span all columns. QTableWidget* tableWidget = new QTableWidget(this); QGridLayout *layout =…
Ashot
  • 10,807
  • 14
  • 66
  • 117
4
votes
1 answer

layout sizeHint qwidget

I am creating a widget which contains a chess table and six buttons which are displayed in 2 rows beneath the chess table. The button rows are wider than the chess table. Chess table and buttons are in a QGridLayout. Chess table has its own sizeHint…
Cristi
  • 648
  • 1
  • 13
  • 28
4
votes
2 answers

Qt alignment in QGridLayout eliminates the resizing of its elements

Ok, so basically I have a simple table with a QWidget and two buttons as shown below: QGridLayout *layout = new QGridLayout; layout->addWidget(viewcontainer,0,0,1,2); layout->addWidget(reset,1,0); layout->addWidget(done,1,1); This is basically what…
JustinBlaber
  • 4,629
  • 2
  • 36
  • 57
3
votes
1 answer

Is it possible to set minimum space between widgets in QGridLayout?

I want to create a resizable window that contains some icons that resize according to window. I created a window and placed the icons in a grid layout, it worked as i wanted so far. But the problem is that when I shrink the window to tiny size,…
Dean Lee
  • 95
  • 6
3
votes
1 answer

Insert Image into QGridLayout and Draw on top of image in PyQt5

I'm pretty new to PyQt and am trying to make an application with a QPixmap on the left, which can be drawn on, and a QTextEdit on the right (for a simple OCR GUI). I looked at: PyQt5 Image and QGridlayout but I couldn't connect it with the code…
John
  • 178
  • 10
3
votes
1 answer

QGridlayout and QGroupbox alignment

I've created a widget with contents of 3 QGroupbox, I am trying to place and align them respectively with QGridLayout. Strange behaviour of QGroupboxsmakes this question. What looks like currently. As shown above figure when Qwidget screen…
Pavel.D
  • 561
  • 1
  • 15
  • 41
3
votes
1 answer

QFormLayout expands column of QGridLayout

I am creating a QFormLayout with some items like this: QFormLayout *tableLayout = new QFormLayout(); QLineEdit *line1 = new QLineEdit(); QLineEdit *line2 = new QLineEdit(); tableLayout->addRow(tr("LineText1 "),…
NelDav
  • 785
  • 2
  • 11
  • 30
3
votes
0 answers

QGroupBox: label cut and positioning inside QGridLayout

To be more clear explaining my problem, I've done a screenshot with some notes on it, hope it helps: QGroupBox Layout format problem As you can see from it, I have one big QVBoxLayout for the main layout of the app, inside it I've put a Qwidget,…
3
votes
1 answer

Pyside - QGridLayout addStretch option?

I have a layout that I need the widgets pushed upwards. I know I can do this layout = QtWidgets.QVBoxLayout() layout.addWidget(test_widget) layout.addStretch() and the addStretch will push all widgets to the top. However the layout that I am…
ghost654
  • 161
  • 2
  • 18
3
votes
2 answers

How to reset the column span of a widget in a QGridLayout?

Is possible to set the column span of a QLineEdit box after it has been added to the layout? I have two QLineEdit boxes in a QGridLayout that are right next to each other horizontally. During the execution of some of my code, one of these boxes gets…
artomason
  • 3,625
  • 5
  • 20
  • 43
3
votes
1 answer

How to arrange items in QGridLayout when resizing?

I have a QGridLayout where I add several widgets dynamically, using QGridLayout::addWidget(). I have no problem for these widgets, as they are all the same. However, I'd like to know how to handle their alignment when I'll resize the widget…
IAmInPLS
  • 4,051
  • 4
  • 24
  • 57
1
2
3
13 14