VPTissue Reference Manual
LogWindow.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2016 Universiteit Antwerpen
3  *
4  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
5  * the European Commission - subsequent versions of the EUPL (the "Licence");
6  * You may not use this work except in compliance with the Licence.
7  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the Licence is distributed on an "AS IS" basis,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the Licence for the specific language governing
13  * permissions and limitations under the Licence.
14  */
20 #include "LogWindow.h"
21 
22 #include <QPlainTextEdit>
23 #include <sstream>
24 
25 using namespace std;
26 using namespace SimPT_Sim::Util;
27 
28 namespace SimShell {
29 namespace Gui {
30 
31 LogWindow::LogWindow(QWidget* parent)
32  : QDockWidget(parent)
33 {
34  m_log_widget = new QPlainTextEdit(this);
35  m_log_widget->setReadOnly(true);
36  m_log_widget->setMaximumBlockCount(100);
37  m_log_widget->setCenterOnScroll(true);
38  setWindowTitle("Log");
39  setWidget(m_log_widget);
40  show();
41  raise();
42 }
43 
44 LogWindow::~LogWindow()
45 {
46 }
47 
48 void LogWindow::AddLine(const string& line)
49 {
50  m_log_widget->appendPlainText(QString::fromStdString(line));
51 }
52 
53 } // namespace Gui
54 } // namespace SimShell
STL namespace.
Namespace for miscellaneous utilities.
Definition: PTreeFile.cpp:44
Header for LogWindow.
see the online Qt documentation
see the online Qt documentation
Namespace for generic graphical shell for simulators.
Definition: SimSession.h:32