From: asl Date: Mon, 25 Jul 2005 04:23:49 +0000 (+0000) Subject: new methods: font() and setFont(), allowing to read and change font of python console X-Git-Tag: V3_0_1~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9528eafc3e542144c5b8921fdb243dbec932152c;p=modules%2Fgui.git new methods: font() and setFont(), allowing to read and change font of python console --- diff --git a/src/PythonConsole/PythonConsole_PyConsole.cxx b/src/PythonConsole/PythonConsole_PyConsole.cxx index fed5b9bd4..95609f31d 100755 --- a/src/PythonConsole/PythonConsole_PyConsole.cxx +++ b/src/PythonConsole/PythonConsole_PyConsole.cxx @@ -37,3 +37,19 @@ void PythonConsole::exec( const QString& command ) if ( myEditor ) myEditor->exec( command ); } + +//**************************************************************** +void PythonConsole::setFont( const QFont& f ) +{ + if( myEditor ) + myEditor->setFont( f ); +} + +//**************************************************************** +QFont PythonConsole::font() const +{ + QFont res; + if( myEditor ) + res = myEditor->font(); + return res; +} diff --git a/src/PythonConsole/PythonConsole_PyConsole.h b/src/PythonConsole/PythonConsole_PyConsole.h index 77add6018..588ceeede 100755 --- a/src/PythonConsole/PythonConsole_PyConsole.h +++ b/src/PythonConsole/PythonConsole_PyConsole.h @@ -17,6 +17,8 @@ public: virtual ~PythonConsole(); PyInterp_base* getInterp() { return myInterp; } + QFont font() const; + virtual void setFont( const QFont& ); void exec( const QString& command ); diff --git a/src/PythonConsole/PythonConsole_PyEditor.cxx b/src/PythonConsole/PythonConsole_PyEditor.cxx index 9ffed0f03..73b9c7904 100755 --- a/src/PythonConsole/PythonConsole_PyEditor.cxx +++ b/src/PythonConsole/PythonConsole_PyEditor.cxx @@ -103,7 +103,7 @@ PythonConsole_PyEditor::PythonConsole_PyEditor(PyInterp_base* theInterp, QWidget QString fntSet( "" ); QFont aFont = SUIT_Tools::stringToFont( fntSet ); setFont(aFont); - setTextFormat(QTextEdit::PlainText); + //setTextFormat(QTextEdit::PlainText); setUndoRedoEnabled( false ); _currentPrompt = READY_PROMPT;