def show_console(): """ called from QGIS to open the console """ global _console if _console is None: parent = iface.mainWindow() if iface else None _console = PythonConsole(parent) _console.show() # force show even if it was restored as hidden # set focus to the console so the user can start typing # defer the set focus event so it works also whether the console not visible yet QTimer.singleShot(0, _console.activate) else: _console.setVisible(not _console.isVisible()) # set focus to the console so the user can start typing if _console.isVisible(): _console.activate() # Shows help on first launch of the console settings = QgsSettings() if settings.value('pythonConsole/contextHelpOnFirstLaunch', True, type=bool): QgsContextHelp.run("PythonConsole") settings.setValue('pythonConsole/contextHelpOnFirstLaunch', False) return _console
def show_console(): """ called from QGIS to open the console """ global _console if _console is None: parent = iface.mainWindow() if iface else None _console = PythonConsole(parent) _console.show() # force show even if it was restored as hidden # set focus to the console so the user can start typing # defer the set focus event so it works also whether the console not visible yet QTimer.singleShot(0, _console.activate) else: _console.setVisible(not _console.isVisible()) # set focus to the console so the user can start typing if _console.isVisible(): _console.activate() ## Shows help on first launch of the console settings = QSettings() if settings.value('pythonConsole/contextHelpOnFirstLaunch', True, type=bool): QgsContextHelp.run("PythonConsole") settings.setValue('pythonConsole/contextHelpOnFirstLaunch', False)
def openHelp(self): QgsContextHelp.run("PythonConsole")
def runHelp(self): """ open the context help browser """ QgsContextHelp.run("QgsPluginInstallerDialog")