本文整理汇总了Python中PyQt5.QtWidgets.QSplitter.refresh方法的典型用法代码示例。如果您正苦于以下问题:Python QSplitter.refresh方法的具体用法?Python QSplitter.refresh怎么用?Python QSplitter.refresh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QSplitter
的用法示例。
在下文中一共展示了QSplitter.refresh方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: QuadView
# 需要导入模块: from PyQt5.QtWidgets import QSplitter [as 别名]
# 或者: from PyQt5.QtWidgets.QSplitter import refresh [as 别名]
#.........这里部分代码省略.........
} # z
if not axisDict[axis]._isMaximized:
self.switchMinMax(axis)
def ensureMinimized(self, axis):
"""
Minimize the view for the given axis if it isn't already minimized.
"""
axisDict = {
0: self.dock2_ofSplitHorizontal1, # x
1: self.dock1_ofSplitHorizontal2, # y
2: self.dock1_ofSplitHorizontal1,
} # z
if axisDict[axis]._isMaximized:
self.switchMinMax(axis)
def switchMinMax(self, axis):
"""Switch an AxisViewWidget between from minimized to maximized and vice
versa.
Keyword arguments:
axis -- the axis which is represented by the widget (no default)
either string or integer
'x' - 0
'y' - 1
'z' - 2
"""
# TODO: get the mapping information from where it is set! if this is not
# done properly - do it properly
if type(axis) == str:
axisDict = {
"x": self.dock2_ofSplitHorizontal1, # x
"y": self.dock1_ofSplitHorizontal2, # y
"z": self.dock1_ofSplitHorizontal1,
} # z
elif type(axis) == int:
axisDict = {
0: self.dock2_ofSplitHorizontal1, # x
1: self.dock1_ofSplitHorizontal2, # y
2: self.dock1_ofSplitHorizontal1,
} # z
dockWidget = axisDict.pop(axis)
for dWidget in list(axisDict.values()):
if dWidget._isMaximized:
dWidget.graphicsView._hud.maximizeButtonClicked.emit()
dockWidget.graphicsView._hud.maximizeButtonClicked.emit()
def switchXMinMax(self):
self.switchMinMax("x")
def switchYMinMax(self):
self.switchMinMax("y")
def switchZMinMax(self):
self.switchMinMax("z")
def on_dock(self, dockWidget):
if dockWidget._isDocked:
dockWidget.undockView()
self.on_min(dockWidget)
dockWidget.minimizeView()
else:
dockWidget.dockView()
def on_max(self, dockWidget):
dockWidget.setVisible(True)
for dock in self.dockableContainer:
if not dockWidget == dock:
dock.setVisible(False)
# Force sizes to be updated now
QApplication.processEvents()
# On linux, the vertical splitter doesn't seem to refresh unless we do so manually
# Presumably, this is a QT bug.
self.splitVertical.refresh()
# Viewport doesn't update automatically...
view = dockWidget.graphicsView
view.viewport().setGeometry(view.rect())
def on_min(self, dockWidget):
for dock in self.dockableContainer:
dock.setVisible(True)
# Force sizes to be updated now
QApplication.processEvents()
self._resizeEqual()
# Viewports don't update automatically...
for dock in self.dockableContainer:
view = dock.graphicsView
if hasattr(view, "viewport"):
view.viewport().setGeometry(view.rect())