本文整理汇总了Python中spyderlib.qt.QtGui.QHBoxLayout.addSpacerItem方法的典型用法代码示例。如果您正苦于以下问题:Python QHBoxLayout.addSpacerItem方法的具体用法?Python QHBoxLayout.addSpacerItem怎么用?Python QHBoxLayout.addSpacerItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类spyderlib.qt.QtGui.QHBoxLayout
的用法示例。
在下文中一共展示了QHBoxLayout.addSpacerItem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from spyderlib.qt.QtGui import QHBoxLayout [as 别名]
# 或者: from spyderlib.qt.QtGui.QHBoxLayout import addSpacerItem [as 别名]
#.........这里部分代码省略.........
arrow = get_image_path('hide.png')
self.stylesheet = '''QPushButton {
background-color: rgbs(200,200,200,100%);
color: rgbs(0,0,0,100%);
border-style: outset;
border-width: 1px;
border-radius: 3px;
border-color: rgbs(100,100,100,100%);
padding: 2px;
}
QPushButton:hover {
background-color: rgbs(150, 150, 150, 100%);
}
QPushButton:disabled {
background-color: rgbs(230,230,230,100%);
color: rgbs(200,200,200,100%);
border-color: rgbs(200,200,200,100%);
}
QComboBox {
padding-left: 5px;
background-color: rgbs(230,230,230,100%);
border-width: 0px;
border-radius: 0px;
min-height:20px;
max-height:20px;
}
QComboBox::drop-down {
subcontrol-origin: padding;
subcontrol-position: top left;
border-width: 0px;
}
QComboBox::down-arrow {
image: url(''' + arrow + ''');
}
'''
# Windows fix, slashes should be always in unix-style
self.stylesheet = self.stylesheet.replace('\\', '/')
for widget in self.widgets:
widget.setFocusPolicy(Qt.NoFocus)
widget.setStyleSheet(self.stylesheet)
layout_top = QHBoxLayout()
layout_top.addWidget(self.combo_title)
layout_top.addStretch()
layout_top.addWidget(self.button_close)
layout_top.addSpacerItem(QSpacerItem(self.offset_shadow,
self.offset_shadow))
layout_content = QHBoxLayout()
layout_content.addWidget(self.label_content)
layout_content.addWidget(self.label_image)
layout_content.addSpacerItem(QSpacerItem(5, 5))
layout_run = QHBoxLayout()
layout_run.addStretch()
layout_run.addWidget(self.button_run)
layout_run.addStretch()
layout_run.addSpacerItem(QSpacerItem(self.offset_shadow,
self.offset_shadow))
layout_navigation = QHBoxLayout()
layout_navigation.addWidget(self.button_home)
layout_navigation.addWidget(self.button_previous)
layout_navigation.addStretch()
layout_navigation.addWidget(self.label_current)
layout_navigation.addStretch()
layout_navigation.addWidget(self.button_next)
layout_navigation.addWidget(self.button_end)
layout_navigation.addSpacerItem(QSpacerItem(self.offset_shadow,
self.offset_shadow))
layout = QVBoxLayout()
layout.addLayout(layout_top)
layout.addStretch()
layout.addSpacerItem(QSpacerItem(15, 15))
layout.addLayout(layout_content)
layout.addLayout(layout_run)
layout.addStretch()
layout.addSpacerItem(QSpacerItem(15, 15))
layout.addLayout(layout_navigation)
layout.addSpacerItem(QSpacerItem(self.offset_shadow,
self.offset_shadow))
layout.setSizeConstraint(QLayout.SetFixedSize)
self.setLayout(layout)
self.set_funcs_before_fade_in([self._disable_widgets])
self.set_funcs_after_fade_in([self._enable_widgets])
self.set_funcs_before_fade_out([self._disable_widgets])
self.setContextMenuPolicy(Qt.CustomContextMenu)