qlayout Questions
2
Solved
I made a "widget" in Qt Designer with about a dozen controls organized into horizontal and vertical layouts.
Oddly, every horizontal layout wants to be some large size, about 400 px wide,...
Pruinose asked 9/3, 2011 at 16:52
2
Solved
I use QGridLayout very often, and there's a requirement I don't know how to or if I can achieve with this kind of layouts.
My question: Imagine I have two normal widgets (derived from QWidget) on t...
6
Solved
In Qt, When I add widgets to my layout, they are vertically centered by default. Is there a way to "List" the widgets from top to bottom instead of centering them vertically?
3
I have a QLabel just below a QLineEdit with the same size and alignment properties:
QLineEdit *lineEdit = new QLineEdit("999");
lineEdit->setFixedWidth(100);
lineEdit->setAlignment(Qt::Align...
2
Solved
I'm trying to remove a Qt widget from a layout in a PySide application.
Here is a minimal example. It is a widget with 5 buttons in it, and the middle one is supposed to remove itself when clicked...
2
Solved
I'm working on a GUI application with pyqt5. At a certain dialog I need many components, being one of those a QWebEngineView as a canvas for plotting data, which should take most of the space avail...
1
Solved
I'm trying to align every widgets in a QHBoxlayout to the top but what I get is every widget seems centered. I think this is due to there different sizes.
For instance with:
from PyQt5.QtGui impo...
1
Solved
I am trying to create a layout looking like this:
_________
| | |
|1 | 2 |
|__|______|
| 3 | 4 |
|____|____|
Basically, I want cell number 1 the first row to be thinner that cell 2, but cells n...
Lohengrin asked 20/12, 2017 at 16:10
1
Solved
I'm trying to create a docked interface in PyQt5, creating a BoxLayout contining my various widgets, and then applying this layout to the QDockWidget.
My approach so far has been:
self.layout = Q...
Gardal asked 19/10, 2017 at 12:58
1
Main Question
What is the "right" way to give your widgets default sizes and make sure they contract, expand, or remain fixed if there is additional or not enough space to accommodate them?
How I...
Galeiform asked 14/7, 2016 at 20:23
2
Solved
Using the designer in Qt creator I have created a dialog that contains various widgets in a vertical layout. One of the widgets is a QLabel with word wrap set to true. The text for the QLabel is se...
Sartorial asked 10/10, 2013 at 10:39
1
Solved
New to PyQt5... Here is a very basic question.
I would like to add an image inside the layout of a widget. This widget is the Main Window / root widget of my application. I use the following code,...
Richers asked 16/2, 2016 at 2:14
4
Solved
I've got a QGridLayout with a few widgets in it. The important ones are 2 labels, which I use for drawing images to the screen. Well, if the user wants, he can change the resolution of the incoming...
Brooklet asked 20/2, 2013 at 13:7
1
Solved
I am able to find the QRadioButton this way:
for(int i = 0; i < ui->verticalLayout->count(); i++)
{
QRadioButton* r = qobject_cast<QRadioButton*>(ui->verticalLayout->itemAt(i)...
2
Solved
I am working on a Qt Project and for this project I require to design something like this:
I have designed so far in Qt Creator and I have the component ready, but when I am trying to add widget...
1
Solved
As the layout object has no attribute ".setStyleSheet()", how can one set the background color for a given layout?
As a visual explanation, I can set both the label and the button background color...
Freightage asked 16/12, 2014 at 8:44
2
I have a QGLWidget, which I want to resize to a given resolution (bigger than the containing window).
My intention is, that the window expands until the widget fits inside, but can't find a way to ...
1
Solved
I want to create some tabs, and I read this answer: How to add a tab in PySide
I use the code in the answer and made some changes. Cause my code has to read some files and get the name of my tabs ...
2
Solved
I'm struggling to set content margins to zero from QLayout objects in Qt with a stylesheet. I can remove them with QLayout::setContentsMargins(0, 0, 0, 0) but I would prefer to do it from styleshee...
Explode asked 29/11, 2012 at 19:28
1
Solved
It seems most people are asking how to make their QMainWindow resize to its contents - I have the opposite problem, my MainWindow does resize and I don't know why.
When I set my QLabel to a longer...
Lithophyte asked 12/2, 2014 at 20:41
1
Solved
I have a QScrollArea with some buttons in it, like shown on the picture.
The idea of the layout is:
1. The left and right button should be used for scrolling the buttons when they are too wide
...
Krysta asked 21/1, 2014 at 9:17
1
Solved
1
Solved
Say I have something like this:
void someClass::start()
{
QLabel* label = new QLabel();
label->setText("Hello World");
ui.verticalLayout->addWidget(label);
}
Does addWidget make...
1
Solved
I am currently using a QMainWindow widget and would like to remove margins around the widget inside. I succeeded at removing margins for window borders, but not for the widgets inside my window.
He...
Viborg asked 8/12, 2013 at 5:41
1
Solved
I have a custom widget which has an overall layout of a QVBoxLayout. It contains several labels, a QFormLayout, a button, and a stretch to eat all excess space. One of the labels can be quite large...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.