本文整理汇总了Python中PyQt4.Qt.QColor.setRgb方法的典型用法代码示例。如果您正苦于以下问题:Python QColor.setRgb方法的具体用法?Python QColor.setRgb怎么用?Python QColor.setRgb使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qt.QColor
的用法示例。
在下文中一共展示了QColor.setRgb方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initialize
# 需要导入模块: from PyQt4.Qt import QColor [as 别名]
# 或者: from PyQt4.Qt.QColor import setRgb [as 别名]
def initialize(self, parent, book_id, cid, installed_book, enable_metadata_updates, marvin_db_path):
'''
__init__ is called on SizePersistedDialog()
shared attributes of interest:
.authors
.author_sort
.cover_hash
.pubdate
.publisher
.rating
.series
.series_index
.title
.title_sort
.comments
.tags
.uuid
'''
self.setupUi(self)
self.book_id = book_id
self.cid = cid
self.connected_device = parent.opts.gui.device_manager.device
self.installed_book = installed_book
self.marvin_db_path = marvin_db_path
self.opts = parent.opts
self.parent = parent
self.stored_command = None
self.verbose = parent.verbose
self.BORDER_LR = 4
self.BORDER_TB = 8
self.GREY_FG = '<font style="color:#A0A0A0">{0}</font>'
self.YELLOW_BG = '<font style="background:#FDFF99">{0}</font>'
self._log_location(installed_book.title)
# Subscribe to Marvin driver change events
self.connected_device.marvin_device_signals.reader_app_status_changed.connect(
self.marvin_status_changed)
#self._log("mismatches:\n%s" % repr(installed_book.metadata_mismatches))
self.mismatches = installed_book.metadata_mismatches
self._populate_title()
self._populate_title_sort()
self._populate_series()
self._populate_authors()
self._populate_author_sort()
self._populate_uuid()
self._populate_covers()
self._populate_subjects()
self._populate_publisher()
self._populate_pubdate()
self._populate_rating()
self._populate_description()
# ~~~~~~~~ Export to Marvin button ~~~~~~~~
self.export_to_marvin_button.setIcon(QIcon(os.path.join(self.parent.opts.resources_path,
'icons',
'from_calibre.png')))
self.export_to_marvin_button.clicked.connect(partial(self.store_command, 'export_metadata'))
self.export_to_marvin_button.setEnabled(enable_metadata_updates)
# ~~~~~~~~ Import from Marvin button ~~~~~~~~
self.import_from_marvin_button.setIcon(QIcon(os.path.join(self.parent.opts.resources_path,
'icons',
'from_marvin.png')))
self.import_from_marvin_button.clicked.connect(partial(self.store_command, 'import_metadata'))
self.import_from_marvin_button.setEnabled(enable_metadata_updates)
# If no calibre book, or no mismatches, adjust the display accordingly
if not self.cid:
#self._log("self.cid: %s" % repr(self.cid))
#self._log("self.mismatches: %s" % repr(self.mismatches))
self.calibre_gb.setVisible(False)
self.import_from_marvin_button.setVisible(False)
self.setWindowTitle(u'Marvin metadata')
elif not self.mismatches:
# Show both panels, but hide the transfer buttons
self.export_to_marvin_button.setVisible(False)
self.import_from_marvin_button.setVisible(False)
else:
self.setWindowTitle(u'Metadata Summary')
if False:
# Set the Marvin QGroupBox to Marvin red
marvin_red = QColor()
marvin_red.setRgb(189, 17, 20, alpha=255)
palette = QPalette()
palette.setColor(QPalette.Background, marvin_red)
self.marvin_gb.setPalette(palette)
# ~~~~~~~~ Add a Close or Cancel button ~~~~~~~~
self.close_button = QPushButton(QIcon(I('window-close.png')), 'Close')
if self.mismatches:
self.close_button.setText('Cancel')
self.bb.addButton(self.close_button, QDialogButtonBox.RejectRole)
self.bb.clicked.connect(self.dispatch_button_click)
# Restore position
#.........这里部分代码省略.........