Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-133128

Windows11Style: QSlider min position off

    XMLWordPrintable

Details

    • Windows
    • dee731ae9 (dev), 6a6a1c0fe (6.9), b9206f184 (6.8)

    Description

      The min position of a horizontal slider doesn't look like it is at the minimum.

      I've included two instances of MS Paint in the screenshot for reference.

       

      Code:

      void MainWindow::testSliders()
      {
          QDialog dlg;    
          auto groupBox = new QGroupBox;
          groupBox->setTitle("Dynamic range");
          auto layout = new QGridLayout;
          groupBox->setLayout(layout);    auto addSlider = [](QGridLayout* layout, int row, QString text)
          {
              QLabel* label = nullptr;
              auto slider = new QSlider(Qt::Horizontal);
              layout->addWidget(new QLabel(text), row, 0);
              layout->addWidget(slider, row, 1);
              layout->addWidget(label = new QLabel("0"), row, 2);
              connect(slider, &QSlider::valueChanged, [label](int value) {label->setText(QString::number(value)); });
              return slider;
          };
          auto min = addSlider(layout, 0, "Min:");
          auto max = addSlider(layout, 1, "Max:");    max->setValue(max->maximum());    new QVBoxLayout(&dlg);
          dlg.layout()->addWidget(groupBox);
          dlg.exec();
      } 

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            bjornpiltz Björn Piltz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes