fw4spl
t/include/fwGuiQt/dialog/LoggerDialog.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWGUIQT_DIALOG_LOGGERDIALOG_HPP__
8 #define __FWGUIQT_DIALOG_LOGGERDIALOG_HPP__
9 
10 #include "fwGuiQt/config.hpp"
11 
12 #include <fwGui/dialog/ILoggerDialog.hpp>
13 
14 #include <QDialog>
15 #include <QPointer>
16 #include <QTableWidget>
17 
18 #include <vector>
19 
20 namespace fwGuiQt
21 {
22 namespace dialog
23 {
24 //------------------------------------------------------------------------------
25 
29 class FWGUIQT_CLASS_API LoggerDialog : public QDialog,
31 {
32 Q_OBJECT
33 
34 public:
35 
37  (()),
38  ::fwGui::factory::New< LoggerDialog > );
39 
41  FWGUIQT_API LoggerDialog(::fwGui::GuiBaseObject::Key key);
42 
44  FWGUIQT_API virtual ~LoggerDialog();
45 
50  FWGUIQT_API virtual void setTitle(const std::string& title) override;
51 
56  FWGUIQT_API virtual void setMessage(const std::string& message) override;
57 
62  FWGUIQT_API virtual void setLogger(const ::fwLog::Logger::sptr& logger) override;
63 
67  FWGUIQT_API virtual bool show() override;
68 
69 protected Q_SLOTS:
70 
75  void displayLogs(int state);
76 
77 private:
79  std::string m_title;
80 
82  std::string m_message;
83 
85  ::fwLog::Logger::sptr m_logger;
86 
88  QPointer<QDialog> m_dialog;
89 
91  QPointer<QTableWidget> m_logTableWidget;
92 };
93 
94 } // namespace dialog
95 } // namespace fwGuiQt
96 
97 #endif /*__FWGUIQT_DIALOG_LOGGERDIALOG_HPP__*/
ILoggerDialog is used to display a dialog message and a set of logs.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
The namespace fwGuiQt contains classes which provide the implementation of the Gui using Qt library...
Definition: WindowLevel.hpp:32
LoggerDialog allowing the choice of an element among severals (_selections)
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.