本文整理汇总了Python中PyQt4.Qt.QFrame.setAutoFillBackground方法的典型用法代码示例。如果您正苦于以下问题:Python QFrame.setAutoFillBackground方法的具体用法?Python QFrame.setAutoFillBackground怎么用?Python QFrame.setAutoFillBackground使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qt.QFrame
的用法示例。
在下文中一共展示了QFrame.setAutoFillBackground方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PM_Dialog
# 需要导入模块: from PyQt4.Qt import QFrame [as 别名]
# 或者: from PyQt4.Qt.QFrame import setAutoFillBackground [as 别名]
#.........这里部分代码省略.........
pass
def updateMessage(self, msg = ''):
"""
Updates the message box with an informative message
@param msg: Message to be displayed in the Message groupbox of
the property manager
@type msg: string
"""
self.MessageGroupBox.insertHtmlMessage(msg,
setAsDefault = False,
minLines = 5)
def _createHeader(self, iconPath, title):
"""
Creates the Property Manager header, which contains an icon
(a QLabel with a pixmap) and white text (a QLabel with text).
@param iconPath: The relative path for the icon (PNG image) that
appears in the header.
@type iconPath: str
@param title: The title that appears in the header.
@type title: str
"""
# Heading frame (dark gray), which contains
# a pixmap and (white) heading text.
self.headerFrame = QFrame(self)
self.headerFrame.setFrameShape(QFrame.NoFrame)
self.headerFrame.setFrameShadow(QFrame.Plain)
self.headerFrame.setPalette(QPalette(pmHeaderFrameColor))
self.headerFrame.setAutoFillBackground(True)
# HBox layout for heading frame, containing the pixmap
# and label (title).
HeaderFrameHLayout = QHBoxLayout(self.headerFrame)
# 2 pixels around edges --
HeaderFrameHLayout.setMargin(PM_HEADER_FRAME_MARGIN)
# 5 pixel between pixmap and label. --
HeaderFrameHLayout.setSpacing(PM_HEADER_FRAME_SPACING)
# PropMgr icon. Set image by calling setHeaderIcon().
self.headerIcon = QLabel(self.headerFrame)
self.headerIcon.setSizePolicy(
QSizePolicy(QSizePolicy.Policy(QSizePolicy.Fixed),
QSizePolicy.Policy(QSizePolicy.Fixed)))
self.headerIcon.setScaledContents(True)
HeaderFrameHLayout.addWidget(self.headerIcon)
# PropMgr header title text (a QLabel).
self.headerTitle = QLabel(self.headerFrame)
headerTitlePalette = self._getHeaderTitlePalette()
self.headerTitle.setPalette(headerTitlePalette)
self.headerTitle.setAlignment(PM_LABEL_LEFT_ALIGNMENT)
# Assign header title font.
self.headerTitle.setFont(self._getHeaderFont())
HeaderFrameHLayout.addWidget(self.headerTitle)
self.vBoxLayout.addWidget(self.headerFrame)
# Set header icon and title text.