当前位置: 首页>>代码示例>>Python>>正文


Python QtGui.QStackedWidget方法代码示例

本文整理汇总了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)) 
开发者ID:tjguk,项目名称:networkzero,代码行数:19,代码来源:quiz-controller.py

示例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={} 
开发者ID:younfor,项目名称:PyLinuxQQ,代码行数:39,代码来源:guiChatQQ.py

示例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() 
开发者ID:brendan-w,项目名称:pihud,代码行数:52,代码来源:PiHud.py


注:本文中的PyQt4.QtGui.QStackedWidget方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。