本文整理汇总了Python中PySide.QtGui.QSpacerItem方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QSpacerItem方法的具体用法?Python QtGui.QSpacerItem怎么用?Python QtGui.QSpacerItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui
的用法示例。
在下文中一共展示了QtGui.QSpacerItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setupUi
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSpacerItem [as 别名]
def setupUi(self, DockWidget):
DockWidget.setObjectName(_fromUtf8("DockWidget"))
DockWidget.resize(400, 200)
self.dockWidgetContents = QtGui.QWidget()
self.dockWidgetContents.setObjectName(_fromUtf8("dockWidgetContents"))
self.verticalLayout = QtGui.QVBoxLayout(self.dockWidgetContents)
#self.verticalLayout.setMargin(0)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
for link in self.link_sub:
groupBox = myGrpBox(self.dockWidgetContents, link, self.obj)
self.verticalLayout.addWidget(groupBox)
self.pushButton_7 = QtGui.QPushButton(self.dockWidgetContents)
self.pushButton_7.setObjectName(_fromUtf8("pushButton_7"))
self.verticalLayout.addWidget(self.pushButton_7, 0, QtCore.Qt.AlignHCenter)
spacerItem = QtGui.QSpacerItem(20, 237, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem)
DockWidget.setWidget(self.dockWidgetContents)
self.retranslateUi(DockWidget)
QtCore.QMetaObject.connectSlotsByName(DockWidget)
示例2: setupUi
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSpacerItem [as 别名]
def setupUi(self, Zebra):
Zebra.setObjectName(_fromUtf8("Zebra"))
Zebra.resize(241, 302)
self.verticalLayoutWidget = QtGui.QWidget(Zebra)
self.verticalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 221, 251))
self.verticalLayoutWidget.setObjectName(_fromUtf8("verticalLayoutWidget"))
self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.label = QtGui.QLabel(self.verticalLayoutWidget)
self.label.setObjectName(_fromUtf8("label"))
self.verticalLayout.addWidget(self.label, QtCore.Qt.AlignHCenter)
self.horizontalSlider = QtGui.QSlider(self.verticalLayoutWidget)
self.horizontalSlider.setOrientation(QtCore.Qt.Horizontal)
self.horizontalSlider.setObjectName(_fromUtf8("horizontalSlider"))
self.verticalLayout.addWidget(self.horizontalSlider)
self.label_2 = QtGui.QLabel(self.verticalLayoutWidget)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.verticalLayout.addWidget(self.label_2, QtCore.Qt.AlignHCenter)
self.horizontalSlider_2 = QtGui.QSlider(self.verticalLayoutWidget)
self.horizontalSlider_2.setOrientation(QtCore.Qt.Horizontal)
self.horizontalSlider_2.setObjectName(_fromUtf8("horizontalSlider_2"))
self.verticalLayout.addWidget(self.horizontalSlider_2)
self.label_3 = QtGui.QLabel(self.verticalLayoutWidget)
self.label_3.setObjectName(_fromUtf8("label_3"))
self.verticalLayout.addWidget(self.label_3, QtCore.Qt.AlignHCenter)
self.horizontalSlider_3 = QtGui.QSlider(self.verticalLayoutWidget)
self.horizontalSlider_3.setOrientation(QtCore.Qt.Horizontal)
self.horizontalSlider_3.setObjectName(_fromUtf8("horizontalSlider_3"))
self.verticalLayout.addWidget(self.horizontalSlider_3)
spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem)
self.pushButton = QtGui.QPushButton(self.verticalLayoutWidget)
self.pushButton.setObjectName(_fromUtf8("pushButton"))
self.verticalLayout.addWidget(self.pushButton, QtCore.Qt.AlignHCenter)
self.retranslateUi(Zebra)
# QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL(_fromUtf8("released()")), Zebra.close)
# QtCore.QMetaObject.connectSlotsByName(Zebra)
示例3: clear_verify_layout
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSpacerItem [as 别名]
def clear_verify_layout(self):
for i in reversed(range(self.verify_layout.count())):
widget = self.verify_layout.itemAt(i)
if isinstance(widget, QtGui.QLayout):
for j in reversed(range(widget.count())):
widget.itemAt(j).widget().deleteLater()
if isinstance(widget, QtGui.QSpacerItem):
self.verify_layout.removeItem(widget)
else:
try:
widget.deleteLater()
except:
pass
示例4: qui
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui 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 PySide import QtGui [as 别名]
# 或者: from PySide.QtGui 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: qui
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui 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',
'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)
示例7: setupUi
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSpacerItem [as 别名]
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.setWindowModality(QtCore.Qt.ApplicationModal)
Dialog.resize(1304, 753)
self.verticalLayout = QtGui.QVBoxLayout(Dialog)
self.verticalLayout.setObjectName("verticalLayout")
self.label = QtGui.QLabel(Dialog)
self.label.setObjectName("label")
self.verticalLayout.addWidget(self.label)
self.versions_treeView = QtGui.QTreeView(Dialog)
self.versions_treeView.setObjectName("versions_treeView")
self.verticalLayout.addWidget(self.versions_treeView)
self.horizontalWidget = QtGui.QWidget(Dialog)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.horizontalWidget.sizePolicy().hasHeightForWidth())
self.horizontalWidget.setSizePolicy(sizePolicy)
self.horizontalWidget.setObjectName("horizontalWidget")
self.horizontalLayout = QtGui.QHBoxLayout(self.horizontalWidget)
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout.setObjectName("horizontalLayout")
spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.selectNone_pushButton = QtGui.QPushButton(self.horizontalWidget)
self.selectNone_pushButton.setObjectName("selectNone_pushButton")
self.horizontalLayout.addWidget(self.selectNone_pushButton)
self.selectAll_pushButton = QtGui.QPushButton(self.horizontalWidget)
self.selectAll_pushButton.setObjectName("selectAll_pushButton")
self.horizontalLayout.addWidget(self.selectAll_pushButton)
self.update_pushButton = QtGui.QPushButton(self.horizontalWidget)
self.update_pushButton.setObjectName("update_pushButton")
self.horizontalLayout.addWidget(self.update_pushButton)
self.cancel_pushButton = QtGui.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: setupUi
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSpacerItem [as 别名]
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(478, 280)
self.verticalLayout = QtGui.QVBoxLayout(Dialog)
self.verticalLayout.setObjectName("verticalLayout")
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.listView = QtGui.QListView(Dialog)
self.listView.setObjectName("listView")
self.horizontalLayout.addWidget(self.listView)
self.verticalLayout_2 = QtGui.QVBoxLayout()
self.verticalLayout_2.setObjectName("verticalLayout_2")
spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_2.addItem(spacerItem)
self.pushButton_2 = QtGui.QPushButton(Dialog)
self.pushButton_2.setObjectName("pushButton_2")
self.verticalLayout_2.addWidget(self.pushButton_2)
self.pushButton = QtGui.QPushButton(Dialog)
self.pushButton.setObjectName("pushButton")
self.verticalLayout_2.addWidget(self.pushButton)
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_2.addItem(spacerItem1)
self.horizontalLayout.addLayout(self.verticalLayout_2)
self.listView_2 = QtGui.QListView(Dialog)
self.listView_2.setObjectName("listView_2")
self.horizontalLayout.addWidget(self.listView_2)
self.verticalLayout.addLayout(self.horizontalLayout)
self.buttonBox = QtGui.QDialogButtonBox(Dialog)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.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)
示例9: setupUi
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSpacerItem [as 别名]
def setupUi(self, DockWidget):
DockWidget.setObjectName(_fromUtf8("DockWidget"))
DockWidget.resize(267, 136)
DockWidget.setFloating(True)
self.dockWidgetContents = QtGui.QWidget()
self.dockWidgetContents.setObjectName(_fromUtf8("dockWidgetContents"))
self.gridLayout = QtGui.QGridLayout(self.dockWidgetContents)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.verticalLayout = QtGui.QVBoxLayout()
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
self.label = QtGui.QLabel(self.dockWidgetContents)
self.label.setObjectName(_fromUtf8("label"))
self.horizontalLayout.addWidget(self.label)
spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.comboFastenerType = QtGui.QComboBox(self.dockWidgetContents)
self.comboFastenerType.setObjectName(_fromUtf8("comboFastenerType"))
self.horizontalLayout.addWidget(self.comboFastenerType)
self.verticalLayout.addLayout(self.horizontalLayout)
self.horizontalLayout_2 = QtGui.QHBoxLayout()
self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
self.label_2 = QtGui.QLabel(self.dockWidgetContents)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.horizontalLayout_2.addWidget(self.label_2)
spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem1)
self.comboDiameter = QtGui.QComboBox(self.dockWidgetContents)
self.comboDiameter.setObjectName(_fromUtf8("comboDiameter"))
self.horizontalLayout_2.addWidget(self.comboDiameter)
self.verticalLayout.addLayout(self.horizontalLayout_2)
self.horizontalLayout_3 = QtGui.QHBoxLayout()
self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
self.labelHoleSize = QtGui.QLabel(self.dockWidgetContents)
self.labelHoleSize.setObjectName(_fromUtf8("labelHoleSize"))
self.horizontalLayout_3.addWidget(self.labelHoleSize)
spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_3.addItem(spacerItem2)
self.textHole = QtGui.QLineEdit(self.dockWidgetContents)
self.textHole.setReadOnly(True)
self.textHole.setObjectName(_fromUtf8("textHole"))
self.horizontalLayout_3.addWidget(self.textHole)
self.verticalLayout.addLayout(self.horizontalLayout_3)
spacerItem3 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem3)
self.gridLayout.addLayout(self.verticalLayout, 1, 0, 1, 1)
DockWidget.setWidget(self.dockWidgetContents)
self.retranslateUi(DockWidget)
QtCore.QMetaObject.connectSlotsByName(DockWidget)
示例10: __init__
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui 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 PySide import QtGui [as 别名]
# 或者: from PySide.QtGui 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 PySide import QtGui [as 别名]
# 或者: from PySide.QtGui 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 PySide import QtGui [as 别名]
# 或者: from PySide.QtGui 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 PySide import QtGui [as 别名]
# 或者: from PySide.QtGui 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 PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSpacerItem [as 别名]
def setupUi(self, Form):
Form.setObjectName("Authenticate")
Form.resize(220, 105)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap("logo.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
Form.setWindowIcon(icon)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
Form.setSizePolicy(sizePolicy)
Form.setMinimumSize(QtCore.QSize(220, 105))
Form.setMaximumSize(QtCore.QSize(220, 105))
self.verticalLayout = QtGui.QVBoxLayout(Form)
self.verticalLayout.setObjectName("verticalLayout")
self.label_3 = QtGui.QLabel(Form)
self.label_3.setAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop)
self.label_3.setWordWrap(True)
self.label_3.setObjectName("label_3")
self.verticalLayout.addWidget(self.label_3)
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.label = QtGui.QLabel(Form)
self.label.setObjectName("label")
self.horizontalLayout.addWidget(self.label)
self.AuthBox = QtGui.QLineEdit(Form)
self.AuthBox.setObjectName("AuthBox")
self.horizontalLayout.addWidget(self.AuthBox)
self.verticalLayout.addLayout(self.horizontalLayout)
self.horizontalLayout_2 = QtGui.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem)
self.AuthButton = QtGui.QPushButton(Form)
self.AuthButton.setObjectName("AuthButton")
self.horizontalLayout_2.addWidget(self.AuthButton)
spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem1)
self.verticalLayout.addLayout(self.horizontalLayout_2)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
QtCore.QObject.connect(self.AuthButton, QtCore.SIGNAL("clicked()"), self.auth)