本文整理汇总了Python中PyQt5.QtGui.QIcon.Normal方法的典型用法代码示例。如果您正苦于以下问题:Python QIcon.Normal方法的具体用法?Python QIcon.Normal怎么用?Python QIcon.Normal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtGui.QIcon
的用法示例。
在下文中一共展示了QIcon.Normal方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_retreat_button
# 需要导入模块: from PyQt5.QtGui import QIcon [as 别名]
# 或者: from PyQt5.QtGui.QIcon import Normal [as 别名]
def setup_retreat_button(self):
size_policy = constants.default_size_policy(self.retreatButton, QSizePolicy.Fixed, QSizePolicy.Fixed)
self.retreatButton.setSizePolicy(size_policy)
self.retreatButton.setMinimumSize(QSize(45, 45))
self.retreatButton.setMaximumSize(QSize(45, 45))
self.retreatButton.setToolTip("")
self.retreatButton.setWhatsThis("")
self.retreatButton.setText("")
icon2 = QIcon()
icon2.addPixmap(QPixmap(self.battleWindow.config.theme_selected.get_retreat_button_pixmap()), QIcon.Normal, QIcon.Off)
self.retreatButton.setIcon(icon2)
self.retreatButton.setIconSize(QSize(42, 40))
self.gridLayout.addWidget(self.retreatButton, 7, 1, 1, 1, Qt.AlignCenter)
示例2: _draw_icon
# 需要导入模块: from PyQt5.QtGui import QIcon [as 别名]
# 或者: from PyQt5.QtGui.QIcon import Normal [as 别名]
def _draw_icon(self, layouts, opt, p):
"""Draw the tab icon.
Args:
layouts: The layouts from _tab_layout.
opt: QStyleOption
p: QPainter
"""
qtutils.ensure_valid(layouts.icon)
icon_mode = (QIcon.Normal if opt.state & QStyle.State_Enabled
else QIcon.Disabled)
icon_state = (QIcon.On if opt.state & QStyle.State_Selected
else QIcon.Off)
icon = opt.icon.pixmap(opt.iconSize, icon_mode, icon_state)
self._style.drawItemPixmap(p, layouts.icon, Qt.AlignCenter, icon)
示例3: _get_icon_rect
# 需要导入模块: from PyQt5.QtGui import QIcon [as 别名]
# 或者: from PyQt5.QtGui.QIcon import Normal [as 别名]
def _get_icon_rect(self, opt, text_rect):
"""Get a QRect for the icon to draw.
Args:
opt: QStyleOptionTab
text_rect: The QRect for the text.
Return:
A QRect.
"""
icon_size = opt.iconSize
if not icon_size.isValid():
icon_extent = self.pixelMetric(QStyle.PM_SmallIconSize)
icon_size = QSize(icon_extent, icon_extent)
icon_mode = (QIcon.Normal if opt.state & QStyle.State_Enabled
else QIcon.Disabled)
icon_state = (QIcon.On if opt.state & QStyle.State_Selected
else QIcon.Off)
# reserve space for favicon when tab bar is vertical (issue #1968)
position = config.cache['tabs.position']
if (position in [QTabWidget.East, QTabWidget.West] and
config.cache['tabs.favicons.show'] != 'never'):
tab_icon_size = icon_size
else:
actual_size = opt.icon.actualSize(icon_size, icon_mode, icon_state)
tab_icon_size = QSize(
min(actual_size.width(), icon_size.width()),
min(actual_size.height(), icon_size.height()))
icon_top = text_rect.center().y() + 1 - tab_icon_size.height() // 2
icon_rect = QRect(QPoint(text_rect.left(), icon_top), tab_icon_size)
icon_rect = self._style.visualRect(opt.direction, opt.rect, icon_rect)
return icon_rect
示例4: setup_next_target_button
# 需要导入模块: from PyQt5.QtGui import QIcon [as 别名]
# 或者: from PyQt5.QtGui.QIcon import Normal [as 别名]
def setup_next_target_button(self):
size_policy = constants.default_size_policy(self.nextTargetButton, QSizePolicy.Fixed, QSizePolicy.Fixed)
self.nextTargetButton.setSizePolicy(size_policy)
self.nextTargetButton.setMinimumSize(QSize(45, 45))
self.nextTargetButton.setMaximumSize(QSize(45, 45))
self.nextTargetButton.setText("")
icon = QIcon()
icon.addPixmap(QPixmap(self.battleWindow.config.theme_selected.get_target_button_pixmap()), QIcon.Normal, QIcon.Off)
self.nextTargetButton.setIcon(icon)
self.nextTargetButton.setIconSize(QSize(40, 40))
self.gridLayout.addWidget(self.nextTargetButton, 5, 1, 1, 1, Qt.AlignCenter)
示例5: setup_end_unit_button
# 需要导入模块: from PyQt5.QtGui import QIcon [as 别名]
# 或者: from PyQt5.QtGui.QIcon import Normal [as 别名]
def setup_end_unit_button(self):
size_policy = constants.default_size_policy(self.endUnitTurnButton, QSizePolicy.Fixed, QSizePolicy.Fixed)
self.endUnitTurnButton.setSizePolicy(size_policy)
self.endUnitTurnButton.setMinimumSize(QSize(45, 45))
self.endUnitTurnButton.setMaximumSize(QSize(45, 45))
self.endUnitTurnButton.setText("")
icon1 = QIcon()
icon1.addPixmap(self.battleWindow.config.theme_selected.get_end_button_pixmap(), QIcon.Normal, QIcon.Off)
self.endUnitTurnButton.setIcon(icon1)
self.endUnitTurnButton.setIconSize(QSize(40, 40))
self.gridLayout.addWidget(self.endUnitTurnButton, 6, 1, 1, 1, Qt.AlignCenter)
示例6: setup_help_button
# 需要导入模块: from PyQt5.QtGui import QIcon [as 别名]
# 或者: from PyQt5.QtGui.QIcon import Normal [as 别名]
def setup_help_button(self):
size_policy = constants.default_size_policy(self.helpButton, QSizePolicy.Fixed, QSizePolicy.Fixed)
self.helpButton.setSizePolicy(size_policy)
self.helpButton.setMinimumSize(QSize(80, 80))
self.helpButton.setMaximumSize(QSize(80, 80))
self.helpButton.setText("")
icon3 = QIcon()
icon3.addPixmap(QPixmap(self.battleWindow.config.theme_selected.get_help_button_pixmap()), QIcon.Normal, QIcon.Off)
self.helpButton.setIcon(icon3)
self.helpButton.setIconSize(QSize(75, 75))
self.gridLayout.addWidget(self.helpButton, 0, 1, 2, 1)
示例7: setup_auto_combat_button
# 需要导入模块: from PyQt5.QtGui import QIcon [as 别名]
# 或者: from PyQt5.QtGui.QIcon import Normal [as 别名]
def setup_auto_combat_button(self):
size_policy = constants.default_size_policy(self.autoCombatButton, QSizePolicy.Fixed, QSizePolicy.Fixed)
self.autoCombatButton.setSizePolicy(size_policy)
self.autoCombatButton.setMinimumSize(QSize(90, 90))
self.autoCombatButton.setMaximumSize(QSize(90, 90))
self.autoCombatButton.setText("")
icon4 = QIcon()
icon4.addPixmap(QPixmap(self.battleWindow.config.theme_selected.get_autocombat_button_pixmap()), QIcon.Normal, QIcon.Off)
self.autoCombatButton.setIcon(icon4)
self.autoCombatButton.setIconSize(QSize(80, 80))
self.gridLayout.addWidget(self.autoCombatButton, 12, 1, 1, 1)
# element interactions
示例8: descargarIcono
# 需要导入模块: from PyQt5.QtGui import QIcon [as 别名]
# 或者: from PyQt5.QtGui.QIcon import Normal [as 别名]
def descargarIcono(self):
nombre = self.comboBox.currentText()
if nombre:
icono = self.button.icon()
print(type(icono))
pixmap = icono.pixmap(200, 200, QIcon.Normal, QIcon.On)
pixmap.save("{}.png".format(nombre), quality = 100)
print("Icono descargado...")
# ================================================================
示例9: IconeBotaoTopo
# 需要导入模块: from PyQt5.QtGui import QIcon [as 别名]
# 或者: from PyQt5.QtGui.QIcon import Normal [as 别名]
def IconeBotaoTopo(self, botao, imagem):
icon = QIcon()
icon.addPixmap(QPixmap(imagem),
QIcon.Normal, QIcon.Off)
# icon.addPixmap(QPixmap((os.path.join(caminho, imagem)),
# QIcon.Normal, QIcon.Off))
botao.setIcon(icon)
botao.setIconSize(QSize(50, 35))
示例10: IconeBotaoMenu
# 需要导入模块: from PyQt5.QtGui import QIcon [as 别名]
# 或者: from PyQt5.QtGui.QIcon import Normal [as 别名]
def IconeBotaoMenu(self, botao, imagem):
icon = QIcon()
icon.addPixmap(QPixmap(imagem),
QIcon.Normal, QIcon.Off)
botao.setIcon(icon)
botao.setIconSize(QSize(25, 25))
示例11: IconeHome
# 需要导入模块: from PyQt5.QtGui import QIcon [as 别名]
# 或者: from PyQt5.QtGui.QIcon import Normal [as 别名]
def IconeHome(self, botao, imagem):
icon = QIcon()
icon.addPixmap(QPixmap(imagem),
QIcon.Normal, QIcon.Off)
botao.setIcon(icon)
botao.setIconSize(QSize(130, 120))
示例12: IconeBotaoForm
# 需要导入模块: from PyQt5.QtGui import QIcon [as 别名]
# 或者: from PyQt5.QtGui.QIcon import Normal [as 别名]
def IconeBotaoForm(self, botao, imagem):
icon = QIcon()
icon.addPixmap(QPixmap(imagem),
QIcon.Normal, QIcon.Off)
botao.setIcon(icon)
botao.setIconSize(QSize(80, 35))
# Mascara Telefone
示例13: __init__
# 需要导入模块: from PyQt5.QtGui import QIcon [as 别名]
# 或者: from PyQt5.QtGui.QIcon import Normal [as 别名]
def __init__(self, *args, **kwargs):
super(ButtonsWidget, self).__init__(*args, **kwargs)
layout = QGridLayout(self)
loader = CIconLoader.fontMaterial()
# 创建一个多态的icon
icon = loader.icon('mdi-qqchat')
icon.add('mdi-access-point', Qt.red, QIcon.Normal, QIcon.On)
icon.add('mdi-camera-metering-matrix',
Qt.green, QIcon.Disabled, QIcon.Off)
icon.add('mdi-file-document-box-check',
Qt.blue, QIcon.Disabled, QIcon.On)
icon.add('mdi-magnify-minus', Qt.cyan, QIcon.Active, QIcon.Off)
icon.add('mdi-account', Qt.magenta, QIcon.Active, QIcon.On)
icon.add('mdi-camera-off', Qt.yellow, QIcon.Selected, QIcon.Off)
icon.add('mdi-set-center', Qt.white, QIcon.Selected, QIcon.On)
layout.addWidget(QLabel('Normal', self), 0, 0)
layout.addWidget(QPushButton(self, icon=icon, text=loader.value(
'mdi-qqchat'), font=loader.font, iconSize=QSize(36, 36)), 0, 1)
layout.addWidget(QLabel('Disabled', self), 1, 0)
layout.addWidget(QPushButton(self, icon=icon, text=loader.value(
'mdi-qqchat'), enabled=False, font=loader.font, iconSize=QSize(48, 48)), 1, 1)
layout.addWidget(QLabel('Active', self), 2, 0)
layout.addWidget(QPushButton(self, icon=icon, text=loader.value(
'mdi-qqchat'), font=loader.font, iconSize=QSize(64, 64)), 2, 1)
layout.addWidget(QLabel('Selected', self), 3, 0)
layout.addWidget(QPushButton(self, icon=icon, text=loader.value(
'mdi-qqchat'), font=loader.font, checkable=True, checked=True), 3, 1)
# 旋转动画
aniButton = QPushButton(self, iconSize=QSize(48, 48))
loader = CIconLoader.fontAwesome()
icon = loader.icon(
'fa-spinner', animation=CIconAnimationSpin(aniButton, 10, 4))
aniButton.setIcon(icon)
layout.addWidget(QLabel('动画', self), 4, 0)
layout.addWidget(aniButton, 4, 1)