Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.12.3, 5.13.0
-
None
-
Qt 5.13.0, macOS 10.14.6.
Description
When I have multiple, identical QSliders, with the same settings and the same value, the sliders do not resize properly when the main window is resized. The sliders are in a layout (it does not matter if this is a QVBoxLayout or a QGridLayout). When the value of at least one slider is different from the others the resizing works as expected. I'm using Qt 5.13.0 on macOS 10.14.6.
When the sliders are incorrectly sized, and the value of one of the sliders is changed to be different from the other, and the window is resized again, the sliders resize correctly.
When an incorrectly sized slider is clicked, it immediately resizes properly. But the other sliders remain their old size.
Minimal example:
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { auto w = new QWidget; auto layout = new QGridLayout(w); setCentralWidget(w); auto slider1 = new QSlider; slider1->setMinimum(0); slider1->setMaximum(20); slider1->setOrientation(Qt::Horizontal); slider1->setTickInterval(5); slider1->setTickPosition(QSlider::TicksBelow); layout->addWidget(slider1, 0, 0); auto slider2 = new QSlider; slider2->setMinimum(0); slider2->setMaximum(20); slider2->setOrientation(Qt::Horizontal); slider2->setTickInterval(5); slider2->setTickPosition(QSlider::TicksBelow); layout->addWidget(slider2, 1, 0); }