In version 1.8 app module not available---QGIS 3
Opened this issue · 4 comments
When the console starts the message states:
You have access to canvas, iface, app (QGIS application) objects
This is true for canvas and iface, entering app gives:
----> 1 app
NameError: name 'app' is not defined
You are right, not sure why I commented that out ... https://github.com/elpaso/qgis-ipythonconsole/blob/master/IPyConsole.py#L271
Would you mind trying to re-enable it and see what happens?
Also uncomment https://github.com/elpaso/qgis-ipythonconsole/blob/master/IPyConsole.py#L256
But I suspect that there was an issue with QGIS3 and Qt5....
I uncommented those and when typing app. and TAB, lots of these show up in the Qt log message panel:
2017-11-08T07:31:38 WARNING QCoreApplication::exec: The event loop is already running
2017-11-08T07:31:38 WARNING QCoreApplication::exec: The event loop is already running
2017-11-08T07:31:39 WARNING QCoreApplication::exec: The event loop is already running
2017-11-08T07:31:39 WARNING QCoreApplication::exec: The event loop is already running
Completion doesn't work and app is not a QgsApplication but rather:
In [9]: type(app)
Out[9]: PyQt5.QtWidgets.QApplication
Adding:
self.app = QgsApplication
in init and adding
'app': self.app,
in the kernel.shell.push call seems to work.