本文整理汇总了Python中python_qt_binding.QtGui.QIcon.pixmap方法的典型用法代码示例。如果您正苦于以下问题:Python QIcon.pixmap方法的具体用法?Python QIcon.pixmap怎么用?Python QIcon.pixmap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类python_qt_binding.QtGui.QIcon
的用法示例。
在下文中一共展示了QIcon.pixmap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from python_qt_binding.QtGui import QIcon [as 别名]
# 或者: from python_qt_binding.QtGui.QIcon import pixmap [as 别名]
def __init__(self, masteruri, cfg, ns, nodes, parent=None):
QFrame.__init__(self, parent)
self._masteruri = masteruri
self._nodes = {cfg: {ns: nodes}}
frame_layout = QVBoxLayout(self)
frame_layout.setContentsMargins(0, 0, 0, 0)
# create frame for warning label
self.warning_frame = warning_frame = QFrame(self)
warning_layout = QHBoxLayout(warning_frame)
warning_layout.setContentsMargins(0, 0, 0, 0)
warning_layout.addItem(QSpacerItem(0, 0, QSizePolicy.Expanding, QSizePolicy.Expanding))
self.warning_label = QLabel()
icon = QIcon(':/icons/crystal_clear_warning.png')
self.warning_label.setPixmap(icon.pixmap(QSize(40, 40)))
self.warning_label.setToolTip('Multiple configuration for same node found!\nA first one will be selected for the start a node!')
warning_layout.addWidget(self.warning_label)
warning_layout.addItem(QSpacerItem(0, 0, QSizePolicy.Expanding, QSizePolicy.Expanding))
frame_layout.addItem(QSpacerItem(0, 0, QSizePolicy.Expanding, QSizePolicy.Expanding))
frame_layout.addWidget(warning_frame)
# create frame for start/stop buttons
buttons_frame = QFrame()
buttons_layout = QHBoxLayout(buttons_frame)
buttons_layout.setContentsMargins(0, 0, 0, 0)
buttons_layout.addItem(QSpacerItem(20, 20))
self.on_button = QPushButton()
self.on_button.setFlat(False)
self.on_button.setText("On")
self.on_button.clicked.connect(self.on_on_clicked)
buttons_layout.addWidget(self.on_button)
self.off_button = QPushButton()
self.off_button.setFlat(True)
self.off_button.setText("Off")
self.off_button.clicked.connect(self.on_off_clicked)
buttons_layout.addWidget(self.off_button)
buttons_layout.addItem(QSpacerItem(20, 20))
frame_layout.addWidget(buttons_frame)
frame_layout.addItem(QSpacerItem(0, 0, QSizePolicy.Expanding, QSizePolicy.Expanding))
self.warning_frame.setVisible(False)