本文整理汇总了Python中PySide2.QtWidgets.QSpacerItem方法的典型用法代码示例。如果您正苦于以下问题:Python QtWidgets.QSpacerItem方法的具体用法?Python QtWidgets.QSpacerItem怎么用?Python QtWidgets.QSpacerItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide2.QtWidgets
的用法示例。
在下文中一共展示了QtWidgets.QSpacerItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpacerItem [as 别名]
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)
示例2: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpacerItem [as 别名]
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)
示例3: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpacerItem [as 别名]
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)
示例4: qui
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpacerItem [as 别名]
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)
示例5: qui
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpacerItem [as 别名]
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)
示例6: setupUi
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpacerItem [as 别名]
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)
示例7: setupUi
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpacerItem [as 别名]
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)
示例8: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpacerItem [as 别名]
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
示例9: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpacerItem [as 别名]
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)
示例10: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpacerItem [as 别名]
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 = {}
示例11: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpacerItem [as 别名]
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 = {}
示例12: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpacerItem [as 别名]
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 = {}
示例13: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpacerItem [as 别名]
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 = {}
#------------------------------
示例14: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpacerItem [as 别名]
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 = {}
#------------------------------
示例15: setupUi
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QSpacerItem [as 别名]
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)