Python PySide.QtGui.QHBoxLayout() Examples
The following are 30
code examples of PySide.QtGui.QHBoxLayout().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
PySide.QtGui
, or try the search function
.
Example #1
Source File: universal_tool_template_1100.py From universal_tool_template.py with MIT License | 7 votes |
def quickLayout(self, type, ui_name=""): the_layout = '' if type in ("form", "QFormLayout"): the_layout = QtWidgets.QFormLayout() the_layout.setLabelAlignment(QtCore.Qt.AlignLeft) the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow) elif type in ("grid", "QGridLayout"): the_layout = QtWidgets.QGridLayout() elif type in ("hbox", "QHBoxLayout"): the_layout = QtWidgets.QHBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) else: the_layout = QtWidgets.QVBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) if ui_name != "": self.uiList[ui_name] = the_layout return the_layout
Example #2
Source File: preferences.py From FreeCAD_drawing_dimensioning with GNU Lesser General Public License v2.1 | 6 votes |
def generateWidget( self, dimensioningProcess, width = 60, height = 30 ): self.dimensioningProcess = dimensioningProcess colorBox = QtGui.QGraphicsView( self.graphicsScene ) colorBox.setMaximumWidth( width ) colorBox.setMaximumHeight( height ) colorBox.setHorizontalScrollBarPolicy( QtCore.Qt.ScrollBarPolicy.ScrollBarAlwaysOff ) colorBox.setVerticalScrollBarPolicy( QtCore.Qt.ScrollBarPolicy.ScrollBarAlwaysOff ) self.family_textbox = QtGui.QLineEdit() self.size_textbox = QtGui.QLineEdit() groupbox = QtGui.QGroupBox(self.label) hbox = QtGui.QHBoxLayout() hbox.addWidget( self.family_textbox ) hbox.addStretch(1) hbox.addWidget( self.size_textbox ) hbox.addStretch(1) hbox.addWidget( colorBox ) groupbox.setLayout(hbox) self.revertToDefault() self.family_textbox.textChanged.connect( self.update_dimensionConstructorKWs ) self.size_textbox.textChanged.connect( self.update_dimensionConstructorKWs ) return groupbox
Example #3
Source File: shelf.py From dpa-pipe with MIT License | 6 votes |
def __init__(self, name, layout=None, widget=None, palette=None): self._name = name if not layout: layout = QtGui.QHBoxLayout() self._layout = layout if not widget: widget = QtGui.QWidget() widget.setLayout(self.layout) self._widget = widget if not palette: palette = mari.palettes.create(name, widget) self._palette = palette self._palette.show() # -------------------------------------------------------------------------
Example #4
Source File: sublink_edit.py From CurvesWB with GNU Lesser General Public License v2.1 | 6 votes |
def setupUi(self): #self.groupBox = QtGui.QGroupBox(self.dockWidgetContents) self.setObjectName(_fromUtf8(self.link)) self.horizontalLayout = QtGui.QHBoxLayout(self) self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.pushButton = QtGui.QPushButton(self) self.pushButton.setObjectName(_fromUtf8("View")) self.horizontalLayout.addWidget(self.pushButton) self.pushButton_2 = QtGui.QPushButton(self) self.pushButton_2.setObjectName(_fromUtf8("Set")) self.horizontalLayout.addWidget(self.pushButton_2) self.pushButton.clicked.connect(self.view_link) self.pushButton.pressed.connect(self.set_selection) self.pushButton.released.connect(self.reset_selection) self.pushButton_2.clicked.connect(self.set_link) self.setTitle(self.link) self.pushButton.setText("View") self.pushButton_2.setText("Set")
Example #5
Source File: universal_tool_template_1116.py From universal_tool_template.py with MIT License | 6 votes |
def quickLayout(self, type, ui_name=""): the_layout = '' if type in ("form", "QFormLayout"): the_layout = QtWidgets.QFormLayout() the_layout.setLabelAlignment(QtCore.Qt.AlignLeft) the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow) elif type in ("grid", "QGridLayout"): the_layout = QtWidgets.QGridLayout() elif type in ("hbox", "QHBoxLayout"): the_layout = QtWidgets.QHBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) else: the_layout = QtWidgets.QVBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) if ui_name != "": self.uiList[ui_name] = the_layout return the_layout
Example #6
Source File: LNTextEdit.py From universal_tool_template.py with MIT License | 6 votes |
def __init__(self, *args): QtWidgets.QFrame.__init__(self, *args) self.setFrameStyle(QtWidgets.QFrame.StyledPanel | QtWidgets.QFrame.Sunken) self.edit = self.PlainTextEdit() self.number_bar = self.NumberBar(self.edit) hbox = QtWidgets.QHBoxLayout(self) hbox.setSpacing(0) hbox.setContentsMargins(0,0,0,0) # setMargin hbox.addWidget(self.number_bar) hbox.addWidget(self.edit) self.edit.blockCountChanged.connect(self.number_bar.adjustWidth) self.edit.updateRequest.connect(self.number_bar.updateContents)
Example #7
Source File: universal_tool_template_1020.py From universal_tool_template.py with MIT License | 6 votes |
def quickLayout(self, type, ui_name=""): the_layout = '' if type in ("form", "QFormLayout"): the_layout = QtWidgets.QFormLayout() the_layout.setLabelAlignment(QtCore.Qt.AlignLeft) the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow) elif type in ("grid", "QGridLayout"): the_layout = QtWidgets.QGridLayout() elif type in ("hbox", "QHBoxLayout"): the_layout = QtWidgets.QHBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) else: the_layout = QtWidgets.QVBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) if ui_name != "": self.uiList[ui_name] = the_layout return the_layout
Example #8
Source File: GearBox_template_1010.py From universal_tool_template.py with MIT License | 6 votes |
def quickLayout(self, type, ui_name=""): the_layout = '' if type in ("form", "QFormLayout"): the_layout = QtWidgets.QFormLayout() the_layout.setLabelAlignment(QtCore.Qt.AlignLeft) the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow) elif type in ("grid", "QGridLayout"): the_layout = QtWidgets.QGridLayout() elif type in ("hbox", "QHBoxLayout"): the_layout = QtWidgets.QHBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) else: the_layout = QtWidgets.QVBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) if ui_name != "": self.uiList[ui_name] = the_layout return the_layout
Example #9
Source File: UITranslator.py From universal_tool_template.py with MIT License | 6 votes |
def quickLayout(self, type, ui_name=""): the_layout = '' if type in ("form", "QFormLayout"): the_layout = QtWidgets.QFormLayout() the_layout.setLabelAlignment(QtCore.Qt.AlignLeft) the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow) elif type in ("grid", "QGridLayout"): the_layout = QtWidgets.QGridLayout() elif type in ("hbox", "QHBoxLayout"): the_layout = QtWidgets.QHBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) else: the_layout = QtWidgets.QVBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) if ui_name != "": self.uiList[ui_name] = the_layout return the_layout
Example #10
Source File: universal_tool_template_1112.py From universal_tool_template.py with MIT License | 6 votes |
def quickLayout(self, type, ui_name=""): the_layout = '' if type in ("form", "QFormLayout"): the_layout = QtWidgets.QFormLayout() the_layout.setLabelAlignment(QtCore.Qt.AlignLeft) the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow) elif type in ("grid", "QGridLayout"): the_layout = QtWidgets.QGridLayout() elif type in ("hbox", "QHBoxLayout"): the_layout = QtWidgets.QHBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) else: the_layout = QtWidgets.QVBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) if ui_name != "": self.uiList[ui_name] = the_layout return the_layout
Example #11
Source File: universal_tool_template_1110.py From universal_tool_template.py with MIT License | 6 votes |
def quickLayout(self, type, ui_name=""): the_layout = '' if type in ("form", "QFormLayout"): the_layout = QtWidgets.QFormLayout() the_layout.setLabelAlignment(QtCore.Qt.AlignLeft) the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow) elif type in ("grid", "QGridLayout"): the_layout = QtWidgets.QGridLayout() elif type in ("hbox", "QHBoxLayout"): the_layout = QtWidgets.QHBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) else: the_layout = QtWidgets.QVBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) if ui_name != "": self.uiList[ui_name] = the_layout return the_layout
Example #12
Source File: UITranslator_v1.0.py From universal_tool_template.py with MIT License | 6 votes |
def quickLayout(self, type, ui_name=""): the_layout = QtGui.QVBoxLayout() if type == "form": the_layout = QtGui.QFormLayout() the_layout.setLabelAlignment(QtCore.Qt.AlignLeft) the_layout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow) elif type == "grid": the_layout = QtGui.QGridLayout() elif type == "hbox": the_layout = QtGui.QHBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) else: the_layout = QtGui.QVBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) if ui_name != "": self.uiList[ui_name] = the_layout return the_layout
Example #13
Source File: universal_tool_template_1115.py From universal_tool_template.py with MIT License | 6 votes |
def quickLayout(self, type, ui_name=""): the_layout = '' if type in ("form", "QFormLayout"): the_layout = QtWidgets.QFormLayout() the_layout.setLabelAlignment(QtCore.Qt.AlignLeft) the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow) elif type in ("grid", "QGridLayout"): the_layout = QtWidgets.QGridLayout() elif type in ("hbox", "QHBoxLayout"): the_layout = QtWidgets.QHBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) else: the_layout = QtWidgets.QVBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) if ui_name != "": self.uiList[ui_name] = the_layout return the_layout
Example #14
Source File: abstractModel.py From public with GNU General Public License v2.0 | 6 votes |
def buildUI(self): ''' Construct the interface ''' self.mainLayout = QtGui.QVBoxLayout() self.setLayout(self.mainLayout) self.mainLayout.setContentsMargins(0, 0, 0, 0) headerLayout = addWidget(QtGui.QHBoxLayout, None, self.mainLayout) headerLayout.setContentsMargins(0, 0, 0, 0) self.label = addWidget(QtGui.QLabel, 'listLabel', headerLayout, self.__labelText) headerLayout.addStretch(1) self.btnAdd = addWidget(QtGui.QPushButton, 'btnAdd', headerLayout, '[+]') self.btnRemove = addWidget(QtGui.QPushButton, 'btnRemove', headerLayout, '[-]') self.view = addWidget(QtGui.QListView, 'listView', self.mainLayout) model = AbstractItemModel(self, self.__headerData, root=self.__root) self.view.setModel(model)
Example #15
Source File: universal_tool_template_1010.py From universal_tool_template.py with MIT License | 6 votes |
def quickLayout(self, type, ui_name=""): the_layout = '' if type in ("form", "QFormLayout"): the_layout = QtWidgets.QFormLayout() the_layout.setLabelAlignment(QtCore.Qt.AlignLeft) the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow) elif type in ("grid", "QGridLayout"): the_layout = QtWidgets.QGridLayout() elif type in ("hbox", "QHBoxLayout"): the_layout = QtWidgets.QHBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) else: the_layout = QtWidgets.QVBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) if ui_name != "": self.uiList[ui_name] = the_layout return the_layout
Example #16
Source File: universal_tool_template_v8.1.py From universal_tool_template.py with MIT License | 6 votes |
def quickLayout(self, type, ui_name=""): the_layout = '' if type in ("form", "QFormLayout"): the_layout = QtWidgets.QFormLayout() the_layout.setLabelAlignment(QtCore.Qt.AlignLeft) the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow) elif type in ("grid", "QGridLayout"): the_layout = QtWidgets.QGridLayout() elif type in ("hbox", "QHBoxLayout"): the_layout = QtWidgets.QHBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) else: the_layout = QtWidgets.QVBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) if ui_name != "": self.uiList[ui_name] = the_layout return the_layout
Example #17
Source File: universal_tool_template_v7.3.py From universal_tool_template.py with MIT License | 6 votes |
def quickLayout(self, type, ui_name=""): the_layout = '' if type in ("form", "QFormLayout"): the_layout = QtGui.QFormLayout() the_layout.setLabelAlignment(QtCore.Qt.AlignLeft) the_layout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow) elif type in ("grid", "QGridLayout"): the_layout = QtGui.QGridLayout() elif type in ("hbox", "QHBoxLayout"): the_layout = QtGui.QHBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) else: the_layout = QtGui.QVBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) if ui_name != "": self.uiList[ui_name] = the_layout return the_layout
Example #18
Source File: universal_tool_template_1000.py From universal_tool_template.py with MIT License | 6 votes |
def quickLayout(self, type, ui_name=""): the_layout = '' if type in ("form", "QFormLayout"): the_layout = QtWidgets.QFormLayout() the_layout.setLabelAlignment(QtCore.Qt.AlignLeft) the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow) elif type in ("grid", "QGridLayout"): the_layout = QtWidgets.QGridLayout() elif type in ("hbox", "QHBoxLayout"): the_layout = QtWidgets.QHBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) else: the_layout = QtWidgets.QVBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) if ui_name != "": self.uiList[ui_name] = the_layout return the_layout
Example #19
Source File: universal_tool_template_0904.py From universal_tool_template.py with MIT License | 6 votes |
def quickLayout(self, type, ui_name=""): the_layout = '' if type in ("form", "QFormLayout"): the_layout = QtWidgets.QFormLayout() the_layout.setLabelAlignment(QtCore.Qt.AlignLeft) the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow) elif type in ("grid", "QGridLayout"): the_layout = QtWidgets.QGridLayout() elif type in ("hbox", "QHBoxLayout"): the_layout = QtWidgets.QHBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) else: the_layout = QtWidgets.QVBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) if ui_name != "": self.uiList[ui_name] = the_layout return the_layout
Example #20
Source File: universal_tool_template_0803.py From universal_tool_template.py with MIT License | 6 votes |
def quickLayout(self, type, ui_name=""): the_layout = '' if type in ("form", "QFormLayout"): the_layout = QtWidgets.QFormLayout() the_layout.setLabelAlignment(QtCore.Qt.AlignLeft) the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow) elif type in ("grid", "QGridLayout"): the_layout = QtWidgets.QGridLayout() elif type in ("hbox", "QHBoxLayout"): the_layout = QtWidgets.QHBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) else: the_layout = QtWidgets.QVBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) if ui_name != "": self.uiList[ui_name] = the_layout return the_layout
Example #21
Source File: universal_tool_template_0903.py From universal_tool_template.py with MIT License | 6 votes |
def quickLayout(self, type, ui_name=""): the_layout = '' if type in ("form", "QFormLayout"): the_layout = QtWidgets.QFormLayout() the_layout.setLabelAlignment(QtCore.Qt.AlignLeft) the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow) elif type in ("grid", "QGridLayout"): the_layout = QtWidgets.QGridLayout() elif type in ("hbox", "QHBoxLayout"): the_layout = QtWidgets.QHBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) else: the_layout = QtWidgets.QVBoxLayout() the_layout.setAlignment(QtCore.Qt.AlignTop) if ui_name != "": self.uiList[ui_name] = the_layout return the_layout
Example #22
Source File: LNTextEdit_v3.2.py From universal_tool_template.py with MIT License | 6 votes |
def __init__(self, *args): QtGui.QFrame.__init__(self, *args) self.setFrameStyle(QtGui.QFrame.StyledPanel | QtGui.QFrame.Sunken) self.edit = self.PlainTextEdit() self.number_bar = self.NumberBar(self.edit) hbox = QtGui.QHBoxLayout(self) hbox.setSpacing(0) hbox.setContentsMargins(0,0,0,0) # setMargin hbox.addWidget(self.number_bar) hbox.addWidget(self.edit) self.edit.blockCountChanged.connect(self.number_bar.adjustWidth) self.edit.updateRequest.connect(self.number_bar.updateContents)
Example #23
Source File: universal_tool_template_0904.py From universal_tool_template.py with MIT License | 5 votes |
def __init__(self, parent=None, mode=0): super_class.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version="0.1" self.help = "How to Use:\n1. Put source info in\n2. Click Process button\n3. Check result output\n4. Save memory info into a file." self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.location = "" if getattr(sys, 'frozen', False): # frozen - cx_freeze self.location = sys.executable else: # unfrozen self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__) self.name = self.__class__.__name__ self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png') self.iconPix = QtGui.QPixmap(self.iconPath) self.icon = QtGui.QIcon(self.iconPath) self.fileType='.{0}_EXT'.format(self.name) #------------------------------ # core function variable #------------------------------ self.qui_core_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txt': 'QTextEdit', 'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', } self.qui_user_dict = {} #------------------------------
Example #24
Source File: onionSkinRendererPreferences.py From onionSkinRenderer with MIT License | 5 votes |
def setupUi(self, onionSkinRendererPreferences): onionSkinRendererPreferences.setObjectName("onionSkinRendererPreferences") onionSkinRendererPreferences.resize(280, 97) self.verticalLayout = QtGui.QVBoxLayout(onionSkinRendererPreferences) self.verticalLayout.setObjectName("verticalLayout") self.prefs_maxBuffer_layout = QtGui.QHBoxLayout() self.prefs_maxBuffer_layout.setObjectName("prefs_maxBuffer_layout") self.maxBuffer_label = QtGui.QLabel(onionSkinRendererPreferences) self.maxBuffer_label.setObjectName("maxBuffer_label") self.prefs_maxBuffer_layout.addWidget(self.maxBuffer_label) self.maxBuffer_spinBox = QtGui.QSpinBox(onionSkinRendererPreferences) self.maxBuffer_spinBox.setMinimum(1) self.maxBuffer_spinBox.setMaximum(10000) self.maxBuffer_spinBox.setProperty("value", 200) self.maxBuffer_spinBox.setObjectName("maxBuffer_spinBox") self.prefs_maxBuffer_layout.addWidget(self.maxBuffer_spinBox) self.verticalLayout.addLayout(self.prefs_maxBuffer_layout) self.prefs_relativeKeyCount_layout = QtGui.QHBoxLayout() self.prefs_relativeKeyCount_layout.setObjectName("prefs_relativeKeyCount_layout") self.relativeKeyCount_label = QtGui.QLabel(onionSkinRendererPreferences) self.relativeKeyCount_label.setObjectName("relativeKeyCount_label") self.prefs_relativeKeyCount_layout.addWidget(self.relativeKeyCount_label) self.relativeKeyCount_spinBox = QtGui.QSpinBox(onionSkinRendererPreferences) self.relativeKeyCount_spinBox.setMinimum(1) self.relativeKeyCount_spinBox.setMaximum(10) self.relativeKeyCount_spinBox.setProperty("value", 4) self.relativeKeyCount_spinBox.setObjectName("relativeKeyCount_spinBox") self.prefs_relativeKeyCount_layout.addWidget(self.relativeKeyCount_spinBox) self.verticalLayout.addLayout(self.prefs_relativeKeyCount_layout) self.prefs_dialogButtonBox = QtGui.QDialogButtonBox(onionSkinRendererPreferences) self.prefs_dialogButtonBox.setOrientation(QtCore.Qt.Horizontal) self.prefs_dialogButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.prefs_dialogButtonBox.setObjectName("prefs_dialogButtonBox") self.verticalLayout.addWidget(self.prefs_dialogButtonBox) self.retranslateUi(onionSkinRendererPreferences) QtCore.QObject.connect(self.prefs_dialogButtonBox, QtCore.SIGNAL("accepted()"), onionSkinRendererPreferences.accept) QtCore.QObject.connect(self.prefs_dialogButtonBox, QtCore.SIGNAL("rejected()"), onionSkinRendererPreferences.reject) QtCore.QMetaObject.connectSlotsByName(onionSkinRendererPreferences)
Example #25
Source File: options.py From dpa-pipe with MIT License | 5 votes |
def __init__(self, text, icon_path=None, parent=None): super(ActionOptionHeader, self).__init__(parent=parent) self._label = QtGui.QLabel(text + " :") self._label.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) font = self._label.font() self._size = font.pointSize() + 16 self._layout = QtGui.QHBoxLayout() self._layout.setSpacing(4) self._layout.setContentsMargins(0, 0, 0, 0) if icon_path: pixmap = QtGui.QPixmap(icon_path) pixmap = pixmap.scaledToHeight( self._size, QtCore.Qt.SmoothTransformation) self._icon_lbl = QtGui.QLabel() self._icon_lbl.setPixmap(pixmap) self._layout.addWidget(self._icon_lbl) self._layout.addWidget(self._label) self._layout.addStretch() self._layout.setStretchFactor(self._label, 99) self.setLayout(self._layout) # -------------------------------------------------------------------------
Example #26
Source File: houdini.py From dpa-pipe with MIT License | 5 votes |
def __init__(self, parent=None): super(HoudiniDarkKnightDialog, self).__init__(parent=parent) # ---- controls controls_widget = self._setup_controls() scroll_area = QtGui.QScrollArea() scroll_area.setFocusPolicy(QtCore.Qt.NoFocus) scroll_area.setWidgetResizable(True) scroll_area.setWidget(controls_widget) self.main_layout.addWidget(scroll_area) self.main_layout.setStretchFactor(scroll_area, 1000) # ---- submit btn cancel_btn = QtGui.QPushButton("Cancel") cancel_btn.clicked.connect(self.close) submit_btn = QtGui.QPushButton("Submit") submit_btn.clicked.connect(self.accept) btn_layout = QtGui.QHBoxLayout() btn_layout.setContentsMargins(4, 4, 4, 4) btn_layout.addStretch() btn_layout.addWidget(cancel_btn) btn_layout.addWidget(submit_btn) btn_layout.addStretch() self.main_layout.addLayout(btn_layout) self.main_layout.setStretchFactor(btn_layout, 0) self._version_note_edit.setFocus() # -------------------------------------------------------------------------
Example #27
Source File: universal_tool_template_v8.1.py From universal_tool_template.py with MIT License | 5 votes |
def qui(self, ui_list_string, parentObject_string='', opt=''): # pre-defined user short name syntax type_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txtEdit': 'LNTextEdit', 'txt': 'QTextEdit', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', } # get ui_list, creation or existing ui object ui_list = [x.strip() for x in ui_list_string.split('|')] for i in range(len(ui_list)): if ui_list[i] in self.uiList: # - exisiting object ui_list[i] = self.uiList[ui_list[i]] else: # - string creation: # get part info partInfo = ui_list[i].split(';',1) uiName = partInfo[0].split('@')[0] uiType = uiName.rsplit('_',1)[-1] if uiType in type_dict: uiType = type_dict[uiType] # set quickUI string format ui_list[i] = partInfo[0]+';'+uiType if len(partInfo)==1: # give empty button and label a place holder name if uiType in ('btn', 'btnMsg', 'QPushButton','label', 'QLabel'): ui_list[i] = partInfo[0]+';'+uiType + ';'+uiName elif len(partInfo)==2: ui_list[i]=ui_list[i]+";"+partInfo[1] # get parentObject or exisiting object parentObject = parentObject_string if parentObject in self.uiList: parentObject = self.uiList[parentObject] # process quickUI self.quickUI(ui_list, parentObject, opt)
Example #28
Source File: nuke_.py From dpa-pipe with MIT License | 5 votes |
def __init__(self, parent=None): super(NukeDarkKnightDialog, self).__init__(parent=parent) # ---- controls controls_widget = self._setup_controls() scroll_area = QtGui.QScrollArea() scroll_area.setFocusPolicy(QtCore.Qt.NoFocus) scroll_area.setWidgetResizable(True) scroll_area.setWidget(controls_widget) self.main_layout.addWidget(scroll_area) self.main_layout.setStretchFactor(scroll_area, 1000) # ---- submit btn cancel_btn = QtGui.QPushButton("Cancel") cancel_btn.clicked.connect(self.close) submit_btn = QtGui.QPushButton("Submit") submit_btn.clicked.connect(self.accept) btn_layout = QtGui.QHBoxLayout() btn_layout.setContentsMargins(4, 4, 4, 4) btn_layout.addStretch() btn_layout.addWidget(cancel_btn) btn_layout.addWidget(submit_btn) btn_layout.addStretch() self.main_layout.addLayout(btn_layout) self.main_layout.setStretchFactor(btn_layout, 0) self._version_note_edit.setFocus() # -------------------------------------------------------------------------
Example #29
Source File: QtShim.py From grap with MIT License | 5 votes |
def get_QHBoxLayout(): """QHBoxLayout getter.""" try: import PySide.QtGui as QtGui return QtGui.QHBoxLayout except ImportError: import PyQt5.QtWidgets as QtWidgets return QtWidgets.QHBoxLayout
Example #30
Source File: xrefwindow.py From TimeMachine with GNU Lesser General Public License v3.0 | 5 votes |
def __init__(self, parent=None, win=None, current_class=None, class_analysis=None, method_analysis=None): super(XrefDialogMethod, self).__init__(parent) self.current_class = current_class self.class_analysis = class_analysis self.method_analysis = method_analysis title = "Xrefs for the method %s" % self.method_analysis.method self.setWindowTitle(title) xrefs_list = [] xrefs_from = self.method_analysis.get_xref_from() for ref_class, ref_method in xrefs_from: xrefs_list.append(('From', ref_method, ref_class.get_vm_class())) xrefs_to = self.method_analysis.get_xref_to() for ref_class, ref_method in xrefs_to: xrefs_list.append(('To', ref_method, ref_class.get_vm_class())) closeButton = QtGui.QPushButton("Close") closeButton.clicked.connect(self.close) xreflayout = QtGui.QGridLayout() xrefwin = XrefListView(self, win=win, xrefs=xrefs_list) xreflayout.addWidget(xrefwin, 0, 0) buttonsLayout = QtGui.QHBoxLayout() buttonsLayout.addStretch(1) buttonsLayout.addWidget(closeButton) mainLayout = QtGui.QVBoxLayout() mainLayout.addLayout(xreflayout) mainLayout.addLayout(buttonsLayout) self.setLayout(mainLayout)