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

QStyle::subControlRect() gives incorrect result for slider handle

    XMLWordPrintable

Details

    • Windows
    • Bug Fixing Candidates

    Description

      In order to find a rectangle for a QSlider handle, the following code gives the wrong output

       QStyle *style = slider->style();
          QStyleOptionSlider *option = new QStyleOptionSlider;
          option->rect = slider->rect();
          option->maximum=slider->maximum();
          option->minimum=slider->minimum();
          option->sliderValue=slider->value();
          QRect handle = style->subControlRect(QStyle::CC_Slider, option,
                                               QStyle::SC_SliderHandle, slider);
      

      Please refer to the attached sample

      Attachments

        1. qtbug91416.zip
          2 kB
          Shveta Mittal
        2. slider handle metrics.png
          3 kB
          ivan tkachenko

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              shmittal Shveta Mittal
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes