As reported here (https://bugreports.qt.io/browse/QTBUG-98093), QSlider component in QT is not working well in the new MacOS update.
If I add two or more horizontal sliders in the same window, dragging the grip in one slider affects the other ones. It may cause all of them to move together or may make the next one jump to an unexpected position.
This code below can reproduce the issues:
#include <QApplication>
#include <QDialog>
#include <QVBoxLayout>
#include <QSlider>
class Dialog: public QDialog
{
QSlider* brokenSlider;
public:
explicit Dialog(QWidget *parent = nullptr):QDialog(parent){
auto mainLayout = new QVBoxLayout;
brokenSlider = new QSlider(Qt::Horizontal, this);
mainLayout->addWidget(brokenSlider);
connect(brokenSlider, &QSlider::valueChanged, [&](){this->update();});
mainLayout->addWidget(new QSlider(Qt::Horizontal, this));
mainLayout->addWidget(new QSlider(Qt::Horizontal, this));
setLayout(mainLayout);
}
};
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Dialog g;
g.exec();
}
I'm looking for a workaround for this Apple/QT bug.