SMILX  1.01
milxQtConsole.h
1 /*=========================================================================
2  The Software is copyright (c) Commonwealth Scientific and Industrial Research Organisation (CSIRO)
3  ABN 41 687 119 230.
4  All rights reserved.
5 
6  Licensed under the CSIRO BSD 3-Clause License
7  You may not use this file except in compliance with the License.
8  You may obtain a copy of the License in the file LICENSE.md or at
9 
10  https://stash.csiro.au/projects/SMILI/repos/smili/browse/license.txt
11 
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  See the License for the specific language governing permissions and
16  limitations under the License.
17 =========================================================================*/
18 #ifndef MILXQTCONSOLE
19 #define MILXQTCONSOLE
20 
21 #include <QTabWidget>
22 #include <QTextEdit>
23 #include <QDockWidget>
24 #include <QAction>
25 #include <QPointer>
26 //milxQt Specific
27 #include "milxQtAliases.h"
28 
34 class MILXQT_EXPORT milxQtConsole : public QTabWidget
35 {
36  Q_OBJECT
37 
38 public:
40  milxQtConsole(QWidget *theParent = 0);
42  virtual ~milxQtConsole();
43 
44  inline void setTimestamps(const bool timestamp)
45  { timestamps = timestamp; }
46  void setTab(QWidget *newWidget);
48  void consoleMessage(const QString & message);
50  void consoleHTMLMessage(const QString & message);
51 
56  inline QDockWidget* dockWidget()
57  { return dock; }
58  inline Qt::DockWidgetArea dockDefaultArea()
59  { return dockArea; }
60 
61 public slots:
62  inline void setDockDefaultArea(Qt::DockWidgetArea area)
63  { dockArea = area; }
64  //Internal Print Members
69  void printError(QString msg);
74  void printWarning(QString msg);
79  void printDebug(QString msg);
84  void printInfo(QString msg);
89  void consoleWasModified();
94  void consoleSwitched(int index);
95 
96 protected:
97  bool timestamps;
98 
99  QAction *copyAct;
100 // QAction *cutAct; //!< Cut action for text
101 // QAction *pasteAct; //!< Paste action for text
102  QAction *clearAct;
103 
104  QPointer<QTextEdit> logWindow;
105  QPointer<QDockWidget> dock;
106 
107  Qt::DockWidgetArea dockArea;
108 
110  void createActions();
112  void createConnections();
113 
114 private:
115 };
116 
117 #endif // MILXQTCONSOLE
This file defines all the defines, aliases and frequently used functions and variables.
QPointer< QTextEdit > logWindow
Log messages window.
#define MILXQT_EXPORT
Define Windows DLL importing.
Definition: milxQtAliases.h:80
QDockWidget * dockWidget()
Return the dock widget of the current tabs.
Definition: milxQtConsole.h:56
QAction * copyAct
Copy action for text.
Definition: milxQtConsole.h:99
QAction * clearAct
clear action for text
A console (tabbed) widget class for displaying information such as logs, terminals and consoles...
Definition: milxQtConsole.h:34
bool timestamps
Timestamp messages?
Definition: milxQtConsole.h:97
QPointer< QDockWidget > dock
Dock widget.