]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
new methods: font() and setFont(), allowing to read and change font of python console
authorasl <asl@opencascade.com>
Mon, 25 Jul 2005 04:23:49 +0000 (04:23 +0000)
committerasl <asl@opencascade.com>
Mon, 25 Jul 2005 04:23:49 +0000 (04:23 +0000)
src/PythonConsole/PythonConsole_PyConsole.cxx
src/PythonConsole/PythonConsole_PyConsole.h
src/PythonConsole/PythonConsole_PyEditor.cxx

index fed5b9bd47ca71d58f166147ab8e511c554dcd68..95609f31d875db49e5bffe59c3ad5cf13cc9c2ec 100755 (executable)
@@ -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;
+}
index 77add60186882954f6488ba11512576921ab5639..588ceeedeec6b4b0df0dc4206b03fb58a7020330 100755 (executable)
@@ -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 );
 
index 9ffed0f034d41af5ab70c37bee770b3190ad7f5a..73b9c7904d2592a89fad329c6c124afaf3cae956 100755 (executable)
@@ -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;