當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。