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


Python QGridLayout.setContentsMargins方法代码示例

本文整理汇总了Python中qt.QGridLayout.setContentsMargins方法的典型用法代码示例。如果您正苦于以下问题:Python QGridLayout.setContentsMargins方法的具体用法?Python QGridLayout.setContentsMargins怎么用?Python QGridLayout.setContentsMargins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在qt.QGridLayout的用法示例。


在下文中一共展示了QGridLayout.setContentsMargins方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setupUi

# 需要导入模块: from qt import QGridLayout [as 别名]
# 或者: from qt.QGridLayout import setContentsMargins [as 别名]
 def setupUi(self):
     """create all other widgets
     we could make the scene view the central widget but I did
     not figure out how to correctly draw the background with
     QGraphicsView/QGraphicsScene.
     QGraphicsView.drawBackground always wants a pixmap
     for a huge rect like 4000x3000 where my screen only has
     1920x1200"""
     # pylint: disable=too-many-statements
     self.setObjectName("MainWindow")
     centralWidget = QWidget()
     self.centralView = FittingView()
     layout = QGridLayout(centralWidget)
     layout.setContentsMargins(0, 0, 0, 0)
     layout.addWidget(self.centralView)
     self.setCentralWidget(centralWidget)
     self.centralView.setFocusPolicy(Qt.StrongFocus)
     self.background = None  # just for pylint
     self.windTileset = Tileset(Internal.Preferences.windTilesetName)
     self.adjustView()
     self.actionScoreGame = self.kajonggAction(
         "scoreGame",
         "draw-freehand",
         self.scoringScene,
         Qt.Key_C)
     self.actionPlayGame = self.kajonggAction(
         "play",
         "arrow-right",
         self.playingScene,
         Qt.Key_N)
     self.actionAbortGame = self.kajonggAction(
         "abort",
         "dialog-close",
         self.abortAction,
         Qt.Key_W)
     self.actionAbortGame.setEnabled(False)
     self.actionQuit = self.kajonggAction(
         "quit",
         "application-exit",
         self.close,
         Qt.Key_Q)
     self.actionPlayers = self.kajonggAction(
         "players", "im-user", self.slotPlayers)
     self.actionRulesets = self.kajonggAction(
         "rulesets",
         "games-kajongg-law",
         self.slotRulesets)
     self.actionChat = self._kajonggToggleAction("chat", "call-start",
                                                 shortcut=Qt.Key_H, actionData=ChatWindow)
     self.actionChat.setEnabled(False)
     self.actionAngle = self.kajonggAction(
         "angle",
         "object-rotate-left",
         self.changeAngle,
         Qt.Key_G)
     self.actionAngle.setEnabled(False)
     self.actionFullscreen = KToggleFullScreenAction(
         self.actionCollection())
     self.actionFullscreen.setShortcut(Qt.CTRL + Qt.Key_F)
     self.actionFullscreen.setShortcutContext(Qt.ApplicationShortcut)
     self.actionFullscreen.setWindow(self)
     self.actionCollection().addAction("fullscreen", self.actionFullscreen)
     self.actionFullscreen.toggled.connect(self.fullScreen)
     self.actionScoreTable = self._kajonggToggleAction(
         "scoreTable", "format-list-ordered",
         Qt.Key_T, actionData=ScoreTable)
     self.actionScoreTable.setEnabled(False)
     self.actionExplain = self._kajonggToggleAction(
         "explain", "applications-education",
         Qt.Key_E, actionData=ExplainView)
     self.actionExplain.setEnabled(False)
     self.actionAutoPlay = self.kajonggAction(
         "demoMode",
         "arrow-right-double",
         None,
         Qt.Key_D)
     self.actionAutoPlay.setCheckable(True)
     self.actionAutoPlay.setEnabled(True)
     self.actionAutoPlay.toggled.connect(self._toggleDemoMode)
     self.actionAutoPlay.setChecked(Internal.autoPlay)
     QMetaObject.connectSlotsByName(self)
开发者ID:KDE,项目名称:kajongg,代码行数:83,代码来源:mainwindow.py


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