def _setupActions(self): actions = QtGui.QActionGroup(self) # KML export icon = qt4support.geticon('area.svg', 'gsdview') QtGui.QAction(icon, self.tr('KML export'), actions, objectName='kmlExportAction', statusTip=self.tr('KML export'), triggered=self.exportKML) # Open in google earth icon = qt4support.geticon('earth.svg', __name__) QtGui.QAction(icon, self.tr('Open in Google Earth'), actions, objectName='openInGoogleEarthAction', statusTip=self.tr('Open in Google Earth'), triggered=self.openInGoogleEarth) # Open in google maps icon = qt4support.geticon('overview.svg', 'gsdview.gdalbackend') QtGui.QAction(icon, self.tr('Open in Google Maps'), actions, objectName='openInGoogleMapsAction', statusTip=self.tr('Open in Google Maps'), triggered=self.openInGoogleMaps) return actions
def _setupActions(self): actions = QtGui.QActionGroup(self) # Zoom in icon = qt4support.geticon("zoom-in.svg", "gsdview") QtGui.QAction( icon, self.tr("Zoom In"), actions, objectName="zoomOutAction", statusTip=self.tr("Zoom In"), shortcut=QtGui.QKeySequence(self.tr("Ctrl++")), enabled=False, triggered=lambda: self._zoom(+1), ) # Zoom out icon = qt4support.geticon("zoom-out.svg", "gsdview") QtGui.QAction( icon, self.tr("Zoom Out"), actions, objectName="zoomOutAction", statusTip=self.tr("Zoom Out"), shortcut=QtGui.QKeySequence(self.tr("Ctrl+-")), enabled=False, triggered=lambda: self._zoom(-1), ) return actions
def _setupAction(self): icon = qt4support.geticon('stretching.svg', __name__) action = QtGui.QAction(icon, self.tr('Stretch'), self, objectName='stretchAction', statusTip=self.tr('Stretch'), checkable=True, triggered=self.onButtonToggled) return action
def _setupActions(self): actions = QtGui.QActionGroup(self) # Zoom in icon = qt4support.geticon('zoom-in.svg', 'gsdview') QtGui.QAction(icon, self.tr('Zoom In'), actions, objectName='zoomInAction', statusTip=self.tr('Zoom In'), shortcut=QtGui.QKeySequence(self.tr('Ctrl++')), triggered=self.zoomIn) # Zoom out icon = qt4support.geticon('zoom-out.svg', 'gsdview') QtGui.QAction(icon, self.tr('Zoom Out'), actions, objectName='zoomOutAction', statusTip=self.tr('Zoom Out'), shortcut=QtGui.QKeySequence(self.tr('Ctrl+-')), triggered=self.zoomOut) # Zoom fit icon = qt4support.geticon('zoom-fit.svg', 'gsdview') QtGui.QAction(icon, self.tr('Zoom Fit'), actions, objectName='zoomFitAction', statusTip=self.tr('Zoom to fit the window size'), triggered=self.zoomFit) # Zoom 100 icon = qt4support.geticon('zoom-100.svg', 'gsdview') QtGui.QAction(icon, self.tr('Zoom 100%'), actions, objectName='zoom100Action', statusTip=self.tr('Original size'), triggered=self.zoom100) # Manual Zoom #icon = QtGui.QIcon() #qt4support.geticon('zoom-100.svg', 'gsdview') #QtGui.QWidgetAction(icon, self.tr('Zoom 100%'), actions, # statusTip=self.tr('Original size'), # triggered=self.zoom100) return actions
def _setupActions(self): actions = QtGui.QActionGroup(self) # Zoom in icon = qt4support.geticon('zoom-in.svg', 'gsdview') QtGui.QAction(icon, self.tr('Zoom In'), actions, objectName='zoomOutAction', statusTip=self.tr('Zoom In'), shortcut=QtGui.QKeySequence(self.tr('Ctrl++')), enabled=False, triggered=lambda: self._zoom(+1)) # Zoom out icon = qt4support.geticon('zoom-out.svg', 'gsdview') QtGui.QAction(icon, self.tr('Zoom Out'), actions, objectName='zoomOutAction', statusTip=self.tr('Zoom Out'), shortcut=QtGui.QKeySequence(self.tr('Ctrl+-')), enabled=False, triggered=lambda: self._zoom(-1)) return actions
def createActions(self): style = QtGui.QApplication.style() icon = style.standardIcon(style.SP_FileIcon) self.newAct = QtGui.QAction(icon, self.tr('&New'), self, shortcut=self.tr('Ctrl+N'), statusTip=self.tr('Create a new file'), triggered=self.newFile) icon = style.standardIcon(style.SP_DialogOpenButton) self.openAct = QtGui.QAction(icon, self.tr('&Open...'), self, shortcut=self.tr('Ctrl+O'), statusTip=self.tr('Open an existing ' 'file'), triggered=self.open) icon = style.standardIcon(style.SP_DialogSaveButton) self.saveAct = QtGui.QAction(icon, self.tr('&Save'), self, shortcut=self.tr('Ctrl+S'), statusTip=self.tr('Save the document to ' 'disk'), triggered=self.save) self.saveAsAct = QtGui.QAction(self.tr('Save &As...'), self, statusTip=self.tr('Save the document ' 'under a new name'), triggered=self.saveAs) self.exitAct = QtGui.QAction(self.tr('E&xit'), self, shortcut=self.tr('Ctrl+Q'), statusTip=self.tr('Exit the application'), triggered=self.close) icon = geticon('cut.svg', 'gsdview') self.cutAct = QtGui.QAction(icon, self.tr('Cu&t'), self, shortcut=self.tr('Ctrl+X'), statusTip=self.tr("Cut the current " "selection's contents " "to the clipboard"), triggered=self.cut) icon = geticon('copy.svg', 'gsdview.gdalbackend') self.copyAct = QtGui.QAction(icon, self.tr('&Copy'), self, shortcut=self.tr("Ctrl+C"), statusTip=self.tr("Copy the current " "selection's contents " "to the clipboard"), triggered=self.copy) icon = geticon('paste.svg', 'gsdview') self.pasteAct = QtGui.QAction(icon, self.tr('&Paste'), self, shortcut=self.tr("Ctrl+V"), statusTip=self.tr("Paste the " "clipboard's contents " "into the current " "selection"), triggered=self.paste) self.aboutAct = QtGui.QAction(self.tr('&About'), self, statusTip=self.tr("Show the " "application's About " "box"), triggered=self.about) self.aboutQtAct = QtGui.QAction(self.tr('About &Qt'), self, statusTip=self.tr("Show the Qt " "library's About " "box"), triggered=QtGui.QApplication.aboutQt)
def createActions(self): style = QtGui.QApplication.style() icon = style.standardIcon(style.SP_FileIcon) self.newAct = QtGui.QAction( icon, self.tr("&New"), self, shortcut=self.tr("Ctrl+N"), statusTip=self.tr("Create a new file"), triggered=self.newFile, ) icon = style.standardIcon(style.SP_DialogOpenButton) self.openAct = QtGui.QAction( icon, self.tr("&Open..."), self, shortcut=self.tr("Ctrl+O"), statusTip=self.tr("Open an existing " "file"), triggered=self.open, ) icon = style.standardIcon(style.SP_DialogSaveButton) self.saveAct = QtGui.QAction( icon, self.tr("&Save"), self, shortcut=self.tr("Ctrl+S"), statusTip=self.tr("Save the document to " "disk"), triggered=self.save, ) self.saveAsAct = QtGui.QAction( self.tr("Save &As..."), self, statusTip=self.tr("Save the document " "under a new name"), triggered=self.saveAs, ) self.exitAct = QtGui.QAction( self.tr("E&xit"), self, shortcut=self.tr("Ctrl+Q"), statusTip=self.tr("Exit the application"), triggered=self.close, ) icon = geticon("cut.svg", "gsdview") self.cutAct = QtGui.QAction( icon, self.tr("Cu&t"), self, shortcut=self.tr("Ctrl+X"), statusTip=self.tr("Cut the current " "selection's contents " "to the clipboard"), triggered=self.cut, ) icon = geticon("copy.svg", "gsdview.gdalbackend") self.copyAct = QtGui.QAction( icon, self.tr("&Copy"), self, shortcut=self.tr("Ctrl+C"), statusTip=self.tr("Copy the current " "selection's contents " "to the clipboard"), triggered=self.copy, ) icon = geticon("paste.svg", "gsdview") self.pasteAct = QtGui.QAction( icon, self.tr("&Paste"), self, shortcut=self.tr("Ctrl+V"), statusTip=self.tr("Paste the " "clipboard's contents " "into the current " "selection"), triggered=self.paste, ) self.aboutAct = QtGui.QAction( self.tr("&About"), self, statusTip=self.tr("Show the " "application's About " "box"), triggered=self.about ) self.aboutQtAct = QtGui.QAction( self.tr("About &Qt"), self, statusTip=self.tr("Show the Qt " "library's About " "box"), triggered=QtGui.QApplication.aboutQt, )