本文整理汇总了Python中PySide.QtGui.QPixmap方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QPixmap方法的具体用法?Python QtGui.QPixmap怎么用?Python QtGui.QPixmap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui
的用法示例。
在下文中一共展示了QtGui.QPixmap方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_button
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPixmap [as 别名]
def add_button(self, **kwargs):
# so not sure if this is going to work, yay programming!
# intercept/adjust some of the arguments
cmd = kwargs.get('command', 'print "No action defined"')
label = kwargs.get('label', 'Unknown')
annotation = kwargs.get('annotation', '')
image = QtGui.QPixmap()
for (key, val) in kwargs.iteritems():
if key.startswith("image") and IconFactory.is_icon_path(val):
image = QtGui.QIcon(self.icon_factory.disk_path(val))
action = QtGui.QAction(self.widget)
action.setIcon(image)
action.setToolTip(annotation)
action.triggered.connect(lambda: self._exec_cmd(cmd))
button = QtGui.QToolButton()
button.setAutoRaise(True)
button.setDefaultAction(action)
self.layout.addWidget(button)
# -------------------------------------------------------------------------
示例2: __init__
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPixmap [as 别名]
def __init__(self, parent=None, mode=0):
super_class.__init__(self, parent)
#------------------------------
# class variables
#------------------------------
self.version="0.1"
self.help = "How to Use:\n1. Put source info in\n2. Click Process button\n3. Check result output\n4. Save memory info into a file."
self.uiList={} # for ui obj storage
self.memoData = {} # key based variable data storage
self.location = ""
if getattr(sys, 'frozen', False):
# frozen - cx_freeze
self.location = sys.executable
else:
# unfrozen
self.location = os.path.realpath(__file__) # location: ref: sys.modules[__name__].__file__
self.name = self.__class__.__name__
self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
self.iconPix = QtGui.QPixmap(self.iconPath)
self.icon = QtGui.QIcon(self.iconPath)
self.fileType='.{0}_EXT'.format(self.name)
示例3: prepareUI
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPixmap [as 别名]
def prepareUI():
"""
This just sets up the GUI elements.
"""
# Setup the "fork me" ribbon
pixmapForkMe = QtGui.QPixmap(Settings.FORKME_PATH)
Globals.ui.labelAboutForkMe.setPixmap(pixmapForkMe)
Globals.ui.labelAboutForkMe.setTextInteractionFlags(
QtCore.Qt.TextBrowserInteraction)
Globals.ui.labelAboutForkMe.setOpenExternalLinks(True)
Globals.ui.labelAboutForkMe.mousePressEvent = AboutTab.browseGitHub
# Setup the logo
Globals.ui.labelSWLogo.setMaximumWidth(300)
Globals.ui.labelSWLogo.setMaximumHeight(19)
pixmapSWLogo = QtGui.QPixmap(Settings.LOGO_PATH)
Globals.ui.labelSWLogo.setPixmap(pixmapSWLogo)
Globals.ui.labelSWLogo.setTextInteractionFlags(
QtCore.Qt.TextBrowserInteraction)
Globals.ui.labelSWLogo.setOpenExternalLinks(True)
Globals.ui.labelSWLogo.mousePressEvent = AboutTab.browseSW
示例4: showAbout
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPixmap [as 别名]
def showAbout(self):
widget = QtGui.QDialog(self)
widget.setWindowTitle("About PySimulator")
p = QtGui.QPalette()
p.setColor(QtGui.QPalette.Background, QtGui.QColor("white"))
widget.setPalette(p)
layout = QtGui.QGridLayout(widget)
widget.setLayout(layout)
pixmap = QtGui.QPixmap(self.rootDir + "/Icons/dlr-splash.png")
iconLabel = QtGui.QLabel()
iconLabel.setPixmap(pixmap)
layout.addWidget(iconLabel, 0, 0)
layout.addWidget(QtGui.QLabel("Copyright (C) 2011-2015 German Aerospace Center DLR (Deutsches Zentrum fuer Luft- und Raumfahrt e.V.),\nInstitute of System Dynamics and Control. All rights reserved.\n\nPySimulator is free software: You can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nPySimulator is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with PySimulator. If not, see www.gnu.org/licenses."), 1, 0)
layout.addWidget(QtGui.QLabel("PySimulator Version: " + str(version)), 2, 0)
button = QtGui.QPushButton("OK")
button.clicked.connect(widget.close)
layout.addWidget(button, 3, 0)
widget.show()
示例5: __init__
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPixmap [as 别名]
def __init__(self, *args, **kw):
url = kw.pop('url', None)
first = False
if not url:
url = get_authenticated_url()
first = True
self.url = url
self.closing = False
super(QWebView, self).__init__(*args, **kw)
self.setWindowTitle('Bitmask')
self.bitmask_browser = NewPageConnector(self) if first else None
self.loadPage(self.url)
self.bridge = AppBridge(self) if first else None
if self.bridge is not None and HAS_WEBENGINE:
print "[+] registering python<->js bridge"
channel = QWebChannel(self)
channel.registerObject("bitmaskApp", self.bridge)
self.page().setWebChannel(channel)
icon = QtGui.QIcon()
icon.addPixmap(
QtGui.QPixmap(":/mask-icon.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.setWindowIcon(icon)
示例6: __init__
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPixmap [as 别名]
def __init__(self, session=None, parent=None):
super(SubscriptionImportWizard, self).__init__(parent=parent)
self.setModal(True)
if not session:
session = SessionRegistry().current()
self._session = session
logo_pixmap = QtGui.QPixmap(
IconFactory().disk_path("icon:///images/icons/import_32x32.png"))
self.setWindowTitle("Subscription Import")
self.setPixmap(QtGui.QWizard.LogoPixmap, logo_pixmap)
# get entity classes
entity_classes = EntityRegistry().get_entity_classes(
self.session.app_name)
# map entity category to class
self._category_lookup = {}
for cls in entity_classes:
self._category_lookup[cls.category] = cls
selection_id = self.addPage(self.sub_selection_page)
options_id = self.addPage(self.import_options_page)
self.setOption(QtGui.QWizard.CancelButtonOnLeft, on=True)
self.setButtonText(QtGui.QWizard.FinishButton, 'Import')
self._subs_widget.itemSelectionChanged.connect(self._toggle_options)
if not self._subs_widget.repr_items:
QtGui.QMessageBox.warning(self.parent(), "Import Warning",
"<b>No subs available to Import</b>."
)
self.NO_SUBS = True
# -------------------------------------------------------------------------
示例7: __init__
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPixmap [as 别名]
def __init__(self, session=None, parent=None):
super(EntityImportWizard, self).__init__(parent=parent)
self.setModal(True)
if not session:
session = SessionRegistry().current()
self._session = session
logo_pixmap = QtGui.QPixmap(
IconFactory().disk_path("icon:///images/icons/import_32x32.png"))
self.setWindowTitle("Product Import")
self.setPixmap(QtGui.QWizard.LogoPixmap, logo_pixmap)
self._query_categories()
query_id = self.addPage(self.product_query_page)
selection_id = self.addPage(self.product_selection_page)
options_id = self.addPage(self.import_options_page)
confirm_id = self.addPage(self.import_confirm_page)
self.setOption(QtGui.QWizard.CancelButtonOnLeft, on=True)
self.product_widget.itemSelectionChanged.connect(self._toggle_options)
self.setButtonText(QtGui.QWizard.FinishButton, 'Export')
self.currentIdChanged.connect(self._check_descriptions)
# -------------------------------------------------------------------------
示例8: __init__
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPixmap [as 别名]
def __init__(self, session=None, parent=None):
super(EntityExportWizard, self).__init__(parent=parent)
self.setModal(True)
if not session:
session = SessionRegistry().current()
self._session = session
logo_pixmap = QtGui.QPixmap(
IconFactory().disk_path("icon:///images/icons/export_32x32.png"))
self.setWindowTitle("Entity Export")
self.setPixmap(QtGui.QWizard.LogoPixmap, logo_pixmap)
self._query_entities()
selection_id = self.addPage(self.entity_selection_page)
options_id = self.addPage(self.export_options_page)
confirm_id = self.addPage(self.export_confirm_page)
self.setOption(QtGui.QWizard.CancelButtonOnLeft, on=True)
self.entity_widget.itemSelectionChanged.connect(self._toggle_options)
self.setButtonText(QtGui.QWizard.FinishButton, 'Export')
self.currentIdChanged.connect(self._check_descriptions)
if not self.exportable_entities:
QtGui.QMessageBox.warning(self.parent(), "Export Warning",
"<b>No entities available to Export</b>. If all entities " + \
"have been published at this version already, you will " + \
"need to <b>version up</b> before continuing."
)
self.NO_ENTITIES = True
# -------------------------------------------------------------------------
示例9: additional_gui_setup
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPixmap [as 别名]
def additional_gui_setup(self):
# Additional GUI setup
self.graphicsView_banner.mouseDoubleClickEvent = MainWindow.banner_double_click
self.setWindowTitle(__appname__)
self.scene_banner = QtGui.QGraphicsScene()
self.graphicsView_banner.setScene(self.scene_banner)
self.scene_banner.addPixmap(QtGui.QPixmap(":images/banner.png"))
self._path_message("", MainWindow.MSG_OK)
self._avoid_message("", MainWindow.MSG_OK)
self.lineEdit_source.setFocus()
# Auto-completion
system_list = self.nav.eve_db.system_name_list()
for line_edit_field in [
self.lineEdit_source,
self.lineEdit_destination,
self.lineEdit_avoid_name,
self.lineEdit_set_dest,
]:
completer = QtGui.QCompleter(system_list, self)
completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
line_edit_field.setCompleter(completer)
# Signals
self.pushButton_eve_login.clicked.connect(self.btn_eve_login_clicked)
self.pushButton_player_location.clicked.connect(self.btn_player_location_clicked)
self.pushButton_find_path.clicked.connect(self.btn_find_path_clicked)
self.pushButton_crest_config.clicked.connect(self.btn_crest_config_clicked)
self.pushButton_trip_config.clicked.connect(self.btn_trip_config_clicked)
self.pushButton_trip_get.clicked.connect(self.btn_trip_get_clicked)
self.pushButton_avoid_add.clicked.connect(self.btn_avoid_add_clicked)
self.pushButton_avoid_delete.clicked.connect(self.btn_avoid_delete_clicked)
self.pushButton_avoid_clear.clicked.connect(self.btn_avoid_clear_clicked)
self.pushButton_set_dest.clicked.connect(self.btn_set_dest_clicked)
self.pushButton_reset.clicked.connect(self.btn_reset_clicked)
self.lineEdit_source.returnPressed.connect(self.line_edit_source_return)
self.lineEdit_destination.returnPressed.connect(self.line_edit_destination_return)
self.lineEdit_avoid_name.returnPressed.connect(self.line_edit_avoid_name_return)
self.lineEdit_set_dest.returnPressed.connect(self.btn_set_dest_clicked)
self.tableWidget_path.itemSelectionChanged.connect(self.table_item_selection_changed)
示例10: __init__
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPixmap [as 别名]
def __init__(self, parent=None, mode=0):
super_class.__init__(self, parent)
#------------------------------
# class variables
#------------------------------
self.version="0.1"
self.help = "How to Use:\n1. Put source info in\n2. Click Process button\n3. Check result output\n4. Save memory info into a file."
self.uiList={} # for ui obj storage
self.memoData = {} # key based variable data storage
self.location = ""
if getattr(sys, 'frozen', False):
# frozen - cx_freeze
self.location = sys.executable
else:
# unfrozen
self.location = os.path.realpath(__file__) # location: ref: sys.modules[__name__].__file__
self.name = self.__class__.__name__
self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
self.iconPix = QtGui.QPixmap(self.iconPath)
self.icon = QtGui.QIcon(self.iconPath)
self.fileType='.{0}_EXT'.format(self.name)
# Custom user variable
#------------------------------
# initial data
#------------------------------
self.memoData['data']=[]
self.setupStyle()
if isinstance(self, QtWidgets.QMainWindow):
self.setupMenu()
self.setupWin()
self.setupUI()
self.Establish_Connections()
self.loadData()
self.loadLang()
示例11: __init__
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPixmap [as 别名]
def __init__(self, parent=None, mode=0):
super_class.__init__(self, parent)
#------------------------------
# class variables
#------------------------------
self.version="0.1"
self.help = "How to Use:\n1. Put source info in\n2. Click Process button\n3. Check result output\n4. Save memory info into a file."
self.uiList={} # for ui obj storage
self.memoData = {} # key based variable data storage
self.location = ""
if getattr(sys, 'frozen', False):
# frozen - cx_freeze
self.location = sys.executable
else:
# unfrozen
self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__)
self.name = self.__class__.__name__
self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
self.iconPix = QtGui.QPixmap(self.iconPath)
self.icon = QtGui.QIcon(self.iconPath)
self.fileType='.{0}_EXT'.format(self.name)
#------------------------------
# core function variable
#------------------------------
self.qui_core_dict = {
'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout',
'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget',
'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox',
'txt': 'QTextEdit',
'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget',
'space': 'QSpacerItem',
}
self.qui_user_dict = {}
#------------------------------
示例12: __init__
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPixmap [as 别名]
def __init__(self, title, options_config, icon_path=None,
action_button_text=None, modal=False):
super(SessionActionDialog, self).__init__()
self.setModal(modal)
self.setWindowTitle(title)
icon_lbl = QtGui.QLabel()
icon_lbl.setPixmap(QtGui.QPixmap(icon_path))
icon_lbl.setAlignment(QtCore.Qt.AlignRight)
title = QtGui.QLabel(title)
title.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
font = title.font()
font.setPointSize(18)
title.setFont(font)
header_layout = QtGui.QHBoxLayout()
header_layout.addWidget(icon_lbl)
header_layout.addWidget(title)
header_layout.setStretchFactor(title, 90)
self._options = ActionOptionWidget(options_config)
self._btn_box = QtGui.QDialogButtonBox()
self._btn_box.addButton(QtGui.QDialogButtonBox.Cancel)
self._action_btn = self._btn_box.addButton(QtGui.QDialogButtonBox.Ok)
if action_button_text:
self._action_btn.setText(action_button_text)
layout = QtGui.QVBoxLayout(self)
layout.addLayout(header_layout)
layout.addWidget(self._options)
layout.addWidget(self._btn_box)
self._options.value_changed.connect(self.check_value)
self._btn_box.accepted.connect(self.accept)
self._btn_box.rejected.connect(self.reject)
self.check_value()
# -------------------------------------------------------------------------
示例13: __init__
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPixmap [as 别名]
def __init__(self, parent=None):
super(BaseDarkKnightDialog, self).__init__(parent=parent)
cls = self.__class__
self.setWindowTitle("TDK")
self.setWindowIcon(QtGui.QIcon(cls._icon_path))
self.main_layout = QtGui.QVBoxLayout(self)
self.main_layout.setSpacing(4)
self.main_layout.setContentsMargins(4, 4, 4, 4)
# ---- logo image
logo_btn = QtGui.QPushButton()
logo_btn.setCheckable(True)
logo_btn.setFlat(True)
logo_full = QtGui.QPixmap(cls._logo_full_path)
logo = QtGui.QPixmap(cls._logo_path)
def _display_logo(checked):
if checked:
logo_btn.setFixedSize(logo_full.size())
logo_btn.setIcon(QtGui.QIcon(logo_full))
logo_btn.setIconSize(logo_full.size())
else:
logo_btn.setFixedSize(logo.size())
logo_btn.setIcon(QtGui.QIcon(logo))
logo_btn.setIconSize(logo.size())
_display_logo(logo_btn.isChecked())
logo_btn.toggled.connect(_display_logo)
logo_layout = QtGui.QHBoxLayout()
logo_layout.addStretch()
logo_layout.addWidget(logo_btn)
logo_layout.addStretch()
self.main_layout.addLayout(logo_layout)
self.main_layout.setStretchFactor(logo_btn, 0)
# -------------------------------------------------------------------------
示例14: __init__
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPixmap [as 别名]
def __init__(self, parent=None, mode=0):
QtWidgets.QMainWindow.__init__(self, parent)
#------------------------------
# class variables
#------------------------------
self.version = '0.1'
self.date = '2017.01.01'
self.log = 'no version log in user class'
self.help = 'no help guide in user class'
self.hotkey = {}
self.uiList={} # for ui obj storage
self.memoData = {} # key based variable data storage
self.memoData['font_size_default'] = QtGui.QFont().pointSize()
self.memoData['font_size'] = self.memoData['font_size_default']
self.memoData['last_export'] = ''
self.memoData['last_import'] = ''
self.name = self.__class__.__name__
self.location = ''
if getattr(sys, 'frozen', False):
# frozen - cx_freeze
self.location = sys.executable
else:
# unfrozen
self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__)
self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
self.iconPix = QtGui.QPixmap(self.iconPath)
self.icon = QtGui.QIcon(self.iconPath)
self.fileType='.{0}_EXT'.format(self.name)
#------------------------------
# core function variable
#------------------------------
self.qui_core_dict = {
'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout',
'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget',
'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox',
'txt': 'QTextEdit',
'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget',
'space': 'QSpacerItem',
'menu' : 'QMenu', 'menubar' : 'QMenuBar',
}
self.qui_user_dict = {}
示例15: __init__
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPixmap [as 别名]
def __init__(self, parent=None, mode=0):
QtWidgets.QMainWindow.__init__(self, parent)
#------------------------------
# class variables
#------------------------------
self.version = '0.1'
self.date = '2017.01.01'
self.log = 'no version log in user class'
self.help = 'no help guide in user class'
self.uiList={} # for ui obj storage
self.memoData = {} # key based variable data storage
self.memoData['font_size_default'] = QtGui.QFont().pointSize()
self.memoData['font_size'] = self.memoData['font_size_default']
self.memoData['last_export'] = ''
self.memoData['last_import'] = ''
self.name = self.__class__.__name__
self.location = ''
if getattr(sys, 'frozen', False):
# frozen - cx_freeze
self.location = sys.executable
else:
# unfrozen
self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__)
self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
self.iconPix = QtGui.QPixmap(self.iconPath)
self.icon = QtGui.QIcon(self.iconPath)
self.fileType='.{0}_EXT'.format(self.name)
#------------------------------
# core function variable
#------------------------------
self.qui_core_dict = {
'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout',
'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget',
'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox',
'txt': 'QTextEdit',
'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget',
'space': 'QSpacerItem',
'menu' : 'QMenu', 'menubar' : 'QMenuBar',
}
self.qui_user_dict = {}