summaryrefslogtreecommitdiff
path: root/client/widgets/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/widgets/main.cc')
-rw-r--r--client/widgets/main.cc42
1 files changed, 42 insertions, 0 deletions
diff --git a/client/widgets/main.cc b/client/widgets/main.cc
new file mode 100644
index 0000000..fc4603d
--- /dev/null
+++ b/client/widgets/main.cc
@@ -0,0 +1,42 @@
+#include "widget.h"
+#include "label.h"
+#include "lineedit.h"
+#include "pushbutton.h"
+#include <QApplication>
+#include <QVBoxLayout>
+#include <vector>
+
+std::vector< Widget* > widgets;
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QWidget widget;
+ QVBoxLayout *layout = new QVBoxLayout();
+
+ Label *label = new Label(&widget, "Test label:", "center");
+ LineEdit *lineedit = new LineEdit(&widget, "[0-9]+");
+ widgets.push_back(lineedit);
+ LineEdit *lineedit2 = new LineEdit(&widget, "[0-9]+");
+ widgets.push_back(lineedit2);
+ PushButton *pushbutton = new PushButton(&widget, "Commit", "committer");
+ widgets.push_back(pushbutton);
+
+ layout->addWidget(label);
+ layout->addWidget(lineedit);
+ layout->addWidget(lineedit2);
+ layout->addWidget(pushbutton);
+
+ widget.setLayout(layout);
+ widget.show();
+
+ app.exec();
+
+ std::vector< Widget* >::iterator i=widgets.begin();
+ while (i != widgets.end()) {
+ Widget* w = *i;
+ printf("%s = %s\n", w->getName().toStdString().c_str(), w->getValue().toStdString().c_str());
+ i++;
+ }
+}