VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtConsoleLogWidget.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #ifndef DtConsoleLogWidget_H_
11 #define DtConsoleLogWidget_H_
12 
13 #include <vrvCoreQt/DtDockable.h>
14 
15 class QTextEdit;
16 
17 #include <QtCore/QFile>
18 #include <QtWidgets/QWidget>
19 #include <iostream>
20 #include <streambuf>
21 #include <string>
22 #include <sstream>
23 
24 namespace makVrv
25 {
26  //
28  //
31  //
33  //
35  //
38  //
40  //
43  //
45  class DT_DLL_VRVCOREQT QDebugStream : public std::basic_streambuf<char>
46  {
47 
48  public:
49 
50  //
52  //
53  QDebugStream(std::ostream &stream, QTextEdit* pTE);
54 
55  //
57  //
58  QDebugStream(std::ostream &stream, QString& fileName);
59 
60  //
62  //
63  QDebugStream(std::ostream &stream, QTextEdit* pTE, QString& fileName);
64 
65  virtual ~QDebugStream();
66 
67  protected:
68 
69  virtual std::ios::int_type overflow(std::ios::int_type v);
70  virtual std::streamsize xsputn(const char *p, std::streamsize n);
71 
72  private:
73 
74  std::ostream &m_stream;
75  std::streambuf *m_old_buf;
76  std::string m_string;
77  QTextEdit* pLogWindow;
78  QFile logFile;
79 
80  };
81 
85  : public QWidget
86  , public DtDockable
87  {
88 
89  Q_OBJECT;
90 
91  public:
92 
94  DtConsoleLogWidget(DtDe& de, QWidget* parent,
95  Qt::WindowFlags f = Qt::Widget);
96 
98  virtual ~DtConsoleLogWidget();
99 
102  virtual bool initiallyVisible() const;
103 
104  public slots:
105 
111 
112  protected:
113 
115  void setupGui();
116 
117  protected:
118 
119  QTextEdit* myTextEdit;
121  //QDebugStream* myStdErrStream;
123 
124  };
125 }
126 
127 #endif
128 
std::streambuf * m_old_buf
Definition: DtConsoleLogWidget.h:75
QTextEdit * pLogWindow
Definition: DtConsoleLogWidget.h:77
This widget displays the console log.
Definition: DtConsoleLogWidget.h:84
std::string m_string
Definition: DtConsoleLogWidget.h:76
The dockable class provides the docking interface for any class to be a dockable widget in the DtDeMa...
Definition: DtDockable.h:27
std::ostream & m_stream
Definition: DtConsoleLogWidget.h:74
#define DT_DLL_VRVCOREQT
Definition: vrvCoreQt.h:20
QDebugStream * myStdOutStream
Definition: DtConsoleLogWidget.h:120
QDebugStream * myIgLogStream
Definition: DtConsoleLogWidget.h:122
Contains makVrv::DtDockable class.
QFile logFile
Definition: DtConsoleLogWidget.h:78
QTextEdit * myTextEdit
Definition: DtConsoleLogWidget.h:119
This class redirects cout/cerr to the text edit that&#39;s passed in:
Definition: DtConsoleLogWidget.h:45
voidpf stream
Definition: ioapi.h:39
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)