Python PyQt4.QtGui.QStackedWidget() Examples
The following are 3
code examples of PyQt4.QtGui.QStackedWidget().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
PyQt4.QtGui
, or try the search function
.
Example #1
Source File: quiz-controller.py From networkzero with MIT License | 6 votes |
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))
Example #2
Source File: guiChatQQ.py From PyLinuxQQ with GNU General Public License v2.0 | 5 votes |
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={}
Example #3
Source File: PiHud.py From pihud with GNU Lesser General Public License v2.1 | 4 votes |
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()