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

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

XMLWordPrintable

    • Windows
    • Bug Fixing Candidates

      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

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes