Quark  0.1
InputDialogBuilder.h++
Go to the documentation of this file.
1 #ifndef __libquark_gui_InputDialogBuilder_hxx
2 #define __libquark_gui_InputDialogBuilder_hxx
3 
4 #include <QInputDialog>
5 
7 
8 namespace quark {
9 namespace gui {
10 
17 {
18  public:
19 
25  InputDialogBuilder(QWidget *parent, const QString &message);
26 
28  virtual ~InputDialogBuilder();
29 
31  InputDialogBuilder& setFeature(const QString &feature);
32 
34  InputDialogBuilder& setDefaultInput(const QString &input);
35 
43  InputDialogBuilder& setSlot(QObject *target, const char *slot);
44 
52  InputDialogBuilder& setSlot(const char *slot)
53  { return(setSlot(NULL, slot)); }
54 
64  template<typename T>
66  {
67  closure()->addSlotArg(QVariant::fromValue(arg));
68  return(*this);
69  }
70 
71  private:
72 
73  QInputDialog *_dialog;
74 
75  Q_DISABLE_COPY(InputDialogBuilder);
76 };
77 
78 } // namespace gui
79 } // namespace quark
80 
81 #endif // __libquark_gui_InputDialogBuilder_hxx
A builder object for constructing simple input dialogs.
Definition: InputDialogBuilder.h++:16
Definition: BarChartView.h++:6
InputDialogBuilder & addSlotArg(const T &arg)
Adds an argument to be passed to the slot when the dialog is accepted.
Definition: InputDialogBuilder.h++:65
An abstract base class for dialog builders.
Definition: DialogBuilder.h++:23
InputDialogBuilder & setSlot(const char *slot)
Specifies a slot of the dialog&#39;s parent widget to be invoked when the dialog is accepted.
Definition: InputDialogBuilder.h++:52
#define LIBQUARK_API
Definition: Quark.h++:18