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

Wrong size of QSlider handle when apply a margin in style

    XMLWordPrintable

Details

    Description

      Trying to make the QSlider handle bigger than the groove, similar to example in the style sheet documentation.
      There is set positive top and bottom margin for groove style and negative for handle. In designer window and preview it looks perfect, like in correct.png. But when compile the application result is completely wrong, showed in wrong.png. Can be seen that hover and pressed styles are applied over the correct size of handle, but handle is drawn bigger. There is attached a simple test application.

      I have made several tests around the issue:
      using only margin in groove
      in designer handle is limited to groove border
      in application handle is displayed with right size
      in application active area of handle is within the groove border

      using only margin in handle
      in designer handle is displayed with right size
      in application handle is displayed with double size
      in application active area of handle is area of needed size (size in designer)

      using only margin in groove and handle
      in designer handle is displayed with right size
      in application handle is displayed with double size + the size of groove margin
      in application active area of handle is area of needed size (size in designer)

      All test are over the horizontal slider, but same issue exist for vertical.

      Attachments

        1. correct.png
          correct.png
          24 kB
        2. test.zip
          3 kB
        3. wrong.png
          wrong.png
          18 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            dedietri Gabriel de Dietrich (drgvond)
            logi Svilen Stoianov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes