本文整理汇总了Python中PyQt4.QtGui.QBoxLayout.addStretch方法的典型用法代码示例。如果您正苦于以下问题:Python QBoxLayout.addStretch方法的具体用法?Python QBoxLayout.addStretch怎么用?Python QBoxLayout.addStretch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QBoxLayout
的用法示例。
在下文中一共展示了QBoxLayout.addStretch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt4.QtGui import QBoxLayout [as 别名]
# 或者: from PyQt4.QtGui.QBoxLayout import addStretch [as 别名]
def __init__(self, parent=None):
super(XDockToolbar, self).__init__(parent)
# defines the position for this widget
self._currentAction = -1
self._selectedAction = None
self._padding = 8
self._position = XDockToolbar.Position.South
self._minimumPixmapSize = QSize(16, 16)
self._maximumPixmapSize = QSize(48, 48)
self._hoverTimer = QTimer()
self._hoverTimer.setSingleShot(True)
self._hoverTimer.setInterval(1000)
self._actionHeld = False
self._easingCurve = QEasingCurve(QEasingCurve.InOutQuad)
self._duration = 200
self._animating = False
# install an event filter to update the location for this toolbar
layout = QBoxLayout(QBoxLayout.LeftToRight)
layout.setContentsMargins(2, 2, 2, 2)
layout.setSpacing(0)
layout.addStretch(1)
layout.addStretch(1)
self.setLayout(layout)
self.setContentsMargins(2, 2, 2, 2)
self.setMouseTracking(True)
parent.window().installEventFilter(self)
parent.window().statusBar().installEventFilter(self)
self._hoverTimer.timeout.connect(self.emitActionHovered)