fw4spl
t/include/fwGuiQt/dialog/SelectorDialog.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
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 #pragma once
8 
9 #include "fwGuiQt/config.hpp"
10 
11 #include <fwGui/dialog/ISelectorDialog.hpp>
12 
13 #include <QPushButton>
14 #include <QVector>
15 
16 #include <vector>
17 
18 namespace fwGuiQt
19 {
20 namespace dialog
21 {
22 //------------------------------------------------------------------------------
23 
27 class FWGUIQT_CLASS_API SelectorDialog : public ::fwGui::dialog::ISelectorDialog
28 {
29 public:
30 
32  (()),
33  ::fwGui::factory::New< SelectorDialog > );
34 
35  FWGUIQT_API SelectorDialog(::fwGui::GuiBaseObject::Key key);
36 
37  FWGUIQT_API virtual ~SelectorDialog();
38 
42  FWGUIQT_API virtual void setSelections(std::vector< std::string > _selections) override;
43 
47  FWGUIQT_API virtual void setTitle(std::string _title) override;
48 
52  FWGUIQT_API virtual std::string show() override;
53 
55  FWGUIQT_API virtual void setMessage(const std::string& msg) override;
56 
58  FWGUIQT_API virtual void addCustomButton(const std::string& label, std::function<void()> clickedFn) override;
59 
60 private:
61 
62  std::vector< std::string > m_selections;
63 
65  std::string m_message;
66  std::string m_title;
67 
69  QVector< QPushButton* > m_customButtons;
70 };
71 
72 } // namespace dialog
73 } // namespace fwGuiQt
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
ISelectorDialog allows the choice of an element among several (_selections)
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
SelectorDialog allowing the choice of an element among severals (_selections)