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
0 answers

Move QPushButton inside a QGridLayout

I use the latest version of PyQt4, and python3. The game I want to make its most common name is "sliding puzzle". I know the easy part (start, reset, close, and the stopwatch time), but I have some issues with slides motion. I created 15…
shahwan42
  • 75
  • 9
1
vote
0 answers

How to index a widget inside of a QGridLayout

I'm trying to create a matrix of widgets in PySide with Python3. The creation is working already but I cannot update the widgets. I create a QGridLayout, then I add label widgets with an initial text. After this I build a list of 30 instances of the…
EinSoldiatGott
  • 63
  • 1
  • 11
1
vote
2 answers

QGridLayout: You must insert this grid into another layout

http://doc.qt.io/qt-4.8/qgridlayout.html#QGridLayout-2 What does the following quote mean? You must insert this grid into another layout. You can insert widgets and layouts into this layout at any time, but laying out will not be performed before…
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
1
vote
1 answer

How to remove spacing inside a gridLayout (QT)?

I want to create a child container layout which will contains 2 widgets. Those 2 widgets should be placed right next to each other but my current setup still has some spacing in between. I have already set the spacing to 0 setSpacing(0). And…
Sens4
  • 605
  • 1
  • 11
  • 29
1
vote
1 answer

Qt start an external program in Qt gridLayout

I was wondering, is it possible to start an external program via Qt and display the program in Qt gridLayout (or inside Qt window)? At the moment, I'm able to start an external program via Qt, but I haven't find a way to display the program inside…
1
vote
2 answers

Gui for a simple chat in PyQt5 using QGridLayout

I have been studying PyQt5 and recenlty decided to make a gui for a simple chat client. This is my mockup: I used QGridLayout, and this is what I got: How do I decrease the size of the bottom QTextEdit, so it has 2-3 available lines, and make…
Feisty Otter
  • 134
  • 1
  • 8
1
vote
1 answer

How do I rebuild a gridLayout during resize?

I am trying to catch resize event of the window, and when I do, basically delete all the widget items in a gridLayout and rebuild the rows/columns to fit the new resized window. I am having trouble getting this to work properly and not sure if this…
Zak44
  • 341
  • 1
  • 5
  • 24
1
vote
0 answers

Subplots on figure not filling Canvas

Im using pyQT and want to plot an image on a GUI I create. I use: # a figure instance to plot on self.figure = plt.figure() self.figure.suptitle('My Test Figure') self.figure.set_facecolor('k') # this is the Canvas Widget that…
Jason
  • 51
  • 3
1
vote
1 answer

How to connect CustomWidget in QGridLayout with UIForm class

I have a UIForm named "Spell" that contains inter alia QGridLayout with custom widgets named "PElement". The amount of PElement widgets depends on number of spells in my database. So, I fill QGridLayout by ui->spellLayout->addWidget(...) When…
1
vote
0 answers

QWidgets getting "squashed" when added dynamically to a QGridLayout

I am trying to add controls (the number determined in response to user input) to a basic form created with Qt Creator. Unfortunately the GridLayout is not expanding so anything beyond 4 iterations of a 'for' loop all the widgets are getting squashed…
Kam
  • 21
  • 3
1
vote
1 answer

QGraphicsView doesn't always update

Hi I've got a GridLayout which has 64 GraphicsViews on it (I know it's alot but it's the only way i could think of doing this at this point in time). Now i'm currently just drawing a random line on each of these graphics views on a timer tick. This…
gjones
  • 367
  • 3
  • 13
1
vote
1 answer

Python PyQt QScrollArea and QGridLayout (or any?)

I am trying to generate a Dialog with a stacked layout of GridLayout (of CheckBox's) and HLayout. Well, I did. But my grid got big (my HLayout is fine) but now I want a ScrollArea so as to not take up too much real estate. I have tried the…
Tim Carnahan
  • 361
  • 1
  • 2
  • 14
1
vote
1 answer

How to set QGridLayout in particular position after removing one of its widget

I am using QGridLayout to add one QPushButton and one QTextEdit. but whenever i am hiding and removing QTextEdit widget then QPushButton is coming on the position of QTextEdit. Initially QPushButton is in position lets say (0,0) and QTextEdit is in…
Suresh
  • 745
  • 4
  • 11
  • 25
1
vote
1 answer

PyQt4 - make child widgets scale down to fit inside parent and layout

For example, I have a gridlayout which contains some QPixmaps. However, if the images in the QPixmaps are bigger than the cells of the gridlayout, they overflow and end up overlapping each other. How can I make them automatically scale down so that…
mage
  • 626
  • 2
  • 8
  • 18
1
vote
1 answer

PyQt - Custom Widget Disappears when added with Alignment

I'm having an issue where a custom widget I am making appears just fine when added to a QGridLayout without specifying an alignment, but when I specify an Alignment it disappears. Here is the custom widget: class OutlineLabel(QWidget): def…
hankd
  • 649
  • 3
  • 12