当前位置: 首页>>代码示例>>Python>>正文


Python QtGui.QIcon方法代码示例

本文整理汇总了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 
开发者ID:All4Gis,项目名称:QGISFMV,代码行数:22,代码来源:QgsUtils.py

示例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() 
开发者ID:All4Gis,项目名称:QGISFMV,代码行数:25,代码来源:QgsFmvPlayer.py

示例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) 
开发者ID:All4Gis,项目名称:QGISFMV,代码行数:22,代码来源:QgsFmv.py

示例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) 
开发者ID:NationalSecurityAgency,项目名称:qgis-kmltools-plugin,代码行数:25,代码来源:kmltools.py

示例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) 
开发者ID:NationalSecurityAgency,项目名称:qgis-bulk-nominatim,代码行数:38,代码来源:bulkNominatim.py

示例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")) 
开发者ID:dts-ait,项目名称:qgis-edge-bundling,代码行数:4,代码来源:edgebundlingProvider.py

示例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')) 
开发者ID:nkarasiak,项目名称:dzetsaka,代码行数:5,代码来源:classify.py

示例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)) 
开发者ID:nkarasiak,项目名称:dzetsaka,代码行数:9,代码来源:dzetsaka_provider.py

示例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') 
开发者ID:NationalSecurityAgency,项目名称:qgis-latlontools-plugin,代码行数:4,代码来源:pluscodes.py

示例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') 
开发者ID:NationalSecurityAgency,项目名称:qgis-latlontools-plugin,代码行数:4,代码来源:mgrstogeom.py

示例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') 
开发者ID:NationalSecurityAgency,项目名称:qgis-latlontools-plugin,代码行数:4,代码来源:field2geom.py

示例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') 
开发者ID:NationalSecurityAgency,项目名称:qgis-latlontools-plugin,代码行数:4,代码来源:geom2field.py

示例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') 
开发者ID:NationalSecurityAgency,项目名称:qgis-latlontools-plugin,代码行数:4,代码来源:tomgrs.py

示例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') 
开发者ID:NationalSecurityAgency,项目名称:qgis-latlontools-plugin,代码行数:4,代码来源:provider.py

示例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()) 
开发者ID:nicolas998,项目名称:WMF,代码行数:7,代码来源:test_resources.py


注:本文中的qgis.PyQt.QtGui.QIcon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。