def __init__(self, element, message, parent=None): super(SampleWindow, self).__init__(parent=parent) self.element = element self.main_layout = QtWidgets.QHBoxLayout(self) #for a,b in enumerate(element): #print e msg = element.evalParm("element")+'has not been cached,' self.textMsg = QtWidgets.QLabel(msg) self.btn_spool = QtWidgets.QPushButton('spool') self.btn_cache = QtWidgets.QPushButton('cache') self.btn_cancel = QtWidgets.QPushButton('cancel') verticalSpacer = QtWidgets.QSpacerItem( 40, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.main_layout.addItem(verticalSpacer) #self.btn_add.setMaximumHeight(18) #self.btn_add.setMaximumWidth(55) #self.btn_rm.setMaximumHeight(18) #self.btn_rm.setMaximumWidth(55) #self.main_layout.addWidget(self.element) self.main_layout.addWidget(self.textMsg) self.main_layout.addWidget(self.btn_spool) self.main_layout.addWidget(self.btn_cache) self.main_layout.addWidget(self.btn_cancel) self.btn_spool.clicked.connect(lambda:self.onSpool(self.element)) self.btn_cache.clicked.connect(lambda:self.onCache(self.element)) self.btn_cancel.clicked.connect(self.onCancel)
def __init__(self, path, message, parent=None): super(BundleWidget, self).__init__(parent=parent) self.path = path self.message = message self.text = QtWidgets.QLabel('message') self.main_layout = QtWidgets.QHBoxLayout(self) self.btn_spool = QtWidgets.QPushButton('spool') self.btn_cache = QtWidgets.QPushButton('cache') self.btn_cancel = QtWidgets.QPushButton('cancel') #self.btn_add.setMaximumHeight(18) #self.btn_add.setMaximumWidth(55) #self.btn_rm.setMaximumHeight(18) #self.btn_rm.setMaximumWidth(55) self.main_layout.addWidget(self.text) self.main_layout.addWidget(self.btn_spool) self.main_layout.addWidget(self.btn_cache) self.main_layout.addWidget(self.btn_cancel) self.btn_spool.clicked.connect(self.onSpool) self.btn_cache.clicked.connect(self.onCache) self.btn_cancel.clicked.connect(self.onCancel)
def __init__(self, plugin_configuration, parent): super(_PluginConfigurationWidget, self).__init__(parent=parent) self.plugin_configuration = plugin_configuration self.main_layout = QtWidgets.QVBoxLayout(self) self.main_layout.setContentsMargins( self.main_layout.contentsMargins().left() // 2, self.main_layout.contentsMargins().top() // 2, self.main_layout.contentsMargins().right() // 2, self.main_layout.contentsMargins().bottom() // 2) self.plugin_type = plugin_configuration.plugin_type if self.plugin_type == RprUsd.kPluginHybrid: plugin_qualities = 'Low-High Qualities' elif self.plugin_type == RprUsd.kPluginTahoe: plugin_qualities = 'Full (Legacy) Quality' elif self.plugin_type == RprUsd.kPluginNorthstar: plugin_qualities = 'Full Quality' self.labels_widget = QtWidgets.QWidget(self) self.main_layout.addWidget(self.labels_widget) self.labels_widget_layout = QtWidgets.QHBoxLayout(self.labels_widget) self.labels_widget_layout.setContentsMargins(0, 0, 0, 0) self.plugin_qualities_label = QtWidgets.QLabel(self.labels_widget) self.plugin_qualities_label.setText(plugin_qualities) self.labels_widget_layout.addWidget(self.plugin_qualities_label) self.incomplete_config_label = QtWidgets.QLabel(self.labels_widget) self.incomplete_config_label.setStyleSheet('color: rgb(255,204,0)') self.incomplete_config_label.setText('Configuration is incomplete: no devices') self.labels_widget_layout.addWidget(self.incomplete_config_label) self.incomplete_config_label.hide() if plugin_configuration.cpu_config.cpu_info.numThreads: cpu_widget = _DeviceWidget(parent=self, cpu_config=plugin_configuration.cpu_config) cpu_widget.on_change.connect(self.on_device_change) self.main_layout.addWidget(cpu_widget) for gpu_config in plugin_configuration.gpu_configs: gpu_widget = _DeviceWidget(parent=self, gpu_config=gpu_config) gpu_widget.on_change.connect(self.on_device_change) self.main_layout.addWidget(gpu_widget) self.is_complete = True
def __init__(self, label, first=True): super(BoxWidget, self).__init__() self.label = QtWidgets.QLabel(label + ":") self.label.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignCenter) if first: self.label.setMinimumSize(75, 20) self.label.setMaximumSize(75, 20) self.layout = QtWidgets.QHBoxLayout(self) self.layout.setSizeConstraint(QtWidgets.QLayout.SetMaximumSize) self.layout.setContentsMargins(0, 0, 0, 0) self.layout.addWidget(self.label)
def __init__(self): super(FullPreviewWindow, self).__init__() self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint) icon_label = QtWidgets.QLabel() icon_label.setAlignment(QtCore.Qt.AlignCenter) icon_label.setFrameShape(QtWidgets.QFrame.Box) icon_label.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) icon_label.setBackgroundRole(QtGui.QPalette.Base) icon_label.setAttribute(QtCore.Qt.WA_TransparentForMouseEvents) self.setCentralWidget(icon_label) self.setMouseTracking(True) self._currentIconName = '' self._requiredWidget = None
def __init__(self, scipt='lz_quick_vex', rows=4): super(LZ_vex_interface, self).__init__() #create Layout mainLayout = QtWidgets.QGridLayout() self.callbackDict = {} # read json import json hext = hou.expandString('$HEXT') self.json = json.load(open(hext + '/' + scipt + '.txt')) i = 0 # fill lists for list_key in sorted(self.json.keys()): # create list widget new_list = QtWidgets.QListWidget() items = self.json[list_key] for key in sorted(items.keys()): list_item = QtWidgets.QListWidgetItem(key) picName = key.split(". ")[len(key.split(". ")) - 1].lower().replace(":", "").replace( " ", "") #print picNam pic_path = hou.expandString( '$HEXT\pic') + '\\' + picName + r".svg" if os.path.isfile(pic_path): list_item.setIcon(QtGui.QIcon(pic_path)) new_list.addItem(list_item) self.callbackDict[key] = items[key] new_list.doubleClicked.connect(self.doubleClickedList) # create label label = QtWidgets.QLabel(list_key) #fill layout = QtWidgets.QVBoxLayout() layout.addWidget(label) layout.addWidget(new_list) mainLayout.addLayout(layout, i / rows, i % rows) i += 1 #set Layout self.setStyleSheet("background-color: hsv(0,0,45);") self.setLayout(mainLayout)
def __init__(self, configuration, show_restart_warning): super(_DevicesConfigurationDialog, self).__init__() self.configuration = configuration self.initial_configuration = configuration.deepcopy() if self.configuration.context.parent: self.setParent(self.configuration.context.parent, self.configuration.context.parent_flags) self.setSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) self.setWindowTitle('RPR Render Devices') self.main_layout = QtWidgets.QVBoxLayout(self) self.main_layout.setSizeConstraint(QtWidgets.QLayout.SetFixedSize) self.plugin_configuration_widgets = list() for config in configuration.plugin_configurations: widget = _PluginConfigurationWidget(config, self) widget.on_change.connect(self.on_plugin_configuration_change) self.main_layout.addWidget(widget) self.plugin_configuration_widgets.append(widget) if show_restart_warning: self.restart_warning_label = QtWidgets.QLabel(self) self.restart_warning_label.setText('Changes will not take effect until the RPR renderer restarts.') self.restart_warning_label.setStyleSheet('color: rgb(255,204,0)') self.restart_warning_label.hide() self.main_layout.addWidget(self.restart_warning_label) else: self.restart_warning_label = None self.button_box = QtWidgets.QDialogButtonBox(self) self.save_button = self.button_box.addButton("Save", QtWidgets.QDialogButtonBox.AcceptRole) self.save_button.setEnabled(False) self.button_box.addButton("Cancel", QtWidgets.QDialogButtonBox.RejectRole) self.button_box.accepted.connect(self.on_accept) self.button_box.rejected.connect(self.on_reject) self.main_layout.addWidget(self.button_box) self.show() self.should_update_configuration = False
def __init__(self, parent=None): # INITIALIZE GUI AND SET WINDOW TO ALWAYS ON TOP QtWidgets.QWidget.__init__(self, parent, QtCore.Qt.WindowStaysOnTopHint) # SET LAYOUTS vbox = QtWidgets.QVBoxLayout() hbox1 = QtWidgets.QHBoxLayout() # SET WINDOW ATTRIBUTES self.setGeometry(500, 300, 420, 110) self.setWindowTitle('Convert Relative File Paths to Absolute') # CREATE WIDGETS self.apply_to_label = QtWidgets.QLabel("Nodes to Update:") self.apply_to_combo_box = QtWidgets.QComboBox(self) self.update_paths_button = QtWidgets.QPushButton('Update Paths', self) # POPULATE COMBO BOX self.apply_to_combo_box.addItem("Selected Nodes Only") self.apply_to_combo_box.addItem("All Nodes In Scene (Any Context)") self.apply_to_combo_box.addItem("All Nodes In Obj Context") self.apply_to_combo_box.addItem("Selected Nodes & Their Direct Children") self.apply_to_combo_box.addItem("Selected Nodes & All Subchildren") self.apply_to_combo_box.addItem("Only Direct Children Of Selected Nodes") self.apply_to_combo_box.addItem("Only All Subchildren Of Selected Nodes") # CONNECT BUTTONS TO FUNCTIONS self.update_paths_button.clicked.connect(self.updatePaths) # ADD WIDGETS TO LAYOUT hbox1.addWidget(self.apply_to_label) hbox1.addWidget(self.apply_to_combo_box) vbox.addLayout(hbox1) vbox.addWidget(self.update_paths_button) # SET LAYOUT self.setLayout(vbox)
def __init__(self, small_string, full_string, no_margins=False): QtWidgets.QFrame.__init__(self) self.smallString = small_string self.fullString = full_string self.state = False self.helpLabel = QtWidgets.QLabel(self.smallString) self.helpLabel.setWordWrap(True) self.helpLabel.setTextFormat(QtCore.Qt.RichText) self.helpExpand = QtWidgets.QPushButton("Show More") self.helpExpand.clicked.connect(self.expandHelp) help_layout = QtWidgets.QGridLayout() help_layout.addWidget(self.helpLabel, 0, 0, 1, 5) help_layout.addWidget(self.helpExpand, 1, 0, 1, 1) self.setLayout(help_layout) if no_margins: self.setContentsMargins(0, 0, 0, 0) help_layout.setContentsMargins(0, 0, 0, 0) self.setProperty("help_text", True)
def __init__(self, paneTab): """Define all the elements of the user interface.""" QtWidgets.QWidget.__init__(self) self.setMouseTracking(True) self.factor = 100 self.mouseX = 0 self.mouseY = 0 hou.playbar.addEventCallback(self.outputPlaybarEvent) self.icons_path = hou.findDirectory( 'python_panels') + '/InBetween_icons/' self.nameLabel = QtWidgets.QLabel(self) self.nameLabel.setText('inBetween 1.0') self.nameLabel.setAlignment(QtCore.Qt.AlignCenter) self.nameLabel.mousePressEvent = self.help self.nameLabelLayout = QtWidgets.QHBoxLayout() self.nameLabelLayout.addWidget(self.nameLabel) self.valueSlider = QtWidgets.QSlider(QtCore.Qt.Horizontal, self) self.valueSlider.setTickPosition(QtWidgets.QSlider.TicksBelow) self.valueSlider.setTickInterval(1) self.valueSlider.setValue(0) self.valueSlider.setStyleSheet("QSlider:handle {width: 14px;}") self.valueSlider.setMinimum(-100) self.valueSlider.setMaximum(100) self.valueSlider.setSingleStep(1) self.valueSlider.setToolTip( 'Creates a breakdown pose for the selected objects.') invisible_btn_stylesheet = "QPushButton {border: transparent;background: transparent;height: 48px;width: 120px;} QPushButton:hover {background-color: rgb(0,0,0, 0);height: 48px;width: 120px;}" self.sizePolicy = QtWidgets.QSizePolicy( QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding) self.sizePolicy.setHeightForWidth(True) self.zeroBtn = QtWidgets.QPushButton(self) self.zeroBtn.setMaximumHeight(30) self.zeroBtn.setSizePolicy(self.sizePolicy) self.zeroBtn.clicked.connect(self.zeroBtnAction) self.zeroBtn.setStyleSheet(invisible_btn_stylesheet) self.minStepBtn = QtWidgets.QPushButton(self) self.minStepBtn.setMaximumHeight(30) self.minStepBtn.setSizePolicy(self.sizePolicy) self.minStepBtn.clicked.connect(self.minStepBtnAction) self.minStepBtn.setStyleSheet(invisible_btn_stylesheet) self.plusStepBtn = QtWidgets.QPushButton(self) self.plusStepBtn.setMaximumHeight(30) self.plusStepBtn.setSizePolicy(self.sizePolicy) self.plusStepBtn.clicked.connect(self.plusStepBtnAction) self.plusStepBtn.setStyleSheet(invisible_btn_stylesheet) self.buttonLayout = QtWidgets.QHBoxLayout() self.buttonLayout.addWidget(self.minStepBtn, 1) self.buttonLayout.addStretch(1) self.buttonLayout.addWidget(self.zeroBtn, 1) self.buttonLayout.addStretch(1) self.buttonLayout.addWidget(self.plusStepBtn, 1) self.makeGhostBtn = QtWidgets.QPushButton(self) self.makeGhostBtn.setMinimumHeight(30) self.makeGhostBtn.setSizePolicy(self.sizePolicy) self.makeGhostBtn.setIcon(QtGui.QPixmap(self.icons_path + 'ghost.png')) self.makeGhostBtn.clicked.connect(self.manuallyCreateGhost) self.makeGhostBtn.setToolTip('Makes a new ghost.') self.delGhostBtn = QtWidgets.QPushButton(self) self.delGhostBtn.setMinimumHeight(30) self.delGhostBtn.setSizePolicy(self.sizePolicy) self.delGhostBtn.setIcon(QtGui.QPixmap(self.icons_path + 'deghost.png')) self.delGhostBtn.clicked.connect(self.deleteCurrentGhost) self.delGhostBtn.setToolTip('Deletes current ghost.') self.copyToTwosBtn = QtWidgets.QPushButton(self) self.copyToTwosBtn.setMinimumHeight(30) self.copyToTwosBtn.setSizePolicy(self.sizePolicy) self.copyToTwosBtn.setIcon( QtGui.QPixmap(self.icons_path + 'plus_two.png')) self.copyToTwosBtn.clicked.connect(self.copyToTwos) self.copyToTwosBtn.setToolTip('Copies current pose +2.') self.copyToFoursBtn = QtWidgets.QPushButton(self) self.copyToFoursBtn.setMinimumHeight(30) self.copyToFoursBtn.setSizePolicy(self.sizePolicy) self.copyToFoursBtn.setIcon( QtGui.QPixmap(self.icons_path + 'plus_four.png')) self.copyToFoursBtn.clicked.connect(self.copyToFours) self.copyToFoursBtn.setToolTip('Copies current pose +4.') self.ghostLabel = QtWidgets.QLabel(self) self.ghostLabel.setText('Ghosting') self.ghostLabel.setAlignment(QtCore.Qt.AlignCenter) self.copyLabel = QtWidgets.QLabel(self) self.copyLabel.setText('Copy Pose') self.copyLabel.setAlignment(QtCore.Qt.AlignCenter) self.copyLabelLayout = QtWidgets.QHBoxLayout() self.copyLabelLayout.addWidget(self.ghostLabel) self.copyLabelLayout.addWidget(self.copyLabel) self.copyLabelLayout.setSpacing(20) self.ghostColorLabel = QtWidgets.QLabel(self) self.ghostColorLabel.setStyleSheet( "QLabel {background-color: #E57200;}") self.ghostColorLabel.setMinimumHeight(30) self.ghostColorLabel.setSizePolicy(self.sizePolicy) self.ghostColorLabel.mousePressEvent = self.colorDialogCall self.ghostColorLabel.setToolTip('Sets a color for the current ghost.') self.ghostSlider = QtWidgets.QSlider(QtCore.Qt.Horizontal, self) self.ghostSlider.setTickPosition(QtWidgets.QSlider.TicksBelow) self.ghostSlider.setStyleSheet("QSlider:handle {width: 14px;}") self.ghostSlider.setTickInterval(1) self.ghostSlider.setValue(0) self.ghostSlider.setMinimum(100) self.ghostSlider.setMaximum(200) self.ghostSlider.setSingleStep(1) self.ghostSlider.setSizePolicy(self.sizePolicy) self.ghostSlider.setToolTip('Sets a visibility for the current ghost.') self.setRefBtn = QtWidgets.QPushButton(self) self.setRefBtn.setMinimumHeight(30) self.setRefBtn.setSizePolicy(self.sizePolicy) self.setRefBtn.setIcon(QtGui.QPixmap(self.icons_path + 'ref.png')) self.setRefBtn.clicked.connect(self.addReferencePlane) self.setRefBtn.setToolTip('Creates a reference plane.') self.selectionSet = QtWidgets.QPushButton(self) self.selectionSet.setMinimumHeight(30) self.selectionSet.setSizePolicy(self.sizePolicy) self.selectionSet.setIcon( QtGui.QPixmap(self.icons_path + 'selection.png')) self.selectionSet.clicked.connect(self.createNewSelectionSet) self.selectionSet.setToolTip('Creates selection set.') self.grid_left = QtWidgets.QGridLayout() self.grid_left.addWidget(self.delGhostBtn, 0, 0) self.grid_left.addWidget(self.makeGhostBtn, 0, 1) self.grid_left.addWidget(self.ghostColorLabel, 1, 0) self.grid_left.addWidget(self.ghostSlider, 1, 1) self.grid_left.setSpacing(8) self.grid_right = QtWidgets.QGridLayout() self.grid_right.addWidget(self.copyToTwosBtn, 0, 0) self.grid_right.addWidget(self.copyToFoursBtn, 0, 1) self.grid_right.addWidget(self.setRefBtn, 1, 0) self.grid_right.addWidget(self.selectionSet, 1, 1) self.grid_right.setSpacing(8) self.bottomLayout = QtWidgets.QHBoxLayout() self.bottomLayout.addLayout(self.grid_left) self.bottomLayout.addLayout(self.grid_right) self.bottomLayout.setSpacing(20) self.layout = QtWidgets.QVBoxLayout() self.layout.addLayout(self.nameLabelLayout) self.layout.addLayout(self.buttonLayout) self.layout.addWidget(self.valueSlider) self.layout.addLayout(self.copyLabelLayout) self.layout.addLayout(self.bottomLayout) self.layout.setSpacing(8) self.valueSlider.valueChanged.connect(self.sliderVal) self.valueSlider.sliderMoved.connect(self.repaintValue) self.valueSlider.sliderReleased.connect(self.setBetweenKey) self.ghostSlider.valueChanged.connect(self.ghostWidth) self.setLayout(self.layout) self.layout.setContentsMargins(10, 10, 10, 10)
def setupUi(self, Theme): Theme.setObjectName("Theme") Theme.setWindowModality(QtCore.Qt.NonModal) Theme.resize(450, 300) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(Theme.sizePolicy().hasHeightForWidth()) Theme.setSizePolicy(sizePolicy) Theme.setMinimumSize(QtCore.QSize(100, 0)) Theme.setBaseSize(QtCore.QSize(0, 0)) Theme.setStyleSheet("") self.gridLayout = QtWidgets.QGridLayout(Theme) self.gridLayout.setContentsMargins(-1, -1, -1, 6) self.gridLayout.setSpacing(6) self.gridLayout.setObjectName("gridLayout") self.r2 = QtWidgets.QVBoxLayout() self.r2.setObjectName("r2") self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_2.addItem(spacerItem) self.discardtheme = QtWidgets.QPushButton(Theme) self.discardtheme.setObjectName("discardtheme") self.horizontalLayout_2.addWidget(self.discardtheme) self.savetheme = QtWidgets.QPushButton(Theme) self.savetheme.setObjectName("savetheme") self.horizontalLayout_2.addWidget(self.savetheme) self.r2.addLayout(self.horizontalLayout_2) self.gridLayout.addLayout(self.r2, 2, 0, 1, 1) self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.tabWidget = QtWidgets.QTabWidget(Theme) self.tabWidget.setObjectName("tabWidget") self.tab = QtWidgets.QWidget() self.tab.setObjectName("tab") self.layoutWidget = QtWidgets.QWidget(self.tab) self.layoutWidget.setGeometry(QtCore.QRect(0, 0, 533, 164)) self.layoutWidget.setObjectName("layoutWidget") self.r1 = QtWidgets.QHBoxLayout(self.layoutWidget) self.r1.setContentsMargins(6, 6, 6, 0) self.r1.setObjectName("r1") self.c1 = QtWidgets.QVBoxLayout() self.c1.setObjectName("c1") self.h4_c1 = QtWidgets.QHBoxLayout() self.h4_c1.setObjectName("h4_c1") self.text2_lbl = QtWidgets.QLabel(self.layoutWidget) self.text2_lbl.setObjectName("text2_lbl") self.h4_c1.addWidget(self.text2_lbl) spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.h4_c1.addItem(spacerItem1) self.text2_btn = QtWidgets.QToolButton(self.layoutWidget) self.text2_btn.setText("") self.text2_btn.setObjectName("text2_btn") self.h4_c1.addWidget(self.text2_btn) self.text2 = QtWidgets.QLineEdit(self.layoutWidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.text2.sizePolicy().hasHeightForWidth()) self.text2.setSizePolicy(sizePolicy) self.text2.setMinimumSize(QtCore.QSize(75, 0)) self.text2.setMaximumSize(QtCore.QSize(75, 16777215)) self.text2.setBaseSize(QtCore.QSize(75, 0)) self.text2.setReadOnly(True) self.text2.setObjectName("text2") self.h4_c1.addWidget(self.text2) spacerItem2 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) self.h4_c1.addItem(spacerItem2) self.c1.addLayout(self.h4_c1) self.h1_c2 = QtWidgets.QHBoxLayout() self.h1_c2.setObjectName("h1_c2") self.tooltip_lbl = QtWidgets.QLabel(self.layoutWidget) self.tooltip_lbl.setObjectName("tooltip_lbl") self.h1_c2.addWidget(self.tooltip_lbl) self.tooltip_btn = QtWidgets.QToolButton(self.layoutWidget) self.tooltip_btn.setText("") self.tooltip_btn.setObjectName("tooltip_btn") self.h1_c2.addWidget(self.tooltip_btn) self.tooltip = QtWidgets.QLineEdit(self.layoutWidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.tooltip.sizePolicy().hasHeightForWidth()) self.tooltip.setSizePolicy(sizePolicy) self.tooltip.setMinimumSize(QtCore.QSize(75, 0)) self.tooltip.setMaximumSize(QtCore.QSize(75, 16777215)) self.tooltip.setReadOnly(True) self.tooltip.setObjectName("tooltip") self.h1_c2.addWidget(self.tooltip) spacerItem3 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) self.h1_c2.addItem(spacerItem3) self.c1.addLayout(self.h1_c2) self.h3_c1 = QtWidgets.QHBoxLayout() self.h3_c1.setObjectName("h3_c1") self.text1_lbl = QtWidgets.QLabel(self.layoutWidget) self.text1_lbl.setObjectName("text1_lbl") self.h3_c1.addWidget(self.text1_lbl) spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.h3_c1.addItem(spacerItem4) self.text1_btn = QtWidgets.QToolButton(self.layoutWidget) self.text1_btn.setText("") self.text1_btn.setObjectName("text1_btn") self.h3_c1.addWidget(self.text1_btn) self.text1 = QtWidgets.QLineEdit(self.layoutWidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.text1.sizePolicy().hasHeightForWidth()) self.text1.setSizePolicy(sizePolicy) self.text1.setMinimumSize(QtCore.QSize(75, 0)) self.text1.setMaximumSize(QtCore.QSize(75, 16777215)) self.text1.setBaseSize(QtCore.QSize(75, 0)) self.text1.setReadOnly(True) self.text1.setObjectName("text1") self.h3_c1.addWidget(self.text1) spacerItem5 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) self.h3_c1.addItem(spacerItem5) self.c1.addLayout(self.h3_c1) self.h2_c1 = QtWidgets.QHBoxLayout() self.h2_c1.setObjectName("h2_c1") self.stats1_lbl = QtWidgets.QLabel(self.layoutWidget) self.stats1_lbl.setObjectName("stats1_lbl") self.h2_c1.addWidget(self.stats1_lbl) spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.h2_c1.addItem(spacerItem6) self.stats1_btn = QtWidgets.QToolButton(self.layoutWidget) self.stats1_btn.setText("") self.stats1_btn.setObjectName("stats1_btn") self.h2_c1.addWidget(self.stats1_btn) self.stats1 = QtWidgets.QLineEdit(self.layoutWidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.stats1.sizePolicy().hasHeightForWidth()) self.stats1.setSizePolicy(sizePolicy) self.stats1.setMinimumSize(QtCore.QSize(75, 0)) self.stats1.setMaximumSize(QtCore.QSize(75, 16777215)) self.stats1.setBaseSize(QtCore.QSize(75, 0)) self.stats1.setReadOnly(True) self.stats1.setObjectName("stats1") self.h2_c1.addWidget(self.stats1) spacerItem7 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) self.h2_c1.addItem(spacerItem7) self.c1.addLayout(self.h2_c1) spacerItem8 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.c1.addItem(spacerItem8) self.r1.addLayout(self.c1) self.c2 = QtWidgets.QVBoxLayout() self.c2.setObjectName("c2") self.h1_c1 = QtWidgets.QHBoxLayout() self.h1_c1.setObjectName("h1_c1") self.stats2_lbl = QtWidgets.QLabel(self.layoutWidget) self.stats2_lbl.setObjectName("stats2_lbl") self.h1_c1.addWidget(self.stats2_lbl) spacerItem9 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.h1_c1.addItem(spacerItem9) spacerItem10 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) self.h1_c1.addItem(spacerItem10) self.stats2_btn = QtWidgets.QToolButton(self.layoutWidget) self.stats2_btn.setText("") self.stats2_btn.setObjectName("stats2_btn") self.h1_c1.addWidget(self.stats2_btn) self.stats2 = QtWidgets.QLineEdit(self.layoutWidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.stats2.sizePolicy().hasHeightForWidth()) self.stats2.setSizePolicy(sizePolicy) self.stats2.setMinimumSize(QtCore.QSize(75, 0)) self.stats2.setMaximumSize(QtCore.QSize(75, 16777215)) self.stats2.setBaseSize(QtCore.QSize(75, 0)) self.stats2.setReadOnly(True) self.stats2.setObjectName("stats2") self.h1_c1.addWidget(self.stats2) self.c2.addLayout(self.h1_c1) self.h2_c2 = QtWidgets.QHBoxLayout() self.h2_c2.setObjectName("h2_c2") self.label_7 = QtWidgets.QLabel(self.layoutWidget) self.label_7.setEnabled(True) self.label_7.setObjectName("label_7") self.h2_c2.addWidget(self.label_7) spacerItem11 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.h2_c2.addItem(spacerItem11) self.toolButton_6 = QtWidgets.QToolButton(self.layoutWidget) self.toolButton_6.setText("") self.toolButton_6.setObjectName("toolButton_6") self.h2_c2.addWidget(self.toolButton_6) self.lineEdit_3 = QtWidgets.QLineEdit(self.layoutWidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.lineEdit_3.sizePolicy().hasHeightForWidth()) self.lineEdit_3.setSizePolicy(sizePolicy) self.lineEdit_3.setMinimumSize(QtCore.QSize(75, 0)) self.lineEdit_3.setMaximumSize(QtCore.QSize(75, 16777215)) self.lineEdit_3.setReadOnly(True) self.lineEdit_3.setObjectName("lineEdit_3") self.h2_c2.addWidget(self.lineEdit_3) self.c2.addLayout(self.h2_c2) self.h3_c2 = QtWidgets.QHBoxLayout() self.h3_c2.setObjectName("h3_c2") self.label_6 = QtWidgets.QLabel(self.layoutWidget) self.label_6.setObjectName("label_6") self.h3_c2.addWidget(self.label_6) spacerItem12 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.h3_c2.addItem(spacerItem12) self.toolButton_7 = QtWidgets.QToolButton(self.layoutWidget) self.toolButton_7.setText("") self.toolButton_7.setObjectName("toolButton_7") self.h3_c2.addWidget(self.toolButton_7) self.lineEdit_4 = QtWidgets.QLineEdit(self.layoutWidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.lineEdit_4.sizePolicy().hasHeightForWidth()) self.lineEdit_4.setSizePolicy(sizePolicy) self.lineEdit_4.setMinimumSize(QtCore.QSize(75, 0)) self.lineEdit_4.setMaximumSize(QtCore.QSize(75, 16777215)) self.lineEdit_4.setReadOnly(True) self.lineEdit_4.setObjectName("lineEdit_4") self.h3_c2.addWidget(self.lineEdit_4) self.c2.addLayout(self.h3_c2) self.h4_c2 = QtWidgets.QHBoxLayout() self.h4_c2.setObjectName("h4_c2") self.label_5 = QtWidgets.QLabel(self.layoutWidget) self.label_5.setObjectName("label_5") self.h4_c2.addWidget(self.label_5) spacerItem13 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.h4_c2.addItem(spacerItem13) self.toolButton_8 = QtWidgets.QToolButton(self.layoutWidget) self.toolButton_8.setText("") self.toolButton_8.setObjectName("toolButton_8") self.h4_c2.addWidget(self.toolButton_8) self.lineEdit = QtWidgets.QLineEdit(self.layoutWidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.lineEdit.sizePolicy().hasHeightForWidth()) self.lineEdit.setSizePolicy(sizePolicy) self.lineEdit.setMinimumSize(QtCore.QSize(75, 0)) self.lineEdit.setMaximumSize(QtCore.QSize(75, 16777215)) self.lineEdit.setReadOnly(True) self.lineEdit.setObjectName("lineEdit") self.h4_c2.addWidget(self.lineEdit) self.c2.addLayout(self.h4_c2) spacerItem14 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.c2.addItem(spacerItem14) self.r1.addLayout(self.c2) self.tabWidget.addTab(self.tab, "") self.tab_2 = QtWidgets.QWidget() self.tab_2.setObjectName("tab_2") self.tabWidget.addTab(self.tab_2, "") self.verticalLayout.addWidget(self.tabWidget) self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1) self.retranslateUi(Theme) self.setVisibility() QtCore.QMetaObject.connectSlotsByName(Theme)
def __init__(self, parent=None): # INITIALIZE GUI AND SET WINDOW TO ALWAYS ON TOP QtWidgets.QWidget.__init__(self, parent, QtCore.Qt.WindowStaysOnTopHint) # SET LAYOUTS vbox = QtWidgets.QVBoxLayout() hbox1 = QtWidgets.QHBoxLayout() hbox2 = QtWidgets.QHBoxLayout() hbox3 = QtWidgets.QHBoxLayout() hbox4 = QtWidgets.QHBoxLayout() hbox_checkboxes1 = QtWidgets.QHBoxLayout() hbox_checkboxes2 = QtWidgets.QHBoxLayout() hbox_checkboxes3 = QtWidgets.QHBoxLayout() hbox_checkboxes4 = QtWidgets.QHBoxLayout() hbox_apply_to = QtWidgets.QHBoxLayout() hbox_buttons1 = QtWidgets.QHBoxLayout() hbox_buttons2 = QtWidgets.QHBoxLayout() # SET WINDOW ATTRIBUTES self.setGeometry(500, 300, 400, 110) self.setWindowTitle('Find & Replace') # CREATE WIDGETS self.search_for_label = QtWidgets.QLabel("Search For: ") self.search_for_line_edit = QtWidgets.QLineEdit() self.replace_with_label = QtWidgets.QLabel("Replace With:") self.replace_with_line_edit = QtWidgets.QLineEdit() self.search_in_node_names_checkbox = QtWidgets.QCheckBox("Search In Node Names") self.search_in_parameters_checkbox = QtWidgets.QCheckBox("Search In Parameters") self.include_string_parms_checkbox = QtWidgets.QCheckBox("Include String Parms") self.include_float_parms_checkbox = QtWidgets.QCheckBox("Include Float Parms") self.include_expressions_checkbox = QtWidgets.QCheckBox("Include Expressions") self.select_in_viewport_checkbox = QtWidgets.QCheckBox("Select In Viewport") self.print_results_checkbox = QtWidgets.QCheckBox("Print Results") self.case_sensitive_checkbox = QtWidgets.QCheckBox("Case Sensitive") self.apply_to_label = QtWidgets.QLabel("Apply To:") self.apply_to_combo_box = QtWidgets.QComboBox(self) self.find_button = QtWidgets.QPushButton('Find', self) self.replace_button = QtWidgets.QPushButton('Replace', self) # POPULATE COMBO BOX self.apply_to_combo_box.addItem("Selected Nodes Only") self.apply_to_combo_box.addItem("Selected Nodes & Their Direct Children") self.apply_to_combo_box.addItem("Selected Nodes & All Subchildren") self.apply_to_combo_box.addItem("Only Direct Children Of Selected Nodes") self.apply_to_combo_box.addItem("Only All Subchildren Of Selected Nodes") self.apply_to_combo_box.addItem("All Nodes In Obj Context") self.apply_to_combo_box.addItem("All Nodes In Scene (Any Context)") # SET INITIAL WIDGET BEHAVIORS self.search_in_node_names_checkbox.setCheckState(QtCore.Qt.Checked) self.search_in_parameters_checkbox.setCheckState(QtCore.Qt.Unchecked) self.case_sensitive_checkbox.setCheckState(QtCore.Qt.Unchecked) self.select_in_viewport_checkbox.setCheckState(QtCore.Qt.Checked) self.print_results_checkbox.setCheckState(QtCore.Qt.Unchecked) self.include_string_parms_checkbox.setCheckState(QtCore.Qt.Checked) self.include_float_parms_checkbox.setCheckState(QtCore.Qt.Checked) self.include_expressions_checkbox.setCheckState(QtCore.Qt.Checked) self.include_string_parms_checkbox.setEnabled(False) self.include_float_parms_checkbox.setEnabled(False) self.include_expressions_checkbox.setEnabled(False) # WATCH WIDGETS FOR STATECHANGE self.search_for_line_edit.textChanged.connect(self.lineEditChanged) self.replace_with_line_edit.textChanged.connect(self.lineEditChanged) self.search_in_parameters_checkbox.stateChanged.connect(self.searchInParametersCheckboxChanged) self.search_in_node_names_checkbox.stateChanged.connect(self.searchInNodeNamesCheckboxChanged) self.include_string_parms_checkbox.stateChanged.connect(self.includeCheckboxChanged) self.include_float_parms_checkbox.stateChanged.connect(self.includeCheckboxChanged) self.include_expressions_checkbox.stateChanged.connect(self.includeCheckboxChanged) self.print_results_checkbox.stateChanged.connect(self.printResultsUnchecked) self.select_in_viewport_checkbox.stateChanged.connect(self.selectInViewportUnchecked) self.apply_to_combo_box.currentIndexChanged.connect(self.comboBoxIndexChanged) # CONNECT BUTTONS TO FUNCTIONS self.find_button.clicked.connect(self.locate) self.replace_button.clicked.connect(self.locateAndReplace) # ADD WIDGETS TO LAYOUT hbox1.addWidget(self.search_for_label) hbox1.addWidget(self.search_for_line_edit) hbox2.addWidget(self.replace_with_label) hbox2.addWidget(self.replace_with_line_edit) vbox.addLayout(hbox1) vbox.addLayout(hbox2) vbox.addLayout(hbox3) vbox.addLayout(hbox4) hbox_checkboxes1.addWidget(self.search_in_node_names_checkbox) hbox_checkboxes1.addWidget(self.search_in_parameters_checkbox) hbox_checkboxes2.addWidget(self.case_sensitive_checkbox) hbox_checkboxes2.addWidget(self.include_string_parms_checkbox) hbox_checkboxes3.addWidget(self.select_in_viewport_checkbox) hbox_checkboxes3.addWidget(self.include_float_parms_checkbox) hbox_checkboxes4.addWidget(self.print_results_checkbox) hbox_checkboxes4.addWidget(self.include_expressions_checkbox) vbox.addLayout(hbox_checkboxes1) vbox.addLayout(hbox_checkboxes2) vbox.addLayout(hbox_checkboxes3) vbox.addLayout(hbox_checkboxes4) hbox_apply_to.addWidget(self.apply_to_label) hbox_apply_to.addWidget(self.apply_to_combo_box) vbox.addLayout(hbox_apply_to) hbox_buttons1.addWidget(self.find_button) hbox_buttons1.addWidget(self.replace_button) vbox.addLayout(hbox_buttons1) # SET LAYOUT self.setLayout(vbox)
def setupUi(self, SearcherSettings, width, height, animated): self.width = width self.height = height self.animated = animated SearcherSettings.setObjectName("SearcherSettings") SearcherSettings.setWindowModality(QtCore.Qt.NonModal) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( SearcherSettings.sizePolicy().hasHeightForWidth()) SearcherSettings.setSizePolicy(sizePolicy) SearcherSettings.setMinimumSize(QtCore.QSize(width, height)) SearcherSettings.setBaseSize(QtCore.QSize(0, 0)) self.gridLayout = QtWidgets.QGridLayout(SearcherSettings) self.gridLayout.setContentsMargins(-1, -1, -1, -1) self.gridLayout.setObjectName("gridLayout") self.verticallayout = QtWidgets.QVBoxLayout() self.verticallayout.setObjectName("verticalLayout") self.verticallayout.setSpacing(10) # ------------------------------------------------- headerrow # NOTE headerrow -------------------------------------------- self.headerrow = QtWidgets.QHBoxLayout() self.headerrow.setObjectName("headerrow") self.projectTitle = QtWidgets.QLabel(SearcherSettings) font = QtGui.QFont() font.setPointSize(15) self.projectTitle.setFont(font) self.projectTitle.setAlignment(QtCore.Qt.AlignCenter) self.projectTitle.setObjectName("projectTitle") self.headerrow.addWidget(self.projectTitle) spaceritem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.headerrow.addItem(spaceritem) self.animatedsettings_chk = QtWidgets.QCheckBox(SearcherSettings) self.animatedsettings_chk.setLayoutDirection(QtCore.Qt.RightToLeft) self.animatedsettings_chk.setObjectName("animatedsettings_chk") self.headerrow.addWidget(self.animatedsettings_chk) self.windowsize_chk = QtWidgets.QCheckBox(SearcherSettings) self.windowsize_chk.setLayoutDirection(QtCore.Qt.RightToLeft) self.windowsize_chk.setObjectName("windowsize_chk") self.headerrow.addWidget(self.windowsize_chk) self.verticallayout.addLayout(self.headerrow) self.line = QtWidgets.QFrame(SearcherSettings) self.line.setFrameShape(QtWidgets.QFrame.HLine) self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.line.setObjectName("line") self.verticallayout.addWidget(self.line) # ------------------------------------------------- secondrow # NOTE Second Row ------------------------------------------- self.secondrow = QtWidgets.QHBoxLayout() self.secondrow.setObjectName("secondrow") # self.lang_cbox = QtWidgets.QComboBox(SearcherSettings) # self.lang_cbox.setObjectName("lang_cbox") # self.lang_cbox.addItem("") # self.secondrow.addWidget(self.lang_cbox) spaceritem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.secondrow.addItem(spaceritem) self.maxresults_lbl = QtWidgets.QLabel(SearcherSettings) self.maxresults_lbl.setObjectName("maxresults_lbl") self.secondrow.addWidget(self.maxresults_lbl) self.maxresults_txt = QtWidgets.QSpinBox(SearcherSettings) self.maxresults_txt.setMinimum(1) self.maxresults_txt.setMaximum(9999) self.maxresults_txt.setObjectName("maxresults_txt") self.secondrow.addWidget(self.maxresults_txt) self.inmemory_chk = QtWidgets.QCheckBox(SearcherSettings) self.inmemory_chk.setLayoutDirection(QtCore.Qt.RightToLeft) self.inmemory_chk.setTristate(False) self.inmemory_chk.setObjectName("inmemory_chk") self.secondrow.addWidget(self.inmemory_chk) self.verticallayout.addLayout(self.secondrow) # -------------------------------------------------- thirdrow # NOTE Third Row -------------------------------------------- self.thirdrow = QtWidgets.QHBoxLayout() self.thirdrow.setObjectName("thirdrow") self.defaulthotkey_lbl = QtWidgets.QLabel(SearcherSettings) self.defaulthotkey_lbl.setObjectName("defaulthotkey_lbl") self.thirdrow.addWidget(self.defaulthotkey_lbl) self.defaulthotkey_txt = QtWidgets.QLineEdit(SearcherSettings) self.defaulthotkey_txt.setToolTip("") self.defaulthotkey_txt.setReadOnly(True) self.defaulthotkey_txt.setObjectName("defaulthotkey_txt") self.thirdrow.addWidget(self.defaulthotkey_txt) self.hotkey_icon = QtWidgets.QToolButton(SearcherSettings) self.hotkey_icon.setPopupMode(QtWidgets.QToolButton.InstantPopup) self.hotkey_icon.setObjectName("hotkey_icon") self.thirdrow.addWidget(self.hotkey_icon) self.verticallayout.addLayout(self.thirdrow) # ------------------------------------------------- fourthrow # NOTE Fourth Row ------------------------------------------- self.fourthrow = QtWidgets.QHBoxLayout() self.fourthrow.setObjectName("fourthrow") self.dbpath_lbl = QtWidgets.QLabel(SearcherSettings) self.dbpath_lbl.setObjectName("dbpath_lbl") self.fourthrow.addWidget(self.dbpath_lbl) self.databasepath_txt = QtWidgets.QLineEdit(SearcherSettings) self.databasepath_txt.setObjectName("databasepath_txt") self.fourthrow.addWidget(self.databasepath_txt) self.dbpath_icon = QtWidgets.QToolButton(SearcherSettings) self.dbpath_icon.setObjectName("dbpath_icon") self.fourthrow.addWidget(self.dbpath_icon) self.verticallayout.addLayout(self.fourthrow) # -------------------------------------------------- fifthrow # NOTE Fifth Row -------------------------------------------- self.fifthrow = QtWidgets.QHBoxLayout() self.fifthrow.setObjectName("fifthrow") # self.maint_lbl = QtWidgets.QLabel(SearcherSettings) # self.maint_lbl.setObjectName("maint_lbl") # self.fifthrow.addWidget(self.maint_lbl) # self.metrics_chk = QtWidgets.QCheckBox(SearcherSettings) # self.metrics_chk.setLayoutDirection(QtCore.Qt.RightToLeft) # self.metrics_chk.setTristate(False) # self.metrics_chk.setObjectName("metrics_chk") # self.fifthrow.addWidget(self.metrics_chk) # self.cleardata_btn = QtWidgets.QPushButton(SearcherSettings) # self.cleardata_btn.setObjectName("cleardata_btn") # self.fifthrow.addWidget(self.cleardata_btn) # self.verticallayout.addLayout(self.fifthrow) # ---------------------------------------------------- Spacer self.line2 = QtWidgets.QFrame(SearcherSettings) self.line2.setFrameShape(QtWidgets.QFrame.HLine) self.line2.setFrameShadow(QtWidgets.QFrame.Sunken) self.line2.setObjectName("line2") self.verticallayout.addWidget(self.line2) # ---------------------------------------------------- Spacer # -------------------------------------------------- sixthrow # NOTE Sixth Row -------------------------------------------- self.sixthrow = QtWidgets.QHBoxLayout() self.sixthrow.setObjectName("sixthrow") self.about_btn = QtWidgets.QToolButton(SearcherSettings) self.about_btn.setObjectName("about") self.sixthrow.addWidget(self.about_btn) self.bug_btn = QtWidgets.QToolButton(SearcherSettings) self.bug_btn.setObjectName("bugreport") self.sixthrow.addWidget(self.bug_btn) self.theme_btn = QtWidgets.QToolButton(SearcherSettings) self.theme_btn.setObjectName("theme") self.sixthrow.addWidget(self.theme_btn) spacerItem1 = QtWidgets.QSpacerItem(40, 25, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) self.sixthrow.addItem(spacerItem1) self.metrics_chk = QtWidgets.QCheckBox(SearcherSettings) self.metrics_chk.setLayoutDirection(QtCore.Qt.RightToLeft) self.metrics_chk.setTristate(False) self.metrics_chk.setObjectName("metrics_chk") self.sixthrow.addWidget(self.metrics_chk) self.debuglevel_cbx = QtWidgets.QComboBox(SearcherSettings) self.debuglevel_cbx.setObjectName("debuglevel_cbx") self.sixthrow.addWidget(self.debuglevel_cbx) self.debugflag_chk = QtWidgets.QCheckBox(SearcherSettings) self.debugflag_chk.setLayoutDirection(QtCore.Qt.RightToLeft) self.debugflag_chk.setObjectName("debugflag_chk") self.sixthrow.addWidget(self.debugflag_chk) self.discard_btn = QtWidgets.QPushButton(SearcherSettings) self.discard_btn.setObjectName("discard_btn") self.sixthrow.addWidget(self.discard_btn) self.save_btn = QtWidgets.QPushButton(SearcherSettings) self.save_btn.setObjectName("save_btn") self.sixthrow.addWidget(self.save_btn) self.verticallayout.addLayout(self.sixthrow) if not self.animated: self.gridLayout.addLayout(self.verticallayout, 1, 0, 1, 1) # ----------------------------------------------------------- self.retranslateUi(SearcherSettings) QtCore.QMetaObject.connectSlotsByName(SearcherSettings)
def setupUi(self, Searcher, animated): self.animated = animated Searcher.setObjectName("Searcher") Searcher.setWindowModality(QtCore.Qt.NonModal) Searcher.setStyleSheet( u"background-color: rgb(42,42,42); border: 0px solid black") self.mainlayout = QtWidgets.QVBoxLayout() self.gridLayout = QtWidgets.QGridLayout() self.gridLayout.setSpacing(0) self.gridLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setSpacing(0) self.titlerow = QtWidgets.QHBoxLayout() self.titlerow.setSpacing(5) self.titlespacer1 = QtWidgets.QSpacerItem( 8, 0, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) # ------------------------------------------ Header # NOTE Header ------------------------------------- self.searcherlbl = QtWidgets.QLabel("Searcher") font = QtGui.QFont() font.setPointSize(15) self.searcherlbl.setFont(font) self.searcherlbl.setAlignment(QtCore.Qt.AlignCenter) self.titlespacer2 = QtWidgets.QSpacerItem( 40, 30, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.expander = QtWidgets.QToolButton() self.expander.setObjectName("expander") self.metricpos = QtWidgets.QToolButton() self.metricpos.setObjectName("metricpos") self.contexttoggle = QtWidgets.QPushButton() self.contexttoggle.setObjectName("contexttoggle") self.helpButton = HelpButton.HelpButton("main", la.TT_MW['helpButton'], 16, Searcher) self.helpButton.setObjectName("helpButton") self.pinwindow_btn = QtWidgets.QToolButton() self.pinwindow_btn.setObjectName("pinwindow") self.opensettings_btn = QtWidgets.QToolButton() self.opensettings_btn.setObjectName("opensettingstool") self.titlespacer3 = QtWidgets.QSpacerItem( 8, 0, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) # ----------------------------------- Search Filter # NOTE Search Filter ------------------------------ self.searchrow = QtWidgets.QHBoxLayout() self.searchrow.setSpacing(0) self.frame = QtWidgets.QFrame() searchframe_details = QtWidgets.QSizePolicy( QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred) searchframe_details.setHorizontalStretch(0) searchframe_details.setVerticalStretch(0) searchframe_details.setHeightForWidth( self.frame.sizePolicy().hasHeightForWidth()) self.frame.setSizePolicy(searchframe_details) self.frame.setMinimumSize(QtCore.QSize(20, 20)) self.frame.setMaximumSize(QtCore.QSize(500, 200)) self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame.setFrameShadow(QtWidgets.QFrame.Plain) self.frame.setStyleSheet( u"background-color: rgb(19, 19, 19); color: rgb(19, 19, 19);") self.searchfilter_btn = QtWidgets.QToolButton(self.frame) self.searchfilter_btn.setObjectName("searchfilter") self.searchfilter_btn.setGeometry(QtCore.QRect(0, 0, 36, 36)) self.searchfilter_btn.setBaseSize(QtCore.QSize(30, 30)) self.searchfilter_btn.setStyleSheet( u"background-color: rgb(19, 19, 19);") self.searchfilter_btn.setArrowType(QtCore.Qt.NoArrow) self.searchfilter_btn.setParent(self.frame) # -------------------------------------- Search Box # NOTE Search Box --------------------------------- self.searchbox_txt = QtWidgets.QLineEdit() self.searchbox_txt.setObjectName("searchbox") searchbox_details = QtWidgets.QSizePolicy( QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) searchbox_details.setHorizontalStretch(99) searchbox_details.setVerticalStretch(0) # searchbox_details.setHeightForWidth( # self.searchbox_txt.sizePolicy().hasHeightForWidth()) self.searchbox_txt.setSizePolicy(searchbox_details) self.searchbox_txt.setMinimumSize(QtCore.QSize(50, 0)) self.searchbox_txt.setMouseTracking(False) self.searchbox_txt.setStyleSheet(u"background-color: rgb(19, 19, 19);") self.searchbox_txt.setFrame(False) # ------------------------------------ Results Tree # NOTE Results Tree ------------------------------- self.searchresults_tree = QtWidgets.QTreeWidget() self.searchresults_tree.setObjectName("searchresultstree") # Header --------- __qtreewidgetitem = QtWidgets.QTreeWidgetItem() __qtreewidgetitem.setText(0, u"1") resultstree_header = QtGui.QFont() resultstree_header.setPointSize(9) __qtreewidgetitem.setFont(0, resultstree_header) self.searchresults_tree.setHeaderItem(__qtreewidgetitem) resultstree_details = QtWidgets.QSizePolicy( QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding) resultstree_details.setHorizontalStretch(0) resultstree_details.setVerticalStretch(0) self.searchresults_tree.setSizePolicy(resultstree_details) resultstree_font = QtGui.QFont() resultstree_font.setPointSize(9) self.searchresults_tree.setFont(resultstree_font) self.searchresults_tree.setMouseTracking(False) self.searchresults_tree.setFocusPolicy(QtCore.Qt.NoFocus) self.searchresults_tree.setFrameShadow(QtWidgets.QFrame.Sunken) self.searchresults_tree.setLineWidth(0) self.searchresults_tree.setSizeAdjustPolicy( QtWidgets.QAbstractScrollArea.AdjustToContents) self.searchresults_tree.setAlternatingRowColors(True) self.searchresults_tree.setSelectionMode( QtWidgets.QAbstractItemView.SingleSelection) self.searchresults_tree.setSelectionBehavior( QtWidgets.QAbstractItemView.SelectRows) # -------------------------------------- Info Panel # NOTE Info Panel --------------------------------- self.infobar = QtWidgets.QHBoxLayout() self.infobar.setObjectName("infobar") self.infobargrid = QtWidgets.QGridLayout() self.infobargrid.setObjectName("infobargrid") # -------------------------------------- Info Panel # NOTE Info Panel --------------------------------- self.info_lbl = QtWidgets.QLabel() self.infolbl_font = QtGui.QFont() self.infolbl_font.setPointSize(9) self.infolbl_font.setBold(False) self.infolbl_font.setWeight(40) self.info_lbl.setFont(self.infolbl_font) self.info_lbl.setStyleSheet( u"background-color: rgba(11, 11, 11, 0); border-bottom: 1px solid rgb(100, 100, 100);" ) self.info_lbl.setMargin(3) self.info_lbl.setIndent(5) # -------------------------------------- Info Panel # NOTE Info Panel --------------------------------- self.overlay = overlayLabel(self.info_lbl) self.overlay.setFont(self.infolbl_font) self.overlay.setStyleSheet( u"background-color: rgb(11, 11, 11); border-bottom: 1px solid rgb(100, 100, 100); " ) self.overlay.setMargin(3) self.overlay.setIndent(5) # -------------------------------------- Info Panel # NOTE Info Panel --------------------------------- self.treetotal_lbl = QtWidgets.QLabel() self.treetotal_lbl.setObjectName("treetotal_lbl") # Size ---------- treetotal_size = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred) treetotal_size.setHorizontalStretch(0) treetotal_size.setVerticalStretch(0) treetotal_size.setHeightForWidth( self.treetotal_lbl.sizePolicy().hasHeightForWidth()) self.treetotal_lbl.setSizePolicy(treetotal_size) self.treetotal_lbl.setMinimumSize(QtCore.QSize(160, 0)) self.treetotal_lbl.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) # Style --------- self.treetotallbl_font = QtGui.QFont() self.treetotallbl_font.setPointSize(9) self.treetotallbl_font.setBold(False) self.treetotallbl_font.setWeight(50) self.treetotal_lbl.setFont(self.treetotallbl_font) self.treetotal_lbl.setStyleSheet( u"background-color: rgb(11, 11, 11); border-bottom: 1px solid rgb(100, 100, 100); " ) self.treetotal_lbl.setMargin(3) self.treetotal_lbl.setIndent(5) # ------------------------------------------ Layout # NOTE Layout ------------------------------------- self.titlerow.addItem(self.titlespacer1) self.titlerow.addWidget(self.searcherlbl) self.titlerow.addItem(self.titlespacer2) self.titlerow.addWidget(self.expander) self.titlerow.addWidget(self.metricpos) self.titlerow.addWidget(self.contexttoggle) self.titlerow.addWidget(self.helpButton) self.titlerow.addWidget(self.pinwindow_btn) self.titlerow.addWidget(self.opensettings_btn) self.titlerow.addItem(self.titlespacer3) self.verticalLayout.addLayout(self.titlerow) # self.searchrow.addWidget(self.frame) self.searchgrid = QtWidgets.QGridLayout() self.searchgrid.addWidget(self.frame, 1, 0, 1, 1) self.searchgrid.addWidget(self.searchfilter_btn, 1, 0, 1, 1) self.searchgrid.addWidget(self.searchbox_txt, 1, 1, 1, 1) self.searchrow.addLayout(self.searchgrid) self.verticalLayout.addLayout(self.searchrow) self.verticalLayout.addWidget(self.searchresults_tree) self.gridLayout.addLayout(self.verticalLayout, 1, 0, 1, 1) self.infobargrid.addWidget(self.overlay, 1, 0, 1, 1) self.infobargrid.addWidget(self.info_lbl, 1, 0, 1, 1) self.infobargrid.addWidget(self.treetotal_lbl, 1, 1, 1, 1) self.infobar.addLayout(self.infobargrid) self.gridLayout.addLayout(self.infobar, 3, 0, 1, 1) self.mainlayout.setContentsMargins(0, 0, 0, 0) # --------------------------------------- ResizeHandles # NOTE ResizeHandles ---------------------------------- self.leftresize = QtWidgets.QSizeGrip(self.info_lbl) self.leftresize.setObjectName("resizeleft") self.leftresize.setMaximumSize(QtCore.QSize(25, 25)) self.leftresize.setStyleSheet( u"color: rgba(0, 0, 0, 0); background-color: rgba(0, 0, 0, 0);") pos = self.info_lbl.mapToGlobal(QtCore.QPoint(-3, 0)) self.leftresize.setGeometry(pos.x(), pos.y(), self.leftresize.width(), self.leftresize.height()) self.rightresize = QtWidgets.QSizeGrip(self.treetotal_lbl) self.rightresize.setMaximumSize(QtCore.QSize(25, 25)) self.rightresize.setObjectName("resizeright") self.rightresize.setStyleSheet( u"color: rgba(0, 0, 0, 0); background-color: rgba(0, 0, 0, 0);") pos = self.treetotal_lbl.mapToGlobal(QtCore.QPoint(138, 0)) self.rightresize.setGeometry(pos.x(), pos.y(), self.rightresize.width(), self.rightresize.height()) self.vlayout = self.gridLayout
def __init__(self, cpu_config=None, gpu_config=None, parent=None): super(_DeviceWidget, self).__init__(parent=parent) self.cpu_config = cpu_config self.gpu_config = gpu_config if gpu_config: self.device_name_label = QtWidgets.QLabel(self) self.device_name_label.setText('GPU "{}"'.format(gpu_config.gpu_info.name)) self.main_layout = QtWidgets.QHBoxLayout(self) self.main_layout.addWidget(self.device_name_label) self.main_layout.addStretch() self.is_enabled_check_box = QtWidgets.QCheckBox(self) self.is_enabled_check_box.setChecked(gpu_config.is_enabled) self.is_enabled_check_box.stateChanged.connect(self.on_gpu_update) self.main_layout.addWidget(self.is_enabled_check_box) elif cpu_config: self.name_container_widget = QtWidgets.QWidget(self) self.name_container_layout = QtWidgets.QHBoxLayout(self.name_container_widget) self.name_container_layout.setContentsMargins(0, 0, 0, 0) self.name_label = QtWidgets.QLabel(self.name_container_widget) self.name_label.setText('CPU') self.name_container_layout.addWidget(self.name_label) self.name_container_layout.addStretch() is_cpu_enabled = cpu_config.num_active_threads > 0 self.is_enabled_check_box = QtWidgets.QCheckBox(self.name_container_widget) self.is_enabled_check_box.setChecked(is_cpu_enabled) self.is_enabled_check_box.stateChanged.connect(self.on_cpu_enabled_update) self.name_container_layout.addWidget(self.is_enabled_check_box) self.num_threads_container_widget = QtWidgets.QWidget(self) self.num_threads_container_layout = QtWidgets.QHBoxLayout(self.num_threads_container_widget) self.num_threads_container_layout.setContentsMargins(0, 0, 0, 0) self.num_threads_label = QtWidgets.QLabel(self.num_threads_container_widget) self.num_threads_label.setText('Number of Threads') self.num_threads_container_layout.addWidget(self.num_threads_label) self.num_threads_container_layout.addStretch() self.num_threads_spin_box = QtWidgets.QSpinBox(self.num_threads_container_widget) self.num_threads_spin_box.setValue(cpu_config.num_active_threads) self.num_threads_spin_box.setRange(1, cpu_config.cpu_info.numThreads) self.num_threads_spin_box.valueChanged.connect(self.on_cpu_num_threads_update) if not is_cpu_enabled: self.num_threads_container_widget.hide() self.num_threads_container_layout.addWidget(self.num_threads_spin_box) self.main_layout = QtWidgets.QVBoxLayout(self) self.main_layout.addWidget(self.name_container_widget) self.main_layout.addWidget(self.num_threads_container_widget) self.main_layout.setContentsMargins( self.main_layout.contentsMargins().left() // 2, self.main_layout.contentsMargins().top() // 4, self.main_layout.contentsMargins().right() // 2, self.main_layout.contentsMargins().bottom() // 4)
def buildUI(): self.setAttribute(QtCore.Qt.WA_DeleteOnClose) self.setAttribute(QtCore.Qt.WA_AlwaysShowToolTips) # Main Layout mainLayout = QtWidgets.QVBoxLayout() # General Group generalGroupBox = QtWidgets.QGroupBox("General") generalLayout = QtWidgets.QVBoxLayout(generalGroupBox) # Host Layout hostLayout = QtWidgets.QHBoxLayout() self.hostLineEdit = LineEditBox("Host", u"%s" % self.defaultHost) self.hostCheckBox = QtWidgets.QCheckBox() self.hostCheckBox.setChecked(True) self.hostCheckBox.stateChanged.connect( self.hostLineEdit.setEnabled) hostLayout.addWidget(self.hostLineEdit) hostLayout.addWidget(self.hostCheckBox) # Port Layout portLayout = QtWidgets.QHBoxLayout() self.portSlider = SliderBox("Port") self.portSlider.setMinimum(0, 0) self.portSlider.setMaximum(9999, 15) self.portSlider.setValue(self.defaultPort) self.portSlider.connect(portUpdateUI) self.portCheckBox = QtWidgets.QCheckBox() self.portCheckBox.setChecked(True) self.portCheckBox.stateChanged.connect(self.portSlider.setEnabled) portLayout.addWidget(self.portSlider) portLayout.addWidget(self.portCheckBox) # Output Driver Layout outputDriverLayout = QtWidgets.QHBoxLayout() self.outputComboBox = ComboBox("Output") self.outputComboBox.addItems([i.path for i in self.outputsList]) self.outputComboBox.currentIndexChanged.connect(outputUpdateUI) outputDriverLayout.addWidget(self.outputComboBox) # Camera Layout cameraLayout = QtWidgets.QHBoxLayout() self.cameraComboBox = ComboBox("Camera") self.cameraComboBox.addItems(getAllCameras(path=True)) self.cameraComboBox.setCurrentName(self.output.cameraPath) cameraLayout.addWidget(self.cameraComboBox) # Overrides Group overridesGroupBox = QtWidgets.QGroupBox("Overrides") overridesLayout = QtWidgets.QVBoxLayout(overridesGroupBox) # IPR Update Layout IPRUpdateLayout = QtWidgets.QHBoxLayout() self.IPRUpdateCheckBox = CheckBox('IPR', " Auto Update") self.IPRUpdateCheckBox.setChecked(self.ipr.isAutoUpdateOn()) self.IPRUpdateCheckBox.stateChanged.connect( lambda: self.ipr.setAutoUpdate(self.IPRUpdateCheckBox. isChecked())) IPRUpdateLayout.addWidget(self.IPRUpdateCheckBox) # Bucket Layout bucketLayout = QtWidgets.QHBoxLayout() self.bucketComboBox = ComboBox("Bucket Scan") self.bucketComboBox.addItems(getBucketModes()) self.bucketComboBox.setCurrentName(self.output.bucketScanning) bucketLayout.addWidget(self.bucketComboBox) # Resolution Layout resolutionLayout = QtWidgets.QHBoxLayout() self.resolutionSlider = SliderBox("Resolution %") self.resolutionSlider.setMinimum(1, 1) self.resolutionSlider.setMaximum(200, 40) self.resolutionSlider.setValue(100, 20) self.resolutionSlider.connect(resUpdateUI) xres, yres = self.output.resolution[0], self.output.resolution[1] self.resolutionInfoLabel = QtWidgets.QLabel( str(xres) + 'x' + str(yres)) self.resolutionInfoLabel.setMaximumSize(100, 20) self.resolutionInfoLabel.setEnabled(False) resolutionLayout.addWidget(self.resolutionSlider) resolutionLayout.addWidget(self.resolutionInfoLabel) # Camera AA Layout cameraAaLayout = QtWidgets.QHBoxLayout() self.cameraAaSlider = SliderBox("Camera (AA)") self.cameraAaSlider.setMinimum(-64, -3) self.cameraAaSlider.setMaximum(64, 16) self.cameraAaSlider.setValue(self.output.AASamples, self.output.AASamples) cameraAaLayout.addWidget(self.cameraAaSlider) # Render region layout renderRegionLayout = QtWidgets.QHBoxLayout() self.renderRegionXSpinBox = SpinBox("Region X") self.renderRegionYSpinBox = SpinBox("Y", 0, False) self.renderRegionRSpinBox = SpinBox("R", 0, False) self.renderRegionTSpinBox = SpinBox("T", 0, False) self.renderRegionRSpinBox.setValue(self.output.resolution[0]) self.renderRegionTSpinBox.setValue(self.output.resolution[1]) renderRegionGetNukeButton = QtWidgets.QPushButton("Get") renderRegionGetNukeButton.clicked.connect(self.getNukeCropNode) renderRegionLayout.addWidget(self.renderRegionXSpinBox) renderRegionLayout.addWidget(self.renderRegionYSpinBox) renderRegionLayout.addWidget(self.renderRegionRSpinBox) renderRegionLayout.addWidget(self.renderRegionTSpinBox) renderRegionLayout.addWidget(renderRegionGetNukeButton) # Overscan Layout overscanLayout = QtWidgets.QHBoxLayout() self.overscanSlider = SliderBox("Overscan") self.overscanSlider.setMinimum(0) self.overscanSlider.setMaximum(9999, 250) self.overscanSlider.setValue(0, 0) overscanLayout.addWidget(self.overscanSlider) # Ignore Group ignoresGroupBox = QtWidgets.QGroupBox("Ignore") ignoresGroupBox.setMaximumSize(9999, 75) # Ignore Layout ignoresLayout = QtWidgets.QVBoxLayout(ignoresGroupBox) ignoreLayout = QtWidgets.QHBoxLayout() self.motionBlurCheckBox = QtWidgets.QCheckBox(' Motion Blur') self.subdivsCheckBox = QtWidgets.QCheckBox(" Subdivs") self.displaceCheckBox = QtWidgets.QCheckBox(' Displace') self.bumpCheckBox = QtWidgets.QCheckBox(' Bump') self.sssCheckBox = QtWidgets.QCheckBox(' SSS') ignoreLayout.addWidget(self.motionBlurCheckBox) ignoreLayout.addWidget(self.subdivsCheckBox) ignoreLayout.addWidget(self.displaceCheckBox) ignoreLayout.addWidget(self.bumpCheckBox) ignoreLayout.addWidget(self.sssCheckBox) # Main Buttons Layout mainButtonslayout = QtWidgets.QHBoxLayout() startButton = QtWidgets.QPushButton("Start / Refresh") stopButton = QtWidgets.QPushButton("Stop") resetButton = QtWidgets.QPushButton("Reset") startButton.clicked.connect(self.startRender) stopButton.clicked.connect(self.stopRender) resetButton.clicked.connect(resetUI) mainButtonslayout.addWidget(startButton) mainButtonslayout.addWidget(stopButton) mainButtonslayout.addWidget(resetButton) # Add Layouts to Main generalLayout.addLayout(hostLayout) generalLayout.addLayout(portLayout) generalLayout.addLayout(outputDriverLayout) overridesLayout.addLayout(IPRUpdateLayout) overridesLayout.addLayout(cameraLayout) overridesLayout.addLayout(bucketLayout) overridesLayout.addLayout(resolutionLayout) overridesLayout.addLayout(cameraAaLayout) overridesLayout.addLayout(renderRegionLayout) overridesLayout.addLayout(overscanLayout) ignoresLayout.addLayout(ignoreLayout) mainLayout.addWidget(generalGroupBox) mainLayout.addWidget(overridesGroupBox) mainLayout.addWidget(ignoresGroupBox) mainLayout.addLayout(mainButtonslayout) addUICallbacks() return mainLayout
def setupUi(self, About): About.setObjectName("About") About.setWindowModality(QtCore.Qt.NonModal) About.resize(185, 251) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(About.sizePolicy().hasHeightForWidth()) About.setSizePolicy(sizePolicy) About.setMinimumSize(QtCore.QSize(100, 0)) About.setBaseSize(QtCore.QSize(0, 0)) About.setStyleSheet("") # ------------------------------------------------- gridsetup # NOTE gridsetup -------------------------------------------- self.gridLayout = QtWidgets.QGridLayout(About) self.gridLayout.setContentsMargins(-1, -1, -1, 6) self.gridLayout.setSpacing(6) self.gridLayout.setObjectName("gridLayout") self.verticalLayout_4 = QtWidgets.QVBoxLayout() self.verticalLayout_4.setObjectName("verticalLayout_4") self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem) # ------------------------------------------------- secondrow # NOTE Second Row ------------------------------------------- self.secondrow = QtWidgets.QHBoxLayout() self.secondrow.setObjectName("secondrow") self.web_icon = QtWidgets.QToolButton(About) self.web_icon.setObjectName("web_icon") self.web = QtWidgets.QLabel(About) self.web.setObjectName("web") self.secondrow.addWidget(self.web_icon) self.secondrow.addWidget(self.web) self.verticalLayout.addLayout(self.secondrow) # -------------------------------------------------- thirdrow # NOTE Third Row -------------------------------------------- self.thirdrow = QtWidgets.QHBoxLayout() self.thirdrow.setObjectName("thirdrow") self.github_icon = QtWidgets.QToolButton(About) self.github_icon.setObjectName("github_icon") self.github = QtWidgets.QLabel(About) self.github.setObjectName("github") self.thirdrow.addWidget(self.github_icon) self.thirdrow.addWidget(self.github) self.verticalLayout.addLayout(self.thirdrow) # ------------------------------------------------- fourthrow # NOTE fourthrow -------------------------------------------- self.fourthrow = QtWidgets.QHBoxLayout() self.fourthrow.setObjectName("fourthrow") self.twitter_icon = QtWidgets.QToolButton(About) self.twitter_icon.setObjectName("twitter_icon") self.twitter = QtWidgets.QLabel(About) self.twitter.setObjectName("twitter") self.fourthrow.addWidget(self.twitter_icon) self.fourthrow.addWidget(self.twitter) self.verticalLayout.addLayout(self.fourthrow) # ------------------------------------------------- fifthrow # NOTE fifthrow -------------------------------------------- self.fifthrow = QtWidgets.QHBoxLayout() self.fifthrow.setObjectName("fifthrow") self.email_icon = QtWidgets.QToolButton(About) self.email_icon.setObjectName("email_icon") self.email = QtWidgets.QLabel(About) self.email.setObjectName("email") self.fifthrow.addWidget(self.email_icon) self.fifthrow.addWidget(self.email) self.verticalLayout.addLayout(self.fifthrow) # ----------------------------------------------- columnsetup # NOTE columnsetup ------------------------------------------ self.horizontalLayout.addLayout(self.verticalLayout) self.verticalLayout_4.addLayout(self.horizontalLayout) self.gridLayout.addLayout(self.verticalLayout_4, 0, 0, 1, 1) # ----------------------------------------------------- image # NOTE image --- -------------------------------------------- self.logo = QtWidgets.QLabel(About) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.logo.sizePolicy().hasHeightForWidth()) self.logo.setSizePolicy(sizePolicy) self.logo.setMaximumSize(QtCore.QSize(120, 120)) self.logo.setText("") self.logo.setPixmap(QtGui.QPixmap(scriptpath + "/images/logo.png")) self.logo.setScaledContents(True) self.logo.setObjectName("logo") self.gridLayout.addWidget(self.logo, 0, 1, 1, 1) self.retranslateUi(About) QtCore.QMetaObject.connectSlotsByName(About)