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

Setting up the form layout in correct way. QGridLayout.addLayout(QLayout, int, int, Qt.Alignment alignment=0): not enough arguments

I'm trying to make a form for user info data: #!/usr/bin/python from PyQt4.QtCore import * from PyQt4.QtGui import * import sys, os, time class SetName(QWidget): def __init__(self): QWidget.__init__(self) self.show() …
tryPy
  • 71
  • 1
  • 11
0
votes
1 answer

PyQt: Let the user edit layout of the widgets

I have a window containing two adjacent QTableWidgets and one full width QTextBrowser beneath them. They are all positioned inside a QGridLayout which spans to the whole window area. Now the problem is that I'd want to let the user deside what size…
user2126173
  • 83
  • 1
  • 2
  • 8
0
votes
1 answer

Dynamic QGridLayout of QPushButton c++

after spend hour's searching for a solution, to build a grid that dynamic adds and removes buttons it doesn't remove the previus ones when going to the next page. I have search here, and found "some" solutions but they aren't working. This is my…
Camadas
  • 509
  • 1
  • 5
  • 21
0
votes
1 answer

How to position item, Qpixmap, Qstring in a QGraphicScene/QGraphicView in qt?

I add a Qpixmap and a string into QgraphicScene and then setScene into QgraphicView. This Qpixmap and string stay in the middle of the QgRaphicScene. How can i change the position of these? Can i use layout manager for this?
0
votes
1 answer

Qt widgets not placed correctly

I've subclassed QWidget and defined constructor this way: LoupingWidget::LoupingWidget(QWidget *parent): QWidget(parent) { QGroupBox *topGroupBox = new QGroupBox(this); QGraphicsView *xRGBPlot = new QGraphicsView(this); QGraphicsView…
While True
  • 423
  • 2
  • 15
0
votes
0 answers

Insert a copy or image of a widget into QGridLayout

I have a four-panel QGridLayout and want to reserve one of the panels for a miniature view of other widgets like 3D views. The specific widget which I want to show inside QGridLayout is to be specified dynamically. However, when I pass a widget to…
Anton Poznyakovskiy
  • 2,109
  • 1
  • 20
  • 38
0
votes
0 answers

Set up a QGridLayout with equal cell size with QWidgets + QPainter.DrawImage not displaying the image

First I will describe what I want to do. I am using QT to build a window application. What I essentially wanted to do is say, I want a gridlayout which will be 10x10 and all the cells will be 5x5 but without having to populate the grid first! I…
czioutas
  • 1,032
  • 2
  • 11
  • 37
0
votes
1 answer

Individually change margins in QGridLayout

I have a QGridLayout containing mostly QLabels. It's a 3x10 grid and I want different margins on the content of each of the three columns. Eg. I want to be able to place my labels with a different amount of space to their grid border. If I set the…
A.Faur
  • 93
  • 2
  • 8
0
votes
1 answer

Nothing showing up in QScrollArea

I have a nice widget that basically looks like a dialog box with a bunch of QSliders on it. The number of sliders varies depending on the situation when the dialog (not an actual QDialog; just a QWidget) is invoked. Since the varying number of…
norman
  • 5,128
  • 13
  • 44
  • 75
0
votes
1 answer

Table with different amount of rows and columns(diff. width) (Qt5, QGridLayout)

I want create a Table based on QGridLayout that consist my custom widgets with different amount of columns in each row, for example: http://urls.by/tbl How i can do it? When i change widgets width in first row, another rows also change width.
0
votes
1 answer

QGridLayout's addWidget block my project

The problem seems simple but I don't solved it in 2 hours.I Have this Layout: QGridLayout* view = new…
Tcz
  • 661
  • 5
  • 18
0
votes
1 answer

Widgets placing into QGridLayout

I use QGridLayout and define layout as ui file. I need to implement such layout: |Column 0 |Column 1 |Column 2 |Column 3 | |width enough to fit text|empty space|Line edit with width 66-70|width enough…
Funt
  • 399
  • 8
  • 23
0
votes
1 answer

qgridlayout background image? pyqt4

Is it possible to load a background image in qgridlayout? I have a couple of button inside a gridlayout, i wan to load a background image depending on the size of the whole gridlayout. thanks
unice
  • 2,655
  • 5
  • 43
  • 78
-1
votes
1 answer

Why do QGridLayout Widgets move around when adding new ones?

I can't seem to wrap my head around how they work. The the best for placing multiple widgets seems to be QGridLayout but when I add something into a specific row/column and later decide to add somthing into another row/column everything shifts and…
Tabi
  • 3
  • 1
-1
votes
1 answer

How can I refer to a form element from a class in Qt?

Hello. I am writing a minesweeper. I need to call from the `My_PushButton` class to `gridLayout_2` (* just put it on the form, it was not dynamically created *), in which the elements of the `My_PushButton` class are located, so that if the" mine…
Gremeat
  • 39
  • 1
  • 6
1 2 3
13
14