00001 #include "basewidget.h" 00002 #include "config.h" 00003 #include <QTextEdit> 00004 #include <QLineEdit> 00005 #include <QProcess> 00006 #include <QTime> 00007 #include <QTimer> 00008 #include <QCheckBox> 00009 00010 /** 00011 * If you write a command in Terminal's command line, DynamicHelp shows help of commands. 00012 */ 00013 class Dynamic_help :public BaseWidget 00014 { 00015 Q_OBJECT 00016 public: 00017 Dynamic_help(QWidget *parent=0); 00018 ~Dynamic_help(); 00019 /** Sets QLineEdit from keyboard signals are listen. 00020 */ 00021 void setLineEdit(QLineEdit *lineedit); 00022 private: 00023 QTextEdit *textEdit; 00024 QCheckBox *stop_help; 00025 QProcess *octave; 00026 QTime time; 00027 QTimer timer; 00028 QString input_text; 00029 public slots: 00030 /** 00031 * Shows help when of text. 00032 * @param text Text from QLineEdit. 00033 */ 00034 void textChanged ( const QString & text ); 00035 /** Reads and shows Octave output. 00036 */ 00037 void readyReadStandardOutput (); 00038 /** Updates shown help when QLineEdit changes happend. 00039 */ 00040 void update(); 00041 }; 00042