QDoubleSpinBox not consistent with hou.ui.stylesheet
6166
5
2
tas3d
Member
120 posts
Joined: Jan. 2012
Offline
April 30, 2018 4:49 a.m.
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 @
www.vfxtricks.com
rvinluan
Staff
1256 posts
Joined: July 2005
Offline
April 30, 2018 5:52 p.m.
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
tas3d
Member
120 posts
Joined: Jan. 2012
Offline
April 30, 2018 6:02 p.m.
thanks for workaround. RFE submited. cheers
Michal Tas Maciejewski @
www.vfxtricks.com
tas3d
Member
120 posts
Joined: Jan. 2012
Offline
June 21, 2018 4:32 a.m.
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 @
www.vfxtricks.com
jbudsberg
Member
92 posts
Joined: Aug. 2010
Offline
Dec. 17, 2019 1:34 p.m.
do you have a ticket number? I just ran into the same issue, but can't find anything regarding QDoubleSpinBox in the search. thanks!
tas3d
Member
120 posts
Joined: Jan. 2012
Offline
Dec. 17, 2019 1:44 p.m.
#89198
Michal Tas Maciejewski @
www.vfxtricks.com