Python qgis.PyQt.QtGui.QIcon() Examples
The following are 30
code examples of qgis.PyQt.QtGui.QIcon().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
qgis.PyQt.QtGui
, or try the search function
.
Example #1
Source File: QgsUtils.py From QGISFMV with GNU General Public License v3.0 | 6 votes |
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
Example #2
Source File: QgsFmvPlayer.py From QGISFMV with GNU General Public License v3.0 | 6 votes |
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()
Example #3
Source File: QgsFmv.py From QGISFMV with GNU General Public License v3.0 | 6 votes |
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)
Example #4
Source File: kmltools.py From qgis-kmltools-plugin with GNU General Public License v2.0 | 6 votes |
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)
Example #5
Source File: violin.py From DataPlotly with GNU General Public License v2.0 | 5 votes |
def icon(): return QIcon(os.path.join(os.path.dirname(__file__), 'icons/violin.svg'))
Example #6
Source File: geodesicMeasureTool.py From qgis-shapetools-plugin with GNU General Public License v2.0 | 5 votes |
def __init__(self, iface, parent): super(GeodesicMeasureDialog, self).__init__(parent) self.setupUi(self) self.iface = iface self.canvas = iface.mapCanvas() self.pointDigitizerDialog = AddMeasurePointWidget(self, iface, parent) qset = QSettings() self.manualEntryButton.setIcon(QIcon(os.path.dirname(__file__) + "/images/manualpoint.png")) self.manualEntryButton.clicked.connect(self.showManualEntryDialog) self.restoreGeometry(qset.value("ShapeTools/MeasureDialogGeometry", QByteArray(), type=QByteArray)) self.closeButton.clicked.connect(self.closeDialog) self.newButton.clicked.connect(self.newDialog) self.saveToLayerButton.clicked.connect(self.saveToLayer) self.saveToLayerButton.setEnabled(False) self.unitsComboBox.addItems(DISTANCE_LABELS) self.tableWidget.setColumnCount(3) self.tableWidget.setSortingEnabled(False) self.tableWidget.setHorizontalHeaderLabels([tr('Heading To'), tr('Heading From'), tr('Distance')]) self.unitsComboBox.activated.connect(self.unitsChanged) self.capturedPoints = [] self.distances = [] self.activeMeasuring = True self.lastMotionPt = None self.unitsChanged() self.currentDistance = 0.0 self.pointRb = QgsRubberBand(self.canvas, QgsWkbTypes.PointGeometry) self.pointRb.setColor(settings.rubberBandColor) self.pointRb.setIconSize(10) self.lineRb = QgsRubberBand(self.canvas, QgsWkbTypes.LineGeometry) self.lineRb.setColor(settings.rubberBandColor) self.lineRb.setWidth(3) self.tempRb = QgsRubberBand(self.canvas, QgsWkbTypes.LineGeometry) self.tempRb.setColor(settings.rubberBandColor) self.tempRb.setWidth(3)
Example #7
Source File: box.py From DataPlotly with GNU General Public License v2.0 | 5 votes |
def icon(): return QIcon(os.path.join(os.path.dirname(__file__), 'icons/boxplot.svg'))
Example #8
Source File: idlbreakline.py From qgis-shapetools-plugin with GNU General Public License v2.0 | 5 votes |
def icon(self): return QIcon(os.path.dirname(__file__) + '/images/idlbreak.png')
Example #9
Source File: geodesicTransformation.py From qgis-shapetools-plugin with GNU General Public License v2.0 | 5 votes |
def icon(self): return QIcon(os.path.join(os.path.dirname(__file__), 'images/transformShape.png'))
Example #10
Source File: createRose.py From qgis-shapetools-plugin with GNU General Public License v2.0 | 5 votes |
def icon(self): return QIcon(os.path.join(os.path.dirname(__file__), 'images/rose.png'))
Example #11
Source File: createArc.py From qgis-shapetools-plugin with GNU General Public License v2.0 | 5 votes |
def icon(self): return QIcon(os.path.join(os.path.dirname(__file__), 'images/arc.png'))
Example #12
Source File: createLob.py From qgis-shapetools-plugin with GNU General Public License v2.0 | 5 votes |
def icon(self): return QIcon(os.path.join(os.path.dirname(__file__), 'images/line.png'))
Example #13
Source File: geodesicDensify.py From qgis-shapetools-plugin with GNU General Public License v2.0 | 5 votes |
def icon(self): return QIcon(os.path.dirname(__file__) + '/images/geodesicDensifier.png')
Example #14
Source File: bulkNominatim.py From qgis-bulk-nominatim with GNU General Public License v2.0 | 5 votes |
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)
Example #15
Source File: geodesicLayerMeasure.py From qgis-shapetools-plugin with GNU General Public License v2.0 | 5 votes |
def icon(self): return QIcon(os.path.join(os.path.dirname(__file__), 'images/measureLine.png'))
Example #16
Source File: xyToLine.py From qgis-shapetools-plugin with GNU General Public License v2.0 | 5 votes |
def icon(self): return QIcon(os.path.dirname(__file__) + '/images/xyline.png')
Example #17
Source File: bar_plot.py From DataPlotly with GNU General Public License v2.0 | 5 votes |
def icon(): return QIcon(os.path.join(os.path.dirname(__file__), 'icons/barplot.svg'))
Example #18
Source File: histogram.py From DataPlotly with GNU General Public License v2.0 | 5 votes |
def icon(): return QIcon(os.path.join(os.path.dirname(__file__), 'icons/histogram.svg'))
Example #19
Source File: scatter.py From DataPlotly with GNU General Public License v2.0 | 5 votes |
def icon(): return QIcon(os.path.join(os.path.dirname(__file__), 'icons/scatterplot.svg'))
Example #20
Source File: pie.py From DataPlotly with GNU General Public License v2.0 | 5 votes |
def icon(): return QIcon(os.path.join(os.path.dirname(__file__), 'icons/pie.svg'))
Example #21
Source File: test_resources.py From DataPlotly with GNU General Public License v2.0 | 5 votes |
def test_icon_png(self): """Test we can load resources.""" path = ':/plugins/DataPlotly/icon.png' icon = QIcon(path) self.assertFalse(icon.isNull())
Example #22
Source File: gui_utils.py From DataPlotly with GNU General Public License v2.0 | 5 votes |
def get_icon(icon: str) -> QIcon: """ Returns a plugin icon :param icon: icon name (svg file name) :return: QIcon """ path = GuiUtils.get_icon_svg(icon) if not path: return QIcon() return QIcon(path)
Example #23
Source File: project_configuration_dialog.py From qfieldsync with GNU Lesser General Public License v3.0 | 5 votes |
def __init__(self, iface, parent=None): """Constructor.""" super(ProjectConfigurationDialog, self).__init__(parent=parent) self.iface = iface self.accepted.connect(self.onAccepted) self.project = QgsProject.instance() self.__project_configuration = ProjectConfiguration(self.project) self.setupUi(self) self.multipleToggleButton.setIcon(QIcon(os.path.join(os.path.dirname(__file__), '../resources/visibility.svg'))) self.toggle_menu = QMenu(self) self.remove_all_action = QAction(self.tr("remove all layers"), self.toggle_menu) self.toggle_menu.addAction(self.remove_all_action) self.remove_hidden_action = QAction(self.tr("remove hidden layers"), self.toggle_menu) self.toggle_menu.addAction(self.remove_hidden_action) self.add_all_copy_action = QAction(self.tr("add all layers"), self.toggle_menu) self.toggle_menu.addAction(self.add_all_copy_action) self.add_visible_copy_action = QAction(self.tr("add visible layers"), self.toggle_menu) self.toggle_menu.addAction(self.add_visible_copy_action) self.add_all_offline_action = QAction(self.tr("add all vector layers as offline"), self.toggle_menu) self.toggle_menu.addAction(self.add_all_offline_action) self.add_visible_offline_action = QAction(self.tr("add visible vector layers as offline"), self.toggle_menu) self.toggle_menu.addAction(self.add_visible_offline_action) self.multipleToggleButton.setMenu(self.toggle_menu) self.multipleToggleButton.setAutoRaise(True) self.multipleToggleButton.setPopupMode(QToolButton.InstantPopup) self.toggle_menu.triggered.connect(self.toggle_menu_triggered) self.singleLayerRadioButton.toggled.connect(self.baseMapTypeChanged) self.unsupportedLayersList = list() self.reloadProject()
Example #24
Source File: provider.py From qgis-kmltools-plugin with GNU General Public License v2.0 | 5 votes |
def icon(self): return QIcon(os.path.dirname(__file__) + '/icon.png')
Example #25
Source File: htmlExpansionDialog.py From qgis-kmltools-plugin with GNU General Public License v2.0 | 5 votes |
def icon(self): return QIcon(os.path.dirname(__file__) + '/html.png')
Example #26
Source File: importKml.py From qgis-kmltools-plugin with GNU General Public License v2.0 | 5 votes |
def icon(self): return QIcon(os.path.dirname(__file__) + '/icon.png')
Example #27
Source File: QgsFmvPlayer.py From QGISFMV with GNU General Public License v3.0 | 5 votes |
def StopRecordAnimation(self): '''Stop record gif animation''' self.RecGIF.frameChanged.disconnect(self.ReciconUpdate) self.RecGIF.stop() self.btn_Rec.setIcon(QIcon(":/imgFMV/images/record.png"))
Example #28
Source File: QgsFmvPlayer.py From QGISFMV with GNU General Public License v3.0 | 5 votes |
def setVolume(self, volume): '''Tooltip and set Volume value and icon @type volume: qreal @param volume: QSlider value ''' self.player.setVolume(volume) self.showVolumeTip(None) if 0 < volume <= 30: self.btn_volume.setIcon(QIcon(":/imgFMV/images/volume_30.png")) elif 30 < volume <= 60: self.btn_volume.setIcon(QIcon(":/imgFMV/images/volume_60.png")) elif 60 < volume <= 100: self.btn_volume.setIcon(QIcon(":/imgFMV/images/volume_up.png")) elif volume == 0: self.btn_volume.setIcon(QIcon(":/imgFMV/images/volume_off.png"))
Example #29
Source File: QgsFmvPlayer.py From QGISFMV with GNU General Public License v3.0 | 5 votes |
def setMuted(self): ''' Muted video ''' if self.player.isMuted(): self.btn_volume.setIcon(QIcon(":/imgFMV/images/volume_up.png")) self.player.setMuted(False) self.volumeSlider.setEnabled(True) else: self.btn_volume.setIcon(QIcon(":/imgFMV/images/volume_off.png")) self.player.setMuted(True) self.volumeSlider.setEnabled(False) return
Example #30
Source File: QgsFmvPlayer.py From QGISFMV with GNU General Public License v3.0 | 5 votes |
def contextMenuRequested(self, point): ''' Context Menu Video ''' menu = QMenu('Video') # actionColors = menu.addAction( # QCoreApplication.translate("QgsFmvPlayer", "Color Options")) # actionColors.triggered.connect(self.showColorDialog) actionMute = menu.addAction(QIcon(":/imgFMV/images/volume_up.png"), QCoreApplication.translate("QgsFmvPlayer", "Mute/Unmute")) actionMute.triggered.connect(self.setMuted) menu.addSeparator() actionAllFrames = menu.addAction(QIcon(":/imgFMV/images/capture_all_frames.png"), QCoreApplication.translate("QgsFmvPlayer", "Extract All Frames")) actionAllFrames.triggered.connect(self.ExtractAllFrames) actionCurrentFrames = menu.addAction(QIcon(":/imgFMV/images/screenshot.png"), QCoreApplication.translate("QgsFmvPlayer", "Extract Current Frame")) actionCurrentFrames.triggered.connect(self.ExtractCurrentFrame) menu.addSeparator() actionShowMetadata = menu.addAction(QIcon(":/imgFMV/images/show-metadata.png"), QCoreApplication.translate("QgsFmvPlayer", "Show Metadata")) actionShowMetadata.triggered.connect(self.OpenQgsFmvMetadata) menu.addSeparator() actionOptions = menu.addAction(QIcon(":/imgFMV/images/custom-options.png"), QCoreApplication.translate("QgsFmvPlayer", "Options")) actionOptions.triggered.connect(self.OpenOptions) menu.exec_(self.mapToGlobal(point))