QDoubleSpinBox not consistent with hou.ui.stylesheet

   175   3   2
User Avatar
Member
41 posts
Joined: Jan. 2012
Offline
Hi,

Here is comparison of QSpinBox and QDoubleSpinBox in PySide2.

Why double looks so odd compared to all other Qt Widgets?
Is there a way to override just QDoubleSpinBox style in hou.ui.stylesheet ?

This is captured on Windows, but same on Linux with Qt4 and Qt5.

Code borrowed from
http://ikatnek.blogspot.co.nz/p/pyside2.html [ikatnek.blogspot.co.nz]

thanks

from PySide2 import QtWidgets

class MainWindow(QtWidgets.QMainWindow):
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        self.construct_ui()

    def construct_ui(self):
        self.setStyleSheet(hou.qt.styleSheet())
        self.setProperty("houdiniStyle", True)
        self.setWindowTitle('PySide2 Test')
        # main widget
        main_widget = QtWidgets.QWidget(self)
        self.setCentralWidget(main_widget)
        # layout initialize
        g_layout = QtWidgets.QVBoxLayout()
        layout = QtWidgets.QFormLayout()
        main_widget.setLayout(g_layout)
        # Add Widgets
        self.parm = QtWidgets.QSpinBox()
        self.parm.setValue(30)
        self.parm2 = QtWidgets.QDoubleSpinBox()
        self.parm2.setValue(30)
        layout.addRow('Parameter', self.parm)
        layout.addRow('Parameter', self.parm2)
        self.exec_btn = QtWidgets.QPushButton('Execute')
        # global layout setting
        g_layout.addLayout(layout)
        g_layout.addWidget(self.exec_btn)

        

w = MainWindow()

w.show()

Edited by tas3d - April 30, 2018 04:50:47

Attachments:
Capture.JPG (130.9 KB)

Michal Tas Maciejewski @ Weta Digital
User Avatar
Staff
997 posts
Joined: July 2005
Offline
Hi Michal,

It's likely that there is no style specified for QDoubleSpinBox in the Houdini Qt style sheet.

Feel free to submit a bug for that issue:
https://www.sidefx.com/bugs/#/create/ [www.sidefx.com]

The workaround is to make a copy of $HFS/houdini/config/Styles/base.qss, paste it into $HOME/houdini16.5/config/Styles/base.qss and then add QDoubleSpinBox styles in the pasted file.

Cheers,
Rob
User Avatar
Member
41 posts
Joined: Jan. 2012
Offline
thanks for workaround. RFE submited.
cheers
Michal Tas Maciejewski @ Weta Digital
User Avatar
Member
41 posts
Joined: Jan. 2012
Offline
Is there other way to define this style for QDoubleSpinBox ?

I tried setStyle(), setStylesheet, setPalette() during UI init, but none works.

Or should I do it for

I dont have access to base.qss
Michal Tas Maciejewski @ Weta Digital
  • Quick Links