Python PySide2.QtWidgets.QSpacerItem() Examples
The following are 23
code examples of PySide2.QtWidgets.QSpacerItem().
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
PySide2.QtWidgets
, or try the search function
.
Example #1
Source File: manager.py From hotbox_designer with BSD 3-Clause Clear License | 6 votes |
def __init__(self, parent=None): super(HotboxGeneralSettingWidget, self).__init__(parent) self.setFixedWidth(200) self.name = QtWidgets.QLineEdit() self.name.textEdited.connect(partial(self.optionSet.emit, 'name')) self.submenu = BoolCombo(False) self.submenu.valueSet.connect(partial(self.optionSet.emit, 'submenu')) self.triggering = QtWidgets.QComboBox() self.triggering.addItems(TRIGGERING_TYPES) self.triggering.currentIndexChanged.connect(self._triggering_changed) self.aiming = BoolCombo(False) self.aiming.valueSet.connect(partial(self.optionSet.emit, 'aiming')) self.leaveclose = BoolCombo(False) method = partial(self.optionSet.emit, 'leaveclose') self.leaveclose.valueSet.connect(method) self.open_command = CommandButton('show') self.close_command = CommandButton('hide') self.switch_command = CommandButton('switch') self.layout = QtWidgets.QFormLayout(self) self.layout.setContentsMargins(0, 0, 0, 0) self.layout.setSpacing(0) self.layout.setHorizontalSpacing(5) self.layout.addRow(Title('Options')) self.layout.addItem(QtWidgets.QSpacerItem(0, 8)) self.layout.addRow('name', self.name) self.layout.addItem(QtWidgets.QSpacerItem(0, 8)) self.layout.addRow('is submenu', self.submenu) self.layout.addRow('triggering', self.triggering) self.layout.addRow('aiming', self.aiming) self.layout.addRow('close on leave', self.leaveclose) self.layout.addItem(QtWidgets.QSpacerItem(0, 8)) self.layout.addRow(Title('Commands')) self.layout.addItem(QtWidgets.QSpacerItem(0, 8)) self.layout.addRow(self.open_command) self.layout.addRow(self.close_command) self.layout.addRow(self.switch_command)
Example #2
Source File: attributes.py From hotbox_designer with BSD 3-Clause Clear License | 5 votes |
def __init__(self, parent=None): super(ShapeSettings, self).__init__(parent) self.shape = QtWidgets.QComboBox() self.shape.addItems(SHAPE_TYPES) self.shape.currentIndexChanged.connect(self.shape_changed) self.left = FloatEdit(minimum=0.0) method = partial(self.rectModified.emit, 'shape.left') self.left.valueSet.connect(method) self.top = FloatEdit(minimum=0.0) method = partial(self.rectModified.emit, 'shape.right') self.top.valueSet.connect(method) self.width = FloatEdit(minimum=0.0) method = partial(self.rectModified.emit, 'shape.width') self.width.valueSet.connect(method) self.height = FloatEdit(minimum=0.0) method = partial(self.rectModified.emit, 'shape.height') self.height.valueSet.connect(method) self.layout = QtWidgets.QFormLayout(self) self.layout.setSpacing(0) self.layout.setContentsMargins(0, 0, 0, 0) self.layout.setHorizontalSpacing(5) self.layout.addRow('Shape', self.shape) self.layout.addItem(QtWidgets.QSpacerItem(0, 8)) self.layout.addRow(Title('Dimensions')) self.layout.addRow('left', self.left) self.layout.addRow('top', self.top) self.layout.addRow('width', self.width) self.layout.addRow('height', self.height) for label in self.findChildren(QtWidgets.QLabel): if not isinstance(label, Title): label.setFixedWidth(LEFT_CELL_WIDTH)
Example #3
Source File: GeneralDialogues.py From GridCal with GNU General Public License v3.0 | 5 votes |
def __init__(self, name, elements: list()): super(ElementsDialogue, self).__init__() self.setObjectName("self") self.setContextMenuPolicy(QtCore.Qt.NoContextMenu) self.layout = QtWidgets.QVBoxLayout(self) # build elements list self.objects_table = QtWidgets.QTableView() if len(elements) > 0: model = ObjectsModel(elements, elements[0].editable_headers, parent=self.objects_table, editable=False, non_editable_attributes=[1, 2, 14]) self.objects_table.setModel(model) # accept button self.accept_btn = QtWidgets.QPushButton() self.accept_btn.setText('Proceed') self.accept_btn.clicked.connect(self.accept_click) # Copy button self.copy_btn = QtWidgets.QPushButton() self.copy_btn.setText('Copy') self.copy_btn.clicked.connect(self.copy_click) # add all to the GUI self.layout.addWidget(self.objects_table) self.frame2 = QtWidgets.QFrame() self.layout.addWidget(self.frame2) self.layout2 = QtWidgets.QHBoxLayout(self.frame2) self.layout2.addWidget(self.accept_btn) self.layout2.addWidget(QtWidgets.QSpacerItem()) self.layout2.addWidget(self.copy_btn) self.setLayout(self.layout) self.setWindowTitle(name) self.accepted = False
Example #4
Source File: AttackerBar.py From pyrdp with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent: QWidget = None): super().__init__(parent) self.log = logging.getLogger(LOGGER_NAMES.PLAYER) self.attackButton = PlayPauseButton(playText = "Take control", pauseText = "Release control") self.attackButton.clicked.connect(self.onAttackButtonClicked) horizontal = QHBoxLayout() horizontal.addWidget(self.attackButton) horizontal.addItem(QSpacerItem(1, 1, QSizePolicy.Expanding, QSizePolicy.Minimum)) self.setLayout(horizontal)
Example #5
Source File: version_updater_UI_pyside2.py From anima with MIT License | 5 votes |
def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.setWindowModality(QtCore.Qt.ApplicationModal) Dialog.resize(1304, 753) self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) self.verticalLayout.setObjectName("verticalLayout") self.label = QtWidgets.QLabel(Dialog) self.label.setObjectName("label") self.verticalLayout.addWidget(self.label) self.versions_treeView = QtWidgets.QTreeView(Dialog) self.versions_treeView.setObjectName("versions_treeView") self.verticalLayout.addWidget(self.versions_treeView) self.horizontalWidget = QtWidgets.QWidget(Dialog) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.horizontalWidget.sizePolicy().hasHeightForWidth()) self.horizontalWidget.setSizePolicy(sizePolicy) self.horizontalWidget.setObjectName("horizontalWidget") self.horizontalLayout = QtWidgets.QHBoxLayout(self.horizontalWidget) self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setObjectName("horizontalLayout") spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem) self.selectNone_pushButton = QtWidgets.QPushButton(self.horizontalWidget) self.selectNone_pushButton.setObjectName("selectNone_pushButton") self.horizontalLayout.addWidget(self.selectNone_pushButton) self.selectAll_pushButton = QtWidgets.QPushButton(self.horizontalWidget) self.selectAll_pushButton.setObjectName("selectAll_pushButton") self.horizontalLayout.addWidget(self.selectAll_pushButton) self.update_pushButton = QtWidgets.QPushButton(self.horizontalWidget) self.update_pushButton.setObjectName("update_pushButton") self.horizontalLayout.addWidget(self.update_pushButton) self.cancel_pushButton = QtWidgets.QPushButton(self.horizontalWidget) self.cancel_pushButton.setObjectName("cancel_pushButton") self.horizontalLayout.addWidget(self.cancel_pushButton) self.verticalLayout.addWidget(self.horizontalWidget) self.retranslateUi(Dialog) QtCore.QMetaObject.connectSlotsByName(Dialog)
Example #6
Source File: choose_from_list_dialog_UI_pyside2.py From anima with MIT License | 5 votes |
def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(478, 280) self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) self.verticalLayout.setObjectName("verticalLayout") self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.listView = QtWidgets.QListView(Dialog) self.listView.setObjectName("listView") self.horizontalLayout.addWidget(self.listView) self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout_2.addItem(spacerItem) self.pushButton_2 = QtWidgets.QPushButton(Dialog) self.pushButton_2.setObjectName("pushButton_2") self.verticalLayout_2.addWidget(self.pushButton_2) self.pushButton = QtWidgets.QPushButton(Dialog) self.pushButton.setObjectName("pushButton") self.verticalLayout_2.addWidget(self.pushButton) spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout_2.addItem(spacerItem1) self.horizontalLayout.addLayout(self.verticalLayout_2) self.listView_2 = QtWidgets.QListView(Dialog) self.listView_2.setObjectName("listView_2") self.horizontalLayout.addWidget(self.listView_2) self.verticalLayout.addLayout(self.horizontalLayout) self.buttonBox = QtWidgets.QDialogButtonBox(Dialog) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(Dialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject) QtCore.QMetaObject.connectSlotsByName(Dialog)
Example #7
Source File: UITranslator.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 #8
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 #9
Source File: universal_tool_template_0803.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', 'txt': 'QTextEdit', 'list': 'QListWidget', '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 #10
Source File: universal_tool_template_0903.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', 'txt': 'QTextEdit', 'list': 'QListWidget', '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 #11
Source File: gui.py From GridCal with GNU General Public License v3.0 | 4 votes |
def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(941, 590) self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) self.verticalLayout.setContentsMargins(1, 1, 1, 1) self.verticalLayout.setObjectName("verticalLayout") self.frame = QtWidgets.QFrame(Dialog) self.frame.setFrameShape(QtWidgets.QFrame.NoFrame) self.frame.setFrameShadow(QtWidgets.QFrame.Raised) self.frame.setObjectName("frame") self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.frame) self.verticalLayout_2.setContentsMargins(-1, -1, -1, 0) self.verticalLayout_2.setObjectName("verticalLayout_2") self.treeView = QtWidgets.QTreeView(self.frame) self.treeView.setAlternatingRowColors(True) self.treeView.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection) self.treeView.setAnimated(True) self.treeView.setObjectName("treeView") self.verticalLayout_2.addWidget(self.treeView) self.verticalLayout.addWidget(self.frame) self.frame_2 = QtWidgets.QFrame(Dialog) self.frame_2.setFrameShape(QtWidgets.QFrame.NoFrame) self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised) self.frame_2.setObjectName("frame_2") self.horizontalLayout = QtWidgets.QHBoxLayout(self.frame_2) self.horizontalLayout.setContentsMargins(-1, 0, -1, -1) self.horizontalLayout.setObjectName("horizontalLayout") self.accept_selected_pushButton = QtWidgets.QPushButton(self.frame_2) self.accept_selected_pushButton.setText("") icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(":/Icons/icons/accept.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.accept_selected_pushButton.setIcon(icon) self.accept_selected_pushButton.setObjectName("accept_selected_pushButton") self.horizontalLayout.addWidget(self.accept_selected_pushButton) self.reject_selected_pushButton = QtWidgets.QPushButton(self.frame_2) self.reject_selected_pushButton.setText("") icon1 = QtGui.QIcon() icon1.addPixmap(QtGui.QPixmap(":/Icons/icons/delete.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.reject_selected_pushButton.setIcon(icon1) self.reject_selected_pushButton.setObjectName("reject_selected_pushButton") self.horizontalLayout.addWidget(self.reject_selected_pushButton) spacerItem = QtWidgets.QSpacerItem(632, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem) self.doit_pushButton = QtWidgets.QPushButton(self.frame_2) icon2 = QtGui.QIcon() icon2.addPixmap(QtGui.QPixmap(":/Icons/icons/accept2.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.doit_pushButton.setIcon(icon2) self.doit_pushButton.setObjectName("doit_pushButton") self.horizontalLayout.addWidget(self.doit_pushButton) self.verticalLayout.addWidget(self.frame_2) self.retranslateUi(Dialog) QtCore.QMetaObject.connectSlotsByName(Dialog)
Example #12
Source File: accountsmanager_ui.py From hpaste with GNU Lesser General Public License v3.0 | 4 votes |
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(488, 426) MainWindow.setStyleSheet("QWidget#MainWindow {\n" " background-color : rgb(78,78,78)\n" "}") self.verticalLayout = QtWidgets.QVBoxLayout(MainWindow) self.verticalLayout.setSpacing(0) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.gridLayout = QtWidgets.QGridLayout() self.gridLayout.setObjectName("gridLayout") self.publicVerticalLayout = QtWidgets.QVBoxLayout() self.publicVerticalLayout.setObjectName("publicVerticalLayout") self.addPublicPushButton = QtWidgets.QPushButton(MainWindow) self.addPublicPushButton.setObjectName("addPublicPushButton") self.publicVerticalLayout.addWidget(self.addPublicPushButton) self.removePublicPushButton = QtWidgets.QPushButton(MainWindow) self.removePublicPushButton.setObjectName("removePublicPushButton") self.publicVerticalLayout.addWidget(self.removePublicPushButton) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.publicVerticalLayout.addItem(spacerItem) self.gridLayout.addLayout(self.publicVerticalLayout, 1, 2, 1, 1) self.authListView = QtWidgets.QListView(MainWindow) self.authListView.setObjectName("authListView") self.gridLayout.addWidget(self.authListView, 0, 0, 1, 1) self.authVerticalLayout = QtWidgets.QVBoxLayout() self.authVerticalLayout.setObjectName("authVerticalLayout") self.addAuthPushButton = QtWidgets.QPushButton(MainWindow) self.addAuthPushButton.setObjectName("addAuthPushButton") self.authVerticalLayout.addWidget(self.addAuthPushButton) self.removeAuthPushButton = QtWidgets.QPushButton(MainWindow) self.removeAuthPushButton.setObjectName("removeAuthPushButton") self.authVerticalLayout.addWidget(self.removeAuthPushButton) spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.authVerticalLayout.addItem(spacerItem1) self.gridLayout.addLayout(self.authVerticalLayout, 0, 2, 1, 1) self.publicListView = QtWidgets.QListView(MainWindow) self.publicListView.setObjectName("publicListView") self.gridLayout.addWidget(self.publicListView, 1, 0, 1, 1) self.reinitPushButton = QtWidgets.QPushButton(MainWindow) self.reinitPushButton.setObjectName("reinitPushButton") self.gridLayout.addWidget(self.reinitPushButton, 2, 2, 1, 1) self.verticalLayout.addLayout(self.gridLayout) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
Example #13
Source File: universal_tool_template_1010.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): super_class.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = "0.1" self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' 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', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {} #------------------------------
Example #14
Source File: universal_tool_template_1000.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): super_class.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = "0.1" self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] 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', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {} #------------------------------
Example #15
Source File: universal_tool_template_1110.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): QtWidgets.QMainWindow.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = '0.1' self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.name = self.__class__.__name__ 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.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', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {}
Example #16
Source File: universal_tool_template_1100.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): QtWidgets.QMainWindow.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = '0.1' self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.name = self.__class__.__name__ 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.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', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {}
Example #17
Source File: universal_tool_template_1112.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): QtWidgets.QMainWindow.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = '0.1' self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.name = self.__class__.__name__ 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.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', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {}
Example #18
Source File: GearBox_template_1010.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): super_class.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = "0.1" self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' 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', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {} #------------------------------
Example #19
Source File: universal_tool_template_2010.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None): QtWidgets.QMainWindow.__init__(self, parent) # class property self.tpl_ver = tpl_ver self.tpl_date = tpl_date self.version = '0.1' self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' # class info self.name = self.__class__.__name__ self.fileType='.{0}_EXT'.format(self.name) # class path and icon self.location = '' if getattr(sys, 'frozen', False): self.location = sys.executable # frozen case - cx_freeze else: self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__) 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) # class data self.hotkey = {} self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.memoData['last_browse'] = '' # 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', 'spin':'QSpinBox', 'txt': 'QTextEdit', 'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {}
Example #20
Source File: universal_tool_template_1020.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): QtWidgets.QMainWindow.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = '0.1' self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.name = self.__class__.__name__ 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.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', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {}
Example #21
Source File: universal_tool_template_1116.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): QtWidgets.QMainWindow.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = '0.1' self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.hotkey = {} self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.name = self.__class__.__name__ 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.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', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {}
Example #22
Source File: PyAero.py From PyAero with MIT License | 4 votes |
def __init__(self, parent=None): # call constructor of QWidget super().__init__(parent) self.parent = parent # split main window horizontally into two panes self.splitter = QtWidgets.QSplitter(QtCore.Qt.Horizontal) # create QToolBox widget self.toolbox = ToolBox.Toolbox(self.parent) # create box where viewing options are placed self.viewingOptions() verticalSpacer = QtWidgets.QSpacerItem(50, 15, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) horizontal_line = QtWidgets.QFrame() horizontal_line.setFrameShape(QtWidgets.QFrame.HLine) horizontal_line.setFrameShadow(QtWidgets.QFrame.Sunken) self.left_pane = QtWidgets.QWidget() vbox = QtWidgets.QVBoxLayout(self) vbox.addWidget(self.toolbox) vbox.addItem(verticalSpacer) vbox.addWidget(horizontal_line) vbox.addItem(verticalSpacer) vbox.addWidget(self.viewing_options) self.left_pane.setLayout(vbox) # create tabbed windows for viewing self.tabs = QtWidgets.QTabWidget() self.tabs.addTab(self.parent.view, 'Airfoil Viewer') self.tabs.addTab(self.parent.contourview, 'Contour Analysis') # connect tab changed signal to slot self.tabs.currentChanged.connect(self.parent.slots.onTabChanged) # add splitter panes self.splitter.addWidget(self.left_pane) self.splitter.addWidget(self.tabs) self.splitter.setSizes([100, 1300]) # initial hint for splitter spacing # put splitter in a layout box hbox = QtWidgets.QHBoxLayout(self) hbox.addWidget(self.splitter) self.setLayout(hbox)
Example #23
Source File: attributes.py From hotbox_designer with BSD 3-Clause Clear License | 4 votes |
def __init__(self, parent=None): super(TextSettings, self).__init__(parent) self.text = QtWidgets.QLineEdit() self.text.returnPressed.connect(self.text_changed) self.size = FloatEdit(minimum=0.0) self.size.valueSet.connect(partial(self.optionSet.emit, 'text.size')) self.bold = BoolCombo() self.bold.valueSet.connect(partial(self.optionSet.emit, 'text.bold')) self.italic = BoolCombo() method = partial(self.optionSet.emit, 'text.italic') self.italic.valueSet.connect(method) self.color = ColorEdit() self.color.valueSet.connect(partial(self.optionSet.emit, 'text.color')) self.halignement = QtWidgets.QComboBox() self.halignement.addItems(HALIGNS.keys()) self.halignement.currentIndexChanged.connect(self.halign_changed) self.valignement = QtWidgets.QComboBox() self.valignement.addItems(VALIGNS.keys()) self.valignement.currentIndexChanged.connect(self.valign_changed) self.layout = QtWidgets.QFormLayout(self) self.layout.setSpacing(0) self.layout.setContentsMargins(0, 0, 0, 0) self.layout.setHorizontalSpacing(5) self.layout.addRow('Content', self.text) self.layout.addItem(QtWidgets.QSpacerItem(0, 8)) self.layout.addRow(Title('Options')) self.layout.addRow('Size', self.size) self.layout.addRow('Bold', self.bold) self.layout.addRow('Italic', self.italic) self.layout.addRow('Color', self.color) self.layout.addItem(QtWidgets.QSpacerItem(0, 8)) self.layout.addRow(Title('Alignement')) self.layout.addRow('Horizontal', self.halignement) self.layout.addRow('Vertical', self.valignement) for label in self.findChildren(QtWidgets.QLabel): if not isinstance(label, Title): label.setFixedWidth(LEFT_CELL_WIDTH)