6 """ |
6 """ |
7 Module implementing a compatability interface class to QsciScintilla. |
7 Module implementing a compatability interface class to QsciScintilla. |
8 """ |
8 """ |
9 |
9 |
10 from PyQt4.QtCore import Qt |
10 from PyQt4.QtCore import Qt |
11 from PyQt4.QtGui import QApplication, QPalette, QColor |
11 from PyQt4.QtGui import QPalette, QColor |
12 from PyQt4.Qsci import QsciScintilla, \ |
12 from PyQt4.Qsci import QsciScintilla, \ |
13 QSCINTILLA_VERSION as QsciQSCINTILLA_VERSION, QSCINTILLA_VERSION_STR, \ |
13 QSCINTILLA_VERSION as QsciQSCINTILLA_VERSION, QSCINTILLA_VERSION_STR, \ |
14 QsciScintillaBase |
14 QsciScintillaBase |
15 |
15 |
|
16 from E5Gui.E5Application import E5Application |
16 |
17 |
17 ############################################################################### |
18 ############################################################################### |
|
19 |
18 |
20 |
19 def QSCINTILLA_VERSION(): |
21 def QSCINTILLA_VERSION(): |
20 """ |
22 """ |
21 Module function to return the QScintilla version. |
23 Module function to return the QScintilla version. |
22 |
24 |
76 |
78 |
77 def clearStyles(self): |
79 def clearStyles(self): |
78 """ |
80 """ |
79 Public method to set the styles according the selected Qt style. |
81 Public method to set the styles according the selected Qt style. |
80 """ |
82 """ |
81 palette = QApplication.palette() |
83 palette = E5Application.palette() |
82 self.SendScintilla(QsciScintilla.SCI_STYLESETFORE, |
84 self.SendScintilla(QsciScintilla.SCI_STYLESETFORE, |
83 QsciScintilla.STYLE_DEFAULT, palette.color(QPalette.Text)) |
85 QsciScintilla.STYLE_DEFAULT, palette.color(QPalette.Text)) |
84 self.SendScintilla(QsciScintilla.SCI_STYLESETBACK, |
86 self.SendScintilla(QsciScintilla.SCI_STYLESETBACK, |
85 QsciScintilla.STYLE_DEFAULT, palette.color(QPalette.Base)) |
87 QsciScintilla.STYLE_DEFAULT, palette.color(QPalette.Base)) |
86 self.SendScintilla(QsciScintilla.SCI_STYLECLEARALL) |
88 self.SendScintilla(QsciScintilla.SCI_STYLECLEARALL) |