當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。