Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QStyledItemDelegate subclass for drawing QSlider behaves strangely on macOS
Forum Updated to NodeBB v4.3 + New Features

QStyledItemDelegate subclass for drawing QSlider behaves strangely on macOS

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 829 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • MrBoltonM Offline
    MrBoltonM Offline
    MrBolton
    wrote on last edited by
    #1

    I wrote a subclass of QStyledItemDelegate to paint a QSlider inside a QAbstractTableView.

    On Windows this behaves just fine. But on macOS every single delegate is being painted in the top left corner of the table view. I tried with several Qt versions (5.9.6, 5.12.0) , they all behave the same.

    Please see this example project: https://github.com/tobireuen/sliderdelegate-test.git
    In sliderdelegate.cpp:45 I assign the option.rect to my instance of QStyleOptionSlider. The coordinates of this rect are fine on both Windows and macOS. This can be seen in the debug prints.

    Where does this difference come from? How can I get rid of the problem on macOS? Am I doing something wrong regarding the configuration of QStyleOptionSlider?

    Thanks you for any help

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      No, you're doing things correctly. It's a bug in the macOS style. You should check the bug report system to see if it's something known. If not, please open a new report providing your project as a zip file in the report.

      In any, don't forget to post the link to the report here.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • MrBoltonM Offline
        MrBoltonM Offline
        MrBolton
        wrote on last edited by
        #3

        Hi SGaist,

        thanks for pointing this out. I found this bug report regarding the issue: https://bugreports.qt.io/browse/QTBUG-72558

        I can help myself using the fusion style for now. But let's hope this gets fixed soon.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          The problem is similar yet it's not the same control that has the issue. You should open a new report and link it to this one.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • MrBoltonM Offline
            MrBoltonM Offline
            MrBolton
            wrote on last edited by
            #5

            Just a quick update:
            I did as you told, the report got closed as a duplicate just an hour later. Well, well.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved