From 9528eafc3e542144c5b8921fdb243dbec932152c Mon Sep 17 00:00:00 2001 From: asl Date: Mon, 25 Jul 2005 04:23:49 +0000 Subject: [PATCH] new methods: font() and setFont(), allowing to read and change font of python console --- src/PythonConsole/PythonConsole_PyConsole.cxx | 16 ++++++++++++++++ src/PythonConsole/PythonConsole_PyConsole.h | 2 ++ src/PythonConsole/PythonConsole_PyEditor.cxx | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) 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; -- 2.39.2