Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1076

spinBox.setButtonSymbols(PlusMinus) does not work

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.12.4
    • PySide
    • None
    • macOS

    Description

      I suspect this is a Qt bug and not a PySide2 bug.  But here's the description.  While working on changing the buttons on a QSpinBox to +- symbols I found that it doesn't work. It simply leaves the buttons as they are:  

       

      myspin.setButtonSymbols(QtWidgets.QAbstractSpinBox.PlusMinus)

       

      Removing the buttons does work so I know I have the syntax correct:

       

      myspin.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons)

       

       

      Code example:  

       

      from PySide2 import QtCore, QtGui, QtWidgets, __version__
      import sys
      print( f" PySide2 version = {__version__}")
      print( f" PySide2 Qt version = {QtCore.__version__}")
      class Ui_Form(object):
       def setupUi(self, Form):
         Form.resize(120, 100)
         self.horizontalLayout = QtWidgets.QHBoxLayout(Form)
         self.myspin = QtWidgets.QSpinBox(Form)
         self.horizontalLayout.addWidget(self.myspin)
      if __name__ == "__main__":
       app = QtWidgets.QApplication(sys.argv)
       Form = QtWidgets.QWidget()
       ui = Ui_Form()
       ui.setupUi(Form)
       #ui.myspin.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) #this works - removes buttons
       #ui.myspin.setButtonSymbols(QtWidgets.QAbstractSpinBox.UpDownArrows) #this is same as default
       #ui.myspin.setButtonSymbols(QtWidgets.QAbstractSpinBox.PlusMinus) #this is same as UpDownArrows/default
       Form.show()
       sys.exit(app.exec_())
       
      

       

      Attachments

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

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            chmedly Warren Gandy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes