Questions tagged [qlayout]

The QLayout class, part of the Qt framework, is the base class of geometry managers.

This is an abstract base class inherited by the concrete classes QBoxLayout, QGridLayout, QFormLayout, and QStackedLayout.

Documentation can be found here for Qt 4.8 and here for Qt 5.

239 questions
0
votes
2 answers

How to arrange QCamera with other widgets in a layout?

This is about arranging a multimedia object with widgets. Following is what I have tried: MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { m_QPushButton_calibration = new QPushButton("Calibrate", this); …
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
0
votes
2 answers

Responsive QGraphicsWidget

My problem is a simple yet annoying user experience damaging one. I'm trying to display huge amounts (10 of thousands) of custom QGraphicsItems on a QGraphicsScene. I would also require a QGraphicsLayout, but to my understanding one could not simply…
0
votes
1 answer

What's the best way to have a grid of QWidget with fixed size column?

I am trying to build this QWidget with Qt : | QLabel 00 | QLabel 01 | QPushButton | | QLabel 10 | QLabel 11 | (Nothing here) | | QLabel 20 | QLabel 21 | (Nothing here) | Currently…
Laurent Mesguen
  • 354
  • 2
  • 6
  • 22
0
votes
1 answer

How do I modify a QLayout of a QGroupBox to remove or add parameter QTextEdit input? (Python, PyQt)

I'm trying to implement a window that is able to get parameters from a user. In this window, the user should give a number of lines (to have N parameter sets). From this number I would like to have the automatically generation of QTextEdit sets for…
ymmx
  • 4,769
  • 5
  • 32
  • 64
0
votes
1 answer

How to use setupUi or uic output to create a free-standing layout without a parent widget?

The output generated by uic from a .ui files always installs the layouts and child widgets on an existing widget. This works great when you intend to add the layout/children directly on a widget: #include "ui_form.h" QWidget widget; Ui::Form…
Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313
0
votes
2 answers

QLayout Additem - prevent transfer of ownership

I am having problems with the object references when using the QLayout to arrange my widgets in on bigger window next to each other. I have the following situation class MyClass(QObject): widgetCollection = [] def spawn(self): …
RaJa
  • 1,471
  • 13
  • 17
0
votes
1 answer

Designing GUI programmatically - good practice for nested layouts and multiple widgets (Qt)

I am interested in better understanding Qt and for that I would like to see how a relatively complex example of nested layouts and multiples widgets GUI is done solely programmatically; i.e. without the use of Qt Creator's Design. I have seen…
user6167676
0
votes
1 answer

Add data to QScrollArea dynamically

I have a QStandardItemModel and it contains my data which has around 5000 rows. I want to insert the data into QScrollArea in batches. If I insert it altogether the performance becomes really slow. Hence I want to add the data when it is required by…
Sandy
  • 11
  • 4
0
votes
1 answer

Allignment of a QLabel and a QCheckBox in a BoxLayout gives unexpected result

when i add a QLabel and QCheckBoxs to either a QVBoxLayout or a QHBoxLayout i would expect them to be evenly distributed but the checkboxes will allign tight at the very bottom (in the above example) and the label will be centered on the resulting…
tobilocker
  • 891
  • 8
  • 27
0
votes
0 answers

Fixed sized scroll area with layout.

What I want to do is to show new QWidget, which is set in QScrollArea. The Grid Layout is set in Scroll Area and than VBox Layout is added to the Grid one. Program allows to add dynamically Labels in this VBox Layout. I want scroll area has fixed…
WJuz
  • 37
  • 1
  • 6
0
votes
0 answers

delete a layout and reset another one

I have QWidget *myWidget; //on my mainWindow with Qt Creator and a QComboBox *myComboBox; When I change my selection of myComboBox, I would like to delete myWidget->layout(); and set to myWidget another layout. I'm doing : (with this help :…
0xPunt
  • 313
  • 1
  • 4
  • 21
0
votes
1 answer

PyQt5 add custom QWidget to QLayout

Currently I am trying to add a custom QWidget class to a QVBoxLayout. The problem I'm getting is that the widget doesn't appear at all in the layout. I even tried setting the minimum size of the QWidget because I thought that the widget wasn't…
Max
  • 2,072
  • 5
  • 26
  • 42
0
votes
1 answer

Qt 'glue' two widgets together

I have two widgets (both QFrames), none of them have any title bar associated with them (which I achieve through setWindowFlags(Qt::FramelessWindowHint)). One of them is a main widget, and the other a sidebar sort of widget, which is supposed to…
SexyBeast
  • 7,913
  • 28
  • 108
  • 196
0
votes
2 answers

doLayout: how to setGeometry on top of another widget?

I want to create custom Layout alike here: http://doc.qt.io/qt-5/qtwidgets-layouts-flowlayout-flowlayout-cpp.html I want some methood to put checkbox on top of custom button. For now there are setGeometry(QRect(QPoint(... methods for either button…
cnd
  • 32,616
  • 62
  • 183
  • 313
0
votes
0 answers

How to force layout recalculation after one of its children is resized using CSS?

I have a dialog box with two widgets (which are actually vertical layouts themselves), and a spacer in the middle, arranged as a horizontal layout, like so (layout "lines" are red): I also have a global stylesheet that's loaded and parsed at…
user4520
  • 3,401
  • 1
  • 27
  • 50