本文整理汇总了Python中qgis.PyQt.QtGui.QIcon方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QIcon方法的具体用法?Python QtGui.QIcon怎么用?Python QtGui.QIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qgis.PyQt.QtGui
的用法示例。
在下文中一共展示了QtGui.QIcon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CustomMessage
# 需要导入模块: from qgis.PyQt import QtGui [as 别名]
# 或者: from qgis.PyQt.QtGui import QIcon [as 别名]
def CustomMessage(title, msg, informative="", icon="Critical"):
''' Custom Informative Message '''
d = QMessageBox()
d.setTextFormat(Qt.RichText)
d.setWindowTitle(title)
d.setWindowIcon(QIcon(QPixmap(":/imgFMV/images/icon.png")))
d.setText(msg)
d.setInformativeText(informative)
d.setIconPixmap(QgsUtils.GetIcon(icon))
d.addButton(QMessageBox.Yes)
d.addButton(QMessageBox.No)
d.setDefaultButton(QMessageBox.No)
# Trick resize QMessageBox
horizontalSpacer = QSpacerItem(500, 0, QSizePolicy.Minimum, QSizePolicy.Expanding)
layout = d.layout()
layout.addItem(horizontalSpacer, layout.rowCount(), 0, 1, layout.columnCount())
ret = d.exec_()
return ret
示例2: showVideoInfoDialog
# 需要导入模块: from qgis.PyQt import QtGui [as 别名]
# 或者: from qgis.PyQt.QtGui import QIcon [as 别名]
def showVideoInfoDialog(self, outjson):
"""Show Video Information Dialog
@type outjson: QByteArray
@param outjson: Json file data
"""
view = QTreeView()
model = QJsonModel()
view.setModel(model)
model.loadJsonFromConsole(outjson)
self.VideoInfoDialog = QDialog(self, Qt.Window | Qt.WindowCloseButtonHint)
self.VideoInfoDialog.setWindowTitle(QCoreApplication.translate(
"QgsFmvPlayer", "Video Information : ") + self.fileName)
self.VideoInfoDialog.setWindowIcon(
QIcon(":/imgFMV/images/video-info.png"))
self.verticalLayout = QVBoxLayout(self.VideoInfoDialog)
self.verticalLayout.addWidget(view)
view.expandAll()
view.header().setSectionResizeMode(QHeaderView.ResizeToContents)
self.VideoInfoDialog.resize(500, 400)
self.VideoInfoDialog.show()
示例3: initGui
# 需要导入模块: from qgis.PyQt import QtGui [as 别名]
# 或者: from qgis.PyQt.QtGui import QIcon [as 别名]
def initGui(self):
''' FMV Action '''
self.actionFMV = QAction(QIcon(":/imgFMV/images/icon.png"),
u"FMV", self.iface.mainWindow(),
triggered=self.run)
self.iface.registerMainWindowAction(
self.actionFMV, qgsu.SetShortcutForPluginFMV(u"FMV"))
self.iface.addToolBarIcon(self.actionFMV)
self.iface.addPluginToMenu(QCoreApplication.translate(
"QgsFmv", "Full Motion Video (FMV)"), self.actionFMV)
''' About Action '''
self.actionAbout = QAction(QIcon(":/imgFMV/images/Information.png"),
u"FMV About", self.iface.mainWindow(),
triggered=self.About)
self.iface.registerMainWindowAction(
self.actionAbout, qgsu.SetShortcutForPluginFMV(u"FMV About", "Alt+A"))
self.iface.addPluginToMenu(QCoreApplication.translate(
"QgsFmv", "Full Motion Video (FMV)"), self.actionAbout)
示例4: initGui
# 需要导入模块: from qgis.PyQt import QtGui [as 别名]
# 或者: from qgis.PyQt.QtGui import QIcon [as 别名]
def initGui(self):
"""Create the menu & tool bar items within QGIS"""
icon = QIcon(os.path.dirname(__file__) + "/icon.png")
self.kmlAction = QAction(icon, "Import KML/KMZ", self.iface.mainWindow())
self.kmlAction.triggered.connect(self.showDialog)
self.kmlAction.setCheckable(False)
self.iface.addToolBarIcon(self.kmlAction)
self.iface.addPluginToVectorMenu("KML Tools", self.kmlAction)
# Expansion of HTML description field
icon = QIcon(os.path.dirname(__file__) + "/html.png")
self.htmlDescAction = QAction(icon, "Expand HTML description field", self.iface.mainWindow())
self.htmlDescAction.triggered.connect(self.htmlDescDialog)
self.htmlDescAction.setCheckable(False)
self.iface.addToolBarIcon(self.htmlDescAction)
self.iface.addPluginToVectorMenu("KML Tools", self.htmlDescAction)
# Help
icon = QIcon(os.path.dirname(__file__) + '/help.png')
self.helpAction = QAction(icon, "Help", self.iface.mainWindow())
self.helpAction.triggered.connect(self.help)
self.iface.addPluginToVectorMenu('KML Tools', self.helpAction)
# Add the processing provider
QgsApplication.processingRegistry().addProvider(self.provider)
示例5: initGui
# 需要导入模块: from qgis.PyQt import QtGui [as 别名]
# 或者: from qgis.PyQt.QtGui import QIcon [as 别名]
def initGui(self):
"""Initialize BulkNominatim GUI."""
# Initialize the Dialog Boxes
self.settingsDialog = SettingsWidget(self.iface.mainWindow())
self.reverseGeocodeTool = ReverseGeocodeTool(self.iface, self.settingsDialog)
self.bulkNominatimDialog = BulkNominatimDialog(self.iface, self.iface.mainWindow(), self.settingsDialog)
self.canvas.mapToolSet.connect(self.unsetTool)
# Initialize the bulk nominatim dialog box
icon = QIcon(os.path.dirname(__file__) + "/images/icon.png")
self.nominatimAction = QAction(icon, u"Bulk GeoCoding", self.iface.mainWindow())
self.nominatimAction.triggered.connect(self.nominatimTool)
self.iface.addToolBarIcon(self.nominatimAction)
self.iface.addPluginToMenu(u"Nominatim GeoCoding", self.nominatimAction)
# Add Interface for Reverse GeoCoding
icon = QIcon(os.path.dirname(__file__) + "/images/reverse.png")
self.reverseGeocodeAction = QAction(icon, u"Reverse Point GeoCoding", self.iface.mainWindow())
self.reverseGeocodeAction.triggered.connect(self.setReverseGeocodeTool)
self.reverseGeocodeAction.setCheckable(True)
self.iface.addToolBarIcon(self.reverseGeocodeAction)
self.iface.addPluginToMenu(u"Nominatim GeoCoding", self.reverseGeocodeAction)
# Initialize the Settings Menu
settingsicon = QIcon(os.path.dirname(__file__) + '/images/settings.png')
self.settingsAction = QAction(settingsicon, u"Settings", self.iface.mainWindow())
self.settingsAction.triggered.connect(self.settings)
self.iface.addPluginToMenu(u"Nominatim GeoCoding", self.settingsAction)
# Help
helpicon = QIcon(os.path.dirname(__file__) + '/images/help.png')
self.helpAction = QAction(helpicon, u"Help", self.iface.mainWindow())
self.helpAction.triggered.connect(self.help)
self.iface.addPluginToMenu(u"Nominatim GeoCoding", self.helpAction)
示例6: icon
# 需要导入模块: from qgis.PyQt import QtGui [as 别名]
# 或者: from qgis.PyQt.QtGui import QIcon [as 别名]
def icon(self):
return QIcon(os.path.join(pluginPath, "icons", "icon.png"))
示例7: icon
# 需要导入模块: from qgis.PyQt import QtGui [as 别名]
# 或者: from qgis.PyQt.QtGui import QIcon [as 别名]
def icon(self):
return QIcon(os.path.join(pluginPath, 'icon.png'))
示例8: icon
# 需要导入模块: from qgis.PyQt import QtGui [as 别名]
# 或者: from qgis.PyQt.QtGui import QIcon [as 别名]
def icon(self):
"""
add icon
"""
iconPath = os.path.join(pluginPath, 'icon.png')
return QIcon(os.path.join(iconPath))
示例9: icon
# 需要导入模块: from qgis.PyQt import QtGui [as 别名]
# 或者: from qgis.PyQt.QtGui import QIcon [as 别名]
def icon(self):
return QIcon(os.path.dirname(__file__) + '/images/pluscodes.png')
示例10: icon
# 需要导入模块: from qgis.PyQt import QtGui [as 别名]
# 或者: from qgis.PyQt.QtGui import QIcon [as 别名]
def icon(self):
return QIcon(os.path.dirname(__file__) + '/images/mgrs2point.png')
示例11: icon
# 需要导入模块: from qgis.PyQt import QtGui [as 别名]
# 或者: from qgis.PyQt.QtGui import QIcon [as 别名]
def icon(self):
return QIcon(os.path.dirname(__file__) + '/images/field2geom.png')
示例12: icon
# 需要导入模块: from qgis.PyQt import QtGui [as 别名]
# 或者: from qgis.PyQt.QtGui import QIcon [as 别名]
def icon(self):
return QIcon(os.path.dirname(__file__) + '/images/geom2field.png')
示例13: icon
# 需要导入模块: from qgis.PyQt import QtGui [as 别名]
# 或者: from qgis.PyQt.QtGui import QIcon [as 别名]
def icon(self):
return QIcon(os.path.dirname(__file__) + '/images/point2mgrs.png')
示例14: icon
# 需要导入模块: from qgis.PyQt import QtGui [as 别名]
# 或者: from qgis.PyQt.QtGui import QIcon [as 别名]
def icon(self):
return QIcon(os.path.dirname(__file__) + '/images/copyicon.png')
示例15: test_icon_png
# 需要导入模块: from qgis.PyQt import QtGui [as 别名]
# 或者: from qgis.PyQt.QtGui import QIcon [as 别名]
def test_icon_png(self):
"""Test we can click OK."""
path = ':/plugins/HydroSEDPlugin/icon.png'
icon = QIcon(path)
self.assertFalse(icon.isNull())