Created
April 10, 2017 10:02
-
-
Save taikomatsu/c8ec6227c4b4e91c5177ede093816fe2 to your computer and use it in GitHub Desktop.
H16 PySide2 easy example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hou | |
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.setWindowTitle('PySide2 Test') | |
# match look & feel to H16 | |
self.setStyleSheet(hou.qt.styleSheet()) | |
self.setProperty("houdiniStyle", True) | |
# 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) | |
layout.addRow('Parameter', self.parm) | |
self.exec_btn = QtWidgets.QPushButton('Execute') | |
# global layout setting | |
g_layout.addLayout(layout) | |
g_layout.addWidget(self.exec_btn) | |
w = MainWindow() | |
w.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment