本文整理汇总了Python中PyQt4.Qt.QSplitter.setMaximumWidth方法的典型用法代码示例。如果您正苦于以下问题:Python QSplitter.setMaximumWidth方法的具体用法?Python QSplitter.setMaximumWidth怎么用?Python QSplitter.setMaximumWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qt.QSplitter
的用法示例。
在下文中一共展示了QSplitter.setMaximumWidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Ui_PartWindow
# 需要导入模块: from PyQt4.Qt import QSplitter [as 别名]
# 或者: from PyQt4.Qt.QSplitter import setMaximumWidth [as 别名]
class Ui_PartWindow(QWidget):
"""
The Ui_PartWindow class provides a Part Window UI object composed of three
primary areas:
- The "left area" contains the Project TabWidget which contains
the Model Tree and Property Manager (tabs). Other tabs (widgets)
can be introduced when needed.
- The "right area" contains the 3D Graphics Area (i.e. glpane) displaying
the current part.
- The "bottom area" lives below the left and right areas, spanning
the full width of the part window. It can be used whenever a landscape
layout is needed (i.e. the Sequence Editor). Typically, this area is
not used.
A "part window" splitter lives between the left and right areas that
allow the user to resize the shared area occupied by them. There is no
splitter between the top and bottom areas.
This class supports and is limited to a B{Single Document Interface (SDI)}.
In time, NE1 will migrate to and support a Multiple Document Interface (MDI)
that will allow multiple project documents (i.e. parts, assemblies,
simulations, text files, graphs, tables, etc. documents) to be available
within the common workspace of the NE1 main window.
@see: U{B{NE1 Main Window Framework}
<http://www.nanoengineer-1.net/mediawiki/index.php?title=NE1_Main_Window_Framework>}
"""
widgets = [] # For debugging purposes.
def __init__(self, assy, parent):
"""
Constructor for the part window.
@param assy: The assembly (part)
@type assy: Assembly
@param parent: The parent widget.
@type parent: U{B{QMainWindow}
<http://doc.trolltech.com/4/qmainwindow.html>}
"""
QWidget.__init__(self, parent)
self.parent = parent
self.assy = assy
# note: to support MDI, self.assy would probably need to be a
# different assembly for each PartWindow.
# [bruce 080216 comment]
self.setWindowIcon(geticon("ui/border/Part.png"))
self.updateWindowTitle()
# Used in expanding or collapsing the Model Tree/ PM area
self._previous_pwLeftAreaWidth = PM_DEFAULT_WIDTH
# The main layout for the part window is a VBoxLayout <pwVBoxLayout>.
self.pwVBoxLayout = QVBoxLayout(self)
pwVBoxLayout = self.pwVBoxLayout
pwVBoxLayout.setMargin(0)
pwVBoxLayout.setSpacing(0)
# ################################################################
# <pwSplitter> is the horizontal splitter b/w the
# pwProjectTabWidget and the glpane.
self.pwSplitter = QSplitter(Qt.Horizontal)
pwSplitter = self.pwSplitter
pwSplitter.setObjectName("pwSplitter")
pwSplitter.setHandleWidth(3) # 3 pixels wide.
pwVBoxLayout.addWidget(pwSplitter)
# ##################################################################
# <pwLeftArea> is the container holding the pwProjectTabWidget.
# Note: Making pwLeftArea (and pwRightArea and pwBottomArea) QFrame
# widgets has the benefit of making it easy to draw a border around
# each area. One purpose of this would be to help developers understand
# (visually) how the part window is laid out. I intend to add a debug
# pref to draw part window area borders and add "What's This" text to
# them. Mark 2008-01-05.
self.pwLeftArea = QFrame()
pwLeftArea = self.pwLeftArea
pwLeftArea.setObjectName("pwLeftArea")
pwLeftArea.setMinimumWidth(PM_MINIMUM_WIDTH)
pwLeftArea.setMaximumWidth(PM_MAXIMUM_WIDTH)
pwLeftArea.setSizePolicy(
QSizePolicy(QSizePolicy.Policy(QSizePolicy.Fixed),
QSizePolicy.Policy(QSizePolicy.Expanding)))
# Setting the frame style like this is nice since it clearly
# defines the splitter at the top-left corner.
pwLeftArea.setFrameStyle( QFrame.Panel | QFrame.Sunken )
# This layout will contain splitter (above) and the pwBottomArea.
leftChannelVBoxLayout = QVBoxLayout(pwLeftArea)
leftChannelVBoxLayout.setMargin(0)
leftChannelVBoxLayout.setSpacing(0)
pwSplitter.addWidget(pwLeftArea)
# Makes it so pwLeftArea is not collapsible.
pwSplitter.setCollapsible (0, False)
#.........这里部分代码省略.........