MorphoGraphX  2.0-1-227
Information.hpp
Go to the documentation of this file.
1 //
2 // This file is part of MorphoGraphX - http://www.MorphoGraphX.org
3 // Copyright (C) 2012-2015 Richard S. Smith and collaborators.
4 //
5 // If you use MorphoGraphX in your work, please cite:
6 // http://dx.doi.org/10.7554/eLife.05864
7 //
8 // MorphoGraphX is free software, and is licensed under under the terms of the
9 // GNU General (GPL) Public License version 2.0, http://www.gnu.org/licenses.
10 //
11 #ifndef INFORMATION_HPP
12 #define INFORMATION_HPP
13 
14 #include <Config.hpp>
15 
16 #include <QEvent>
17 #include <QString>
18 #include <QString>
19 #include <QTextStream>
20 
21 class QMainWindow;
22 
23 // RSS: It would be nice to get rid of this macro
24 // processes can use setStatus(QString) instead.
25 #define SETSTATUS(msg) \
26  do { \
27  QString __status_msg; \
28  { \
29  QTextStream __status_msgstrm(&__status_msg); \
30  __status_msgstrm << msg; \
31  } \
32  setStatus(__status_msg); \
33  } while(false)
34 
35 // Convenience macro for debugging
36 #define DebugOut Information::out << __FILE__ << " " << __LINE__ << endl;
37 
38 namespace mgx
39 {
40  mgx_EXPORT extern bool DEBUG;
41 
42  namespace Information
43  {
44  mgx_EXPORT extern QTextStream out;
45  mgx_EXPORT extern QTextStream err;
46 
47  mgx_EXPORT void init(QMainWindow* wnd);
48  mgx_EXPORT void setStatus(const QString& text, bool alsoPrint = true);
49  }
50 }
51 #endif
mgx::Information::err
mgx_EXPORT QTextStream err
mgx::DEBUG
mgx_EXPORT bool DEBUG
mgx::Information::init
mgx_EXPORT void init(QMainWindow *wnd)
mgx
Distributed matrix library.
Definition: Assert.hpp:26
mgx::Information::out
mgx_EXPORT QTextStream out
mgx::Information::setStatus
mgx_EXPORT void setStatus(const QString &text, bool alsoPrint=true)