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

spincontrol-disable-on-bounds style hint has no effect in QSpinBox style sheet

    XMLWordPrintable

Details

    • 70c053ee684448984b1f762abd3b40884cece2fa (qt/qtbase/5.14)

    Description

      spincontrol-disable-on-bounds style sheet hint is not properly checked on QAbstractSpinBox instances.

      Small testcase:

      #include <QtWidgets>
      
      int main(int argc, char **argv)
      {
          QApplication app(argc, argv);
          
          QSpinBox sb;
          // since the default is true in qcommonstyle, we have to set to 0 to see an effect
          sb.setStyleSheet("QSpinBox { spincontrol-disable-on-bounds: 0; } ");
          sb.show();
          
          return app.exec();
      }
      

      The problem is in the following method:
      qabstractspinbox.cpp:
      void QAbstractSpinBox::initStyleOption(QStyleOptionSpinBox *option) const

      The call to styleHint() in this methid should pass "this" as a third argument.

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes