Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.12.4
-
None
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_())