本文整理汇总了Python中PyQt5.QtWidgets.QStackedWidget.resize方法的典型用法代码示例。如果您正苦于以下问题:Python QStackedWidget.resize方法的具体用法?Python QStackedWidget.resize怎么用?Python QStackedWidget.resize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QStackedWidget
的用法示例。
在下文中一共展示了QStackedWidget.resize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ConfigurationWidget
# 需要导入模块: from PyQt5.QtWidgets import QStackedWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QStackedWidget import resize [as 别名]
#.........这里部分代码省略.........
self.configSplitter.setSizes([200, 600])
self.configList.itemActivated.connect(self.__showConfigurationPage)
self.configList.itemClicked.connect(self.__showConfigurationPage)
self.buttonBox.accepted.connect(self.accept)
self.buttonBox.rejected.connect(self.rejected)
if displayMode in [ConfigurationWidget.HelpBrowserMode,
ConfigurationWidget.TrayStarterMode,
ConfigurationWidget.HexEditorMode]:
self.configListSearch.hide()
if displayMode not in [ConfigurationWidget.TrayStarterMode,
ConfigurationWidget.HexEditorMode]:
self.__initLexers()
def accept(self):
"""
Public slot to accept the buttonBox accept signal.
"""
if not isMacPlatform():
wdg = self.focusWidget()
if wdg == self.configList:
return
self.accepted.emit()
def __setupUi(self):
"""
Private method to perform the general setup of the configuration
widget.
"""
self.setObjectName("ConfigurationDialog")
self.resize(900, 650)
self.verticalLayout_2 = QVBoxLayout(self)
self.verticalLayout_2.setSpacing(6)
self.verticalLayout_2.setContentsMargins(6, 6, 6, 6)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.configSplitter = QSplitter(self)
self.configSplitter.setOrientation(Qt.Horizontal)
self.configSplitter.setObjectName("configSplitter")
self.configListWidget = QWidget(self.configSplitter)
self.leftVBoxLayout = QVBoxLayout(self.configListWidget)
self.leftVBoxLayout.setContentsMargins(0, 0, 0, 0)
self.leftVBoxLayout.setSpacing(0)
self.leftVBoxLayout.setObjectName("leftVBoxLayout")
self.configListSearch = E5ClearableLineEdit(
self, self.tr("Enter search text..."))
self.configListSearch.setObjectName("configListSearch")
self.leftVBoxLayout.addWidget(self.configListSearch)
self.configList = QTreeWidget()
self.configList.setObjectName("configList")
self.leftVBoxLayout.addWidget(self.configList)
self.configListSearch.textChanged.connect(self.__searchTextChanged)
self.scrollArea = QScrollArea(self.configSplitter)
self.scrollArea.setFrameShape(QFrame.NoFrame)
self.scrollArea.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
self.scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
self.scrollArea.setWidgetResizable(False)
self.scrollArea.setObjectName("scrollArea")
self.configStack = QStackedWidget()
self.configStack.setFrameShape(QFrame.Box)
示例2: Window
# 需要导入模块: from PyQt5.QtWidgets import QStackedWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QStackedWidget import resize [as 别名]
class Window(QMainWindow):
BOARD_HEIGHT = 621
BOARD_WIDTH = 1000
def __init__(self):
super(Window, self).__init__()
self.widgMain = MainForm()
self.widgTeam = TeamSelectionUI()
self.widgBoard = Board()
print("AFTER BOARD CREATED")
self.server = Server()
# Set up signal to allow state change
self.server.updateActiveWidget.connect(self.updateActiveWidget)
# Set up signal to allow data to be sent to MAIN_SCREEN
self.server.updateConnectedUsersSig.connect(self.widgMain.updateConnectedUsers)
self.server.appendConnectedHistorySig.connect(self.widgMain.appendConnectedHistory)
self.server.updateConnectedUsersSig.connect(self.widgMain.updateConnectedHistory)
self.server.updateGameInfoSig.connect(self.widgMain.updateGameInfo)
""" Set up signal to allow data to be received by the TEAM_SCREEN (self.widgTeam), data sent is used to sort
clients into teams of two
"""
self.server.setupTeamSig.connect(self.widgTeam.setupTeam)
# Set up signal to allow data to be sent to GAME_SCREEN
self.server.updateGameSig.connect(self.widgBoard.updateGame)
# Set up signal to allow updated teams to be sent to server
self.widgTeam.updateTeamsSig.connect(self.server.updateTeams)
self.stack = QStackedWidget(self)
self.stack.resize(self.BOARD_WIDTH, self.BOARD_HEIGHT)
self.stack.addWidget(self.widgMain)
self.stack.addWidget(self.widgTeam)
self.stack.addWidget(self.widgBoard)
self.resize(self.BOARD_WIDTH, self.BOARD_HEIGHT)
layout = QGridLayout()
layout.addWidget(self.stack)
self.setLayout(layout)
self.setWindowTitle("Blobbageddon")
self.stack.setCurrentIndex(0)
self.server.start()
self.show()
def updateActiveWidget(self, adrs):
if (self.server.state.currState == State.GAME_SCREEN):
self.stack.setCurrentIndex(2)
print(len(adrs))
self.widgBoard.start(adrs)
elif self.server.state.currState == State.TEAM_SCREEN:
self.widgTeam.setupUi(adrs)
self.stack.setCurrentIndex(1)
elif (self.server.state.currState == State.MAIN_SCREEN):
self.stack.setCurrentIndex(0)