![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2008 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtConsoleLogWidget.h,v $ $Revision: 1.10 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00012 00013 #ifndef DtConsoleLogWidget_H_ 00014 #define DtConsoleLogWidget_H_ 00015 00016 #include <vrvCoreQt/vrvCoreQt.h> 00017 #include <vrvCoreQt/DtDockable.h> 00018 00019 class QTextEdit; 00020 00021 #include <QtCore/QFile> 00022 #include <QtGui/QWidget> 00023 #include <iostream> 00024 #include <streambuf> 00025 #include <string> 00026 #include <sstream> 00027 00028 namespace makVrv 00029 { 00030 // 00032 // 00035 // 00037 // 00039 // 00042 // 00044 // 00047 // 00049 class DT_DLL_VRVCOREQT QDebugStream : public std::basic_streambuf<char> 00050 { 00051 00052 public: 00053 00054 // 00056 // 00057 QDebugStream(std::ostream &stream, QTextEdit* pTE); 00058 00059 // 00061 // 00062 QDebugStream(std::ostream &stream, QString& fileName); 00063 00064 // 00066 // 00067 QDebugStream(std::ostream &stream, QTextEdit* pTE, QString& fileName); 00068 00069 ~QDebugStream(); 00070 00071 protected: 00072 00073 virtual std::ios::int_type overflow(std::ios::int_type v); 00074 virtual std::streamsize xsputn(const char *p, std::streamsize n); 00075 00076 private: 00077 00078 std::ostream &m_stream; 00079 std::streambuf *m_old_buf; 00080 std::string m_string; 00081 QTextEdit* pLogWindow; 00082 QFile logFile; 00083 00084 }; 00085 00088 class DT_DLL_VRVCOREQT DtConsoleLogWidget 00089 : public QWidget 00090 , public DtDockable 00091 { 00092 00093 Q_OBJECT; 00094 00095 public: 00096 00098 DtConsoleLogWidget(DtDe& de, QWidget* parent, 00099 Qt::WindowFlags f = Qt::Widget); 00100 00102 virtual ~DtConsoleLogWidget(); 00103 00106 virtual bool initiallyVisible() const; 00107 00108 public slots: 00109 00115 00116 protected: 00117 00119 void setupGui(); 00120 00121 protected: 00122 00123 QTextEdit* myTextEdit; 00124 QDebugStream* myStdOutStream; 00125 //QDebugStream* myStdErrStream; 00126 QDebugStream* myIgLogStream; 00127 00128 DtDe& myDe; 00129 00130 }; 00131 } 00132 00133 #endif 00134