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

Windows11Style: Fix QSlider layouting

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.9
    • Widgets: Styles
    • Windows

      The following code shows all the problems I've found so far:

      QWidget w2;
      auto pal = qApp->palette();
      pal.setBrush(QPalette::Window, Qt::green);
      auto lay = new QHBoxLayout(&w2);
      for (auto orientation : { Qt::Horizontal, Qt::Vertical }) {
          for (auto tickPos : { QSlider::NoTicks, QSlider::TicksBothSides , QSlider::TicksAbove, QSlider::TicksBelow }) {
              auto s = new QSlider(orientation);
              s->setTickPosition(tickPos);
              s->setAutoFillBackground(true);
              s->setPalette(pal);
              lay->addWidget(s);
          }
      }
      w2.show();
      

      This results in the following output:
      While this looks not that bad, there are several problems better visible when using QT_SCALE_FACTOR=3:

      • the handle is cutted off on the left with QT_SCALE_FACTOR=1
      • the groove is too long in the left with QT_SCALE_FACTOR=3
      • the groove is not centered when no tickmarks are shown with QT_SCALE_FACTOR=3
      • the tickmarks are not fully visible
      • the handle is drawn in different sizes, the drawing does not fully comply with the style as the style does not draw an inner circle with controlStrokeSecondary
      • the groove has a small outline with frameColorLight which is also not compliant to the style:

        For Gerrit Dashboard: QTBUG-140649
        # Subject Branch Project Status CR V

            chehrlic Christian Ehrlicher
            chehrlic Christian Ehrlicher
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change