本文整理汇总了Python中PySide.QtGui.QFrame.setAutoFillBackground方法的典型用法代码示例。如果您正苦于以下问题:Python QFrame.setAutoFillBackground方法的具体用法?Python QFrame.setAutoFillBackground怎么用?Python QFrame.setAutoFillBackground使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QFrame
的用法示例。
在下文中一共展示了QFrame.setAutoFillBackground方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PySide.QtGui import QFrame [as 别名]
# 或者: from PySide.QtGui.QFrame import setAutoFillBackground [as 别名]
def __init__(self, sync_manager, network_access_manager, url=None, username=None, password=None, certificate=""):
self.sync_manager = sync_manager
self.nam = network_access_manager
self.certificate = certificate
self.replies = set()
super(SettingsWindow, self).__init__()
self.setWindowIcon(QIcon(os.path.join('icons', 'Logo_sync.png')))
self.setGeometry(70, 60, 300, 250)
self.setWindowTitle("c't SESAM Sync Settings")
layout = QBoxLayout(QBoxLayout.TopToBottom)
layout.setContentsMargins(0, 0, 0, 0)
# Header bar
header_bar = QFrame()
header_bar.setStyleSheet("QWidget { background: rgb(40, 40, 40); } " +
"QToolButton { background: rgb(40, 40, 40); }" +
"QToolTip { color: rgb(255, 255, 255); background-color: rgb(20, 20, 20); " +
"border: 1px solid white; }")
header_bar.setAutoFillBackground(True)
header_bar.setFixedHeight(45)
header_bar_layout = QBoxLayout(QBoxLayout.RightToLeft)
header_bar_layout.addStretch()
header_bar.setLayout(header_bar_layout)
layout.addWidget(header_bar)
self.create_header_bar(header_bar_layout)
self.certificate_loaded.connect(self.test_connection)
# Main area
main_area = QFrame()
main_layout = QBoxLayout(QBoxLayout.TopToBottom)
main_area.setLayout(main_layout)
layout.addWidget(main_area)
self.create_main_area(main_layout, url, username, password)
# Show the window
layout.addStretch()
self.setLayout(layout)
self.show()
示例2: __init__
# 需要导入模块: from PySide.QtGui import QFrame [as 别名]
# 或者: from PySide.QtGui.QFrame import setAutoFillBackground [as 别名]
def __init__(self):
super(MainWindow, self).__init__()
self.nam = QNetworkAccessManager()
self.setWindowIcon(QIcon(os.path.join('icons', 'Logo_rendered_edited.png')))
layout = QBoxLayout(QBoxLayout.TopToBottom)
layout.setContentsMargins(0, 0, 0, 0)
self.preference_manager = PreferenceManager()
self.kgk_manager = KgkManager()
self.kgk_manager.set_preference_manager(self.preference_manager)
self.settings_manager = PasswordSettingsManager(self.preference_manager)
self.setting_dirty = True
# Header bar
header_bar = QFrame()
header_bar.setStyleSheet(
"QWidget { background: rgb(40, 40, 40); } " +
"QToolButton { background: rgb(40, 40, 40); }" +
"QToolTip { color: rgb(255, 255, 255); background-color: rgb(20, 20, 20); " +
"border: 1px solid white; }")
header_bar.setAutoFillBackground(True)
header_bar.setFixedHeight(45)
header_bar_layout = QBoxLayout(QBoxLayout.LeftToRight)
header_bar_layout.addStretch()
header_bar.setLayout(header_bar_layout)
layout.addWidget(header_bar)
self.create_header_bar(header_bar_layout)
# Widget area
main_area = QFrame()
main_layout = QBoxLayout(QBoxLayout.TopToBottom)
main_area.setLayout(main_layout)
layout.addWidget(main_area)
self.create_main_area(main_layout)
# Window layout
layout.addStretch()
main_layout.addStretch()
self.setLayout(layout)
settings = QSettings()
size = settings.value("MainWindow/size")
if not size:
size = QSize(350, 450)
self.resize(size)
position = settings.value("MainWindow/pos")
if not position:
position = QPoint(0, 24)
self.move(position)
self.setWindowTitle("c't SESAM")
self.master_password_edit.setFocus()
self.show()