mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
Add support for prepared API file
- Prepared API file supports Python 2.7, PyQGIS master, PyQt4.7.4, QScintilla2 2.4.5, osgeo 1.9.1 - Set point size larger (should be setting in app) - Remove extra spacing between toolbar and console edit widget - Remove space from Qt object name - With many more API lines, autocompletion should start at least on second character, if not third
This commit is contained in:
parent
02b687321a
commit
9db9ef80c6
BIN
python/api/pyqgis_master.pap
Normal file
BIN
python/api/pyqgis_master.pap
Normal file
Binary file not shown.
@ -69,7 +69,7 @@ sys.stdout = QgisOutputCatcher()
|
|||||||
class PythonConsole(QDockWidget):
|
class PythonConsole(QDockWidget):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
QDockWidget.__init__(self, parent)
|
QDockWidget.__init__(self, parent)
|
||||||
self.setObjectName("Python Console")
|
self.setObjectName("PythonConsole")
|
||||||
#self.setAllowedAreas(Qt.BottomDockWidgetArea)
|
#self.setAllowedAreas(Qt.BottomDockWidgetArea)
|
||||||
|
|
||||||
self.widgetButton = QWidget()
|
self.widgetButton = QWidget()
|
||||||
@ -93,6 +93,7 @@ class PythonConsole(QDockWidget):
|
|||||||
self.e = QHBoxLayout(self.widgetEdit)
|
self.e = QHBoxLayout(self.widgetEdit)
|
||||||
|
|
||||||
self.e.setMargin(0)
|
self.e.setMargin(0)
|
||||||
|
self.e.setSpacing(0)
|
||||||
self.b.setMargin(0)
|
self.b.setMargin(0)
|
||||||
|
|
||||||
## Action for Clear button
|
## Action for Clear button
|
||||||
|
@ -88,7 +88,7 @@ class PythonEdit(QsciScintilla, code.InteractiveInterpreter):
|
|||||||
#self.setBackspaceUnindents(True)
|
#self.setBackspaceUnindents(True)
|
||||||
#self.setTabWidth(4)
|
#self.setTabWidth(4)
|
||||||
|
|
||||||
self.setAutoCompletionThreshold(1)
|
self.setAutoCompletionThreshold(2)
|
||||||
self.setAutoCompletionSource(self.AcsAPIs)
|
self.setAutoCompletionSource(self.AcsAPIs)
|
||||||
|
|
||||||
# Don't want to see the horizontal scrollbar at all
|
# Don't want to see the horizontal scrollbar at all
|
||||||
@ -147,7 +147,7 @@ class PythonEdit(QsciScintilla, code.InteractiveInterpreter):
|
|||||||
font = QFont()
|
font = QFont()
|
||||||
font.setFamily('Courier New') ## Courier New
|
font.setFamily('Courier New') ## Courier New
|
||||||
font.setFixedPitch(True)
|
font.setFixedPitch(True)
|
||||||
font.setPointSize(10)
|
font.setPointSize(13)
|
||||||
self.setFont(font)
|
self.setFont(font)
|
||||||
self.setMarginsFont(font)
|
self.setMarginsFont(font)
|
||||||
self.lexer = QsciLexerPython()
|
self.lexer = QsciLexerPython()
|
||||||
@ -161,15 +161,16 @@ class PythonEdit(QsciScintilla, code.InteractiveInterpreter):
|
|||||||
self.lexer.setFont(font, 3)
|
self.lexer.setFont(font, 3)
|
||||||
self.lexer.setFont(font, 4)
|
self.lexer.setFont(font, 4)
|
||||||
self.api = QsciAPIs(self.lexer)
|
self.api = QsciAPIs(self.lexer)
|
||||||
self.api.load(os.path.dirname(__file__) + "/api/PyQGIS_1.8.api")
|
self.api.loadPrepared(QString(os.path.dirname(__file__) + "/api/pyqgis_master.pap"))
|
||||||
self.api.load(os.path.dirname(__file__) + "/api/osgeo_gdal-ogr_1.9.1-1.api")
|
# self.api.load(os.path.dirname(__file__) + "/api/PyQGIS_1.8.api")
|
||||||
|
# self.api.load(os.path.dirname(__file__) + "/api/osgeo_gdal-ogr_1.9.1-1.api")
|
||||||
# self.api.load("qgis.networkanalysis.api")
|
# self.api.load("qgis.networkanalysis.api")
|
||||||
# self.api.load("qgis.gui.api")
|
# self.api.load("qgis.gui.api")
|
||||||
# self.api.load("qgis.core.api")
|
# self.api.load("qgis.core.api")
|
||||||
# self.api.load("qgis.analysis.api")
|
# self.api.load("qgis.analysis.api")
|
||||||
|
|
||||||
self.api.prepare()
|
# self.api.prepare()
|
||||||
self.lexer.setAPIs(self.api)
|
# self.lexer.setAPIs(self.api)
|
||||||
self.setLexer(self.lexer)
|
self.setLexer(self.lexer)
|
||||||
|
|
||||||
## TODO: show completion list for file and directory
|
## TODO: show completion list for file and directory
|
||||||
|
Loading…
x
Reference in New Issue
Block a user