Just a quick one to show how to assign shortcuts to hide and show for panels in QGIS. Add this to your .qgis2\python\startup.py
from functools import partial from qgis.utils import iface from PyQt4.QtCore import * from PyQt4.QtGui import * mappings = {"Layers": Qt.ALT + Qt.Key_1, "Browser": Qt.ALT + Qt.Key_2, "PythonConsole": Qt.ALT + Qt.Key_3} shortcuts = [] def activated(dock): dock = iface.mainWindow().findChild(QDockWidget, dock) visible = dock.isVisible() dock.setVisible(not visible) def bind(): for dock, keys in mappings.iteritems(): short = QShortcut(QKeySequence(keys), iface.mainWindow()) short.setContext(Qt.ApplicationShortcut) short.activated.connect(partial(activated, dock)) shortcuts.append(short) bind()
and now you can hide and show using ALT + number
Filed under: Open Source
from Planet GS via John Jason Fallows in Inoreader http://ift.tt/1ARLQ3X
Nathan
More Stories
‘My 401k Misses You’: Black Woman Pumped To Meet Donald Trump In Philadelphia – July 18, 2023 at 04:56PM
Energy Provider Warns of Impending ‘Crisis,’ ‘Blackout Conditions’ Driven By Biden Plans – July 18, 2023 at 04:20PM
Dog starts barking at cows crossing a bridge, so the cows stop to have a look. – July 17, 2023 at 02:27PM