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

QSpinBox taking up too little space with stylesheet

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.9.2
    • Widgets: Style Sheets
    • None
    • All

      Qt 6.9.2 claims to have fixed some issues around QSpinBox height when a stylesheet is applied, but it has introduced another one; they are now too small.

      Reproduction (using PySide, but I assume the bug is not python specific):

      from PySide6.QtWidgets import QMainWindow, QWidget, QVBoxLayout, QSpinBox, QApplication
      
      class SpinWindow(QMainWindow):
          def __init__(self, parent=None):
              super().__init__(parent)
              w = QWidget(self)
              self.setCentralWidget(w)
      
              s1 = QSpinBox(self)
              s2 = QSpinBox(self)
              s2.setStyleSheet(" ")
      
              layout = QVBoxLayout(w)
              layout.addWidget(s1)
              layout.addWidget(s2)
      
      if __name__ == "__main__":
          app = QApplication()
          app.setStyle("fusion")
          sw = SpinWindow()
          sw.show()
          app.exec()
      

      In PySide 6.9.1 (Bottom spinbox too big):

      In PySide 6.9.2 (Bottom spinbox too small):

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            pjj56 Philip Jones
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes