本文整理汇总了Python中PyQt4.QtGui.QStackedWidget方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QStackedWidget方法的具体用法?Python QtGui.QStackedWidget怎么用?Python QtGui.QStackedWidget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui
的用法示例。
在下文中一共展示了QtGui.QStackedWidget方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QStackedWidget [as 别名]
def __init__(self, controller, position, *args, **kwargs):
super(Panel, self).__init__(position.title(), *args, **kwargs)
self.instructions = controller
self.position = position.lower()
layout = QtGui.QVBoxLayout()
self.selector = QtGui.QComboBox()
self.selector.currentIndexChanged.connect(self.on_selector)
layout.addWidget(self.selector)
self.stack = QtGui.QStackedWidget()
layout.addWidget(self.stack)
self.setLayout(layout)
for cls in screen.ScreenWidget.__subclasses__():
self.selector.addItem(cls.name)
self.stack.addWidget(cls(controller, position))
示例2: setupUi
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QStackedWidget [as 别名]
def setupUi(self, Chat):
self.main=Chat
Chat.setWindowTitle(_translate("Chat", "聊天", None))
Chat.resize(575, 524)
# font
self.font = QtGui.QFont()
self.font.setFamily(_fromUtf8("Helvetica"))
self.font.setPointSize(13)
self.font.setBold(True)
self.font.setItalic(False)
self.font.setWeight(75)
self.font2 = QtGui.QFont()
self.font2.setFamily(_fromUtf8("Helvetica"))
self.font2.setPointSize(9)
# side bar
self.listWidget_Users = QtGui.QListWidget(Chat)
self.listWidget_Users.setGeometry(QtCore.QRect(0, 0, 94, 521))
self.listWidget_Users.setSpacing(2)
self.line = QtGui.QFrame(Chat)
self.line.setGeometry(QtCore.QRect(97, 0, 10, 521))
self.line.setFrameShape(QtGui.QFrame.VLine)
self.line.setFrameShadow(QtGui.QFrame.Sunken)
# stack widget
self.stackedWidget = QtGui.QStackedWidget(Chat)
self.stackedWidget.setGeometry(QtCore.QRect(100, 0, 471, 521))
# page
self.stack = {}
self.listWidget = {}
self.sideButton = {}
self.button_send = {}
self.button_close ={}
self.item_widget={}
self.textEdit = {}
QtCore.QMetaObject.connectSlotsByName(Chat)
# data
self.groupInfo={} #gcode
self.discussInfo={}
示例3: __init__
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QStackedWidget [as 别名]
def __init__(self, global_config, connection):
super(PiHud, self).__init__()
self.global_config = global_config
self.connection = connection
# ================= Color Palette =================
palette = self.palette()
palette.setColor(self.backgroundRole(), QtCore.Qt.black)
self.setPalette(palette)
# ================== Init Pages ===================
self.pageMarker = PageMarker(self)
self.stack = QtGui.QStackedWidget(self)
self.setCentralWidget(self.stack)
# read the config and make pages
for configs in global_config["pages"]:
self.__add_existing_page(configs)
# ================= Context Menu ==================
self.menu = QtGui.QMenu()
subMenu = self.menu.addMenu("Add Widget")
if len(self.connection.supported_commands) > 0:
for command in self.connection.supported_commands:
a = subMenu.addAction(command.name)
a.setData(command)
else:
a = subMenu.addAction("No sensors available")
a.setDisabled(True)
self.menu.addSeparator()
self.menu.addAction("New Page", self.__add_page)
self.menu.addAction("Delete Page", self.__delete_page)
self.menu.addSeparator()
self.menu.addAction("Save Layout", self.__save)
# ===================== Start =====================
self.timer = QtCore.QBasicTimer()
self.setWindowTitle("PiHud")
self.showFullScreen()
self.start()