Issues with Qt Ui Editor
-
wrote on 11 Sept 2023, 19:20 last edited by Derker 9 Nov 2023, 19:24
Have as graphical and logical issues with qt ui editor.
- At first, when i start Qt and open ui editor, the table with elements not renderign properly. After expanding all in menu, it fixes,but after restarting Qt its happening again.
- Second and more critical bug, when i trying to connect QSlider with QLabel in ui editor, I get an error
no matching function for call to 'QObject::connect(QSlider&, void (QAbstractSlider::)(int), QLabel&, <unresolved overloaded function type>)'
There is the code that was generated by Qt
QObject::connect(indexSlider, &QSlider::valueChanged, label_2, &QLabel::setNum);
- At first, when i start Qt and open ui editor, the table with elements not renderign properly. After expanding all in menu, it fixes,but after restarting Qt its happening again.
-
Have as graphical and logical issues with qt ui editor.
- At first, when i start Qt and open ui editor, the table with elements not renderign properly. After expanding all in menu, it fixes,but after restarting Qt its happening again.
- Second and more critical bug, when i trying to connect QSlider with QLabel in ui editor, I get an error
no matching function for call to 'QObject::connect(QSlider&, void (QAbstractSlider::)(int), QLabel&, <unresolved overloaded function type>)'
There is the code that was generated by Qt
QObject::connect(indexSlider, &QSlider::valueChanged, label_2, &QLabel::setNum);
wrote on 12 Sept 2023, 06:28 last edited by ChrisW67 9 Dec 2023, 06:39@Derker There are two overloads of QLabel::setNum(). Both could accept an int argument.
You need to tell Qt which to choose, something like this:
connect( indexSlider, &QSlider::valueChanged, slider, QOverload<int>::of(&QLabel::setNum) );
I cannot see a way to do that in Qt Designer (6.5.2) which clearly knows both slots exist, but only offers the setValue(int) variant once you select the valueChanged(int). The UI file results in
uic
producing the ambiguous code you posted.
- At first, when i start Qt and open ui editor, the table with elements not renderign properly. After expanding all in menu, it fixes,but after restarting Qt its happening again.
-
@Derker There are two overloads of QLabel::setNum(). Both could accept an int argument.
You need to tell Qt which to choose, something like this:
connect( indexSlider, &QSlider::valueChanged, slider, QOverload<int>::of(&QLabel::setNum) );
I cannot see a way to do that in Qt Designer (6.5.2) which clearly knows both slots exist, but only offers the setValue(int) variant once you select the valueChanged(int). The UI file results in
uic
producing the ambiguous code you posted.
1/3