Jump to content

Set Style Sheet of a Houdini Button


gemini

Recommended Posts

Hi,

  Can it be done somehow to set style sheet of a Houdini button ?

Thanks!
Sz

...


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')
        self.exec_btn.setStyleSheet("background-color: darkorange")
        self.exec_btn.setFlat( False)

        # global layout setting
        g_layout.addLayout(layout)
        g_layout.addWidget(self.exec_btn)
 

..

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...