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

Qt - how to use layouts in Qt designer

I have some troubles in using layouts. as you know Qt designer has some layouts by default but they cant help me. in the widgets bar in layouts section there are some customized layouts but I cant use them , they are actually do nothing when i…
user4000670
0
votes
0 answers

Qt menubar disappears when I use scroll area

I want to implement a vertical scroll bar. I have implemented layouts for this(see the attached layouts.jpg), and also scroll area(see snippet in below code). Yet, when I run, the window does not have menubar. What am I missing here? I tried adding…
cappy0704
  • 557
  • 2
  • 9
  • 30
0
votes
1 answer

QHBoxLayout Spacing

I have an QHBoxLayout that includes two QLabel widgets. My left QLabel is much larger than my right QLabel, however, the QHBoxLayout is splitting the output in half, so the left side of the layout is too small and the right side of the layout is too…
user3594111
  • 1
  • 1
  • 1
0
votes
1 answer

QLayout refresh mechanic not understood

I don't understand what mechanic/trigger causes the layout to update. In the simple example I created, the button's text is updated real-time inside the method, but the layout does not update until after the method is completed even though "I should…
0
votes
1 answer

Keep text together in a QHBoxLayout

I'm trying to make a hyperlink in my application. I got two label, one of them is the hyperlink. labelPropulsedBy = new QLabel(); labelPropulsedBy->setText(tr("Propulsé par ")); labelPropulsedBy->setLayout(hboxLayout); labelWebLink = new…
Chax
  • 1,041
  • 2
  • 14
  • 36
0
votes
3 answers

Qt arranging ltems in layout

For the last couple of days i am trying to solve a particular problem with the Qt Layout system. I'll try to generalize it: I have a widget with two rows. On the first row there are tree buttons( or whatever other controls ). Their layout is shown…
GeneralFailure
  • 1,085
  • 3
  • 16
  • 32
0
votes
1 answer

How to use Qt layout correctly

I'm trying to play around with the GUI layouts and see what I could do with it. Here's what I wish to achieve: there is a title frame on the top half of the widget, and it should look like this: ***************************** * [LOGO] …
0
votes
1 answer

Layoust Issue : Qlistbox in a groupbox auto expands when layout of form is set to vertical

I have a Qlistbox inside a QgroupBox whose layout is set to "Layout in a form layout" now the QgroupBox is inside a form whose layout is set to vertical. Actually whenever I set the layout of the form to vertical the QlistBox expands. I have set the…
MistyD
  • 16,373
  • 40
  • 138
  • 240
-1
votes
2 answers

How do I get values from multiple QLineEdit into one matrix?

I'm quite new to QT, and I wanted to do the following: Have a layout which initially consist of 1 QLineEdit (text) for input and 1 button for confirming it (button). Then I wanted to send signal SetN(N) when the button is clicked and this signal…
Lyokoheros
  • 75
  • 10
-1
votes
1 answer

Infinite QGraphicsView::resizeEvent calls

I have a custom layout BoardLayout, which inherits QLayout. It is written in analogy to BorderLayout example (https://doc.qt.io/qt-5/qtwidgets-layouts-borderlayout-example.html), with a following setGeometry() method: void…
user87035
  • 11
  • 3
-1
votes
1 answer

Can't position the QGraphicsView with fixed ratio

My problem is about forcing QGraphicsView to save its ratio size. I read Keeping the aspect ratio of a sub-classed QWidget during resize and it helped me to position QWidget in example. int main(int argc, char *argv[]) { QApplication a(argc,…
-1
votes
1 answer

How to center items in a QBoxLayout without using QSpacerItems

A QLayout always tries to use the whole available space of the QWidget. But, sometimes, you want it to keep it's minimal size and center itself on the widget...because you feel like it looks better (if the layout only contains items that does not…
jpo38
  • 20,821
  • 10
  • 70
  • 151
-2
votes
1 answer

Add GroupBox in a layout

I am using Qt 5.15.3, with Qt cretor. I would like to add a QGroupBox in a QVBoxLayout Does anyone have an idea to add it in the layout ? Here is what I have tried : #include #include #include #include…
Timothée
  • 66
  • 8
-2
votes
1 answer

create object for class inheriting QLayout

I have a screen class as class Screen : public QLayout { public: Screen(); ~Screen(); void paintEvent(QPaintEvent *e); }; When I am creating the object I got an error that can not create an object for pure…
Akhil V Suku
  • 870
  • 2
  • 13
  • 34
1 2 3
15
16