support for creating GUI via QtCreator added
authorkorrco <korrco@localhost>
Thu, 7 Jan 2010 16:07:29 +0000 (16:07 +0000)
committerkorrco <korrco@localhost>
Thu, 7 Jan 2010 16:07:29 +0000 (16:07 +0000)
src/gui/gui.pro
src/gui/mainwindow.cpp
src/gui/mainwindow.h
src/gui/mainwindow.ui [new file with mode: 0644]

index f8f6988..976ec68 100644 (file)
@@ -15,6 +15,7 @@ TARGETDEPS += $$DESTDIR/liborm.a $$DESTDIR/libmodel.a
 # Please note that resources MUST be added to the app module
 # (which means they need to be added to the test module as well,
 # but I am sure you can live with that for the time being).
+FORMS += mainwindow.ui
 SOURCES += mainwindow.cpp
 HEADERS += mainwindow.h
 
index e0f20d4..bf48d91 100644 (file)
@@ -1,6 +1,7 @@
 #include "mainwindow.h"
 
 #include <QTreeView>
+#include <QDirModel>
 
 #include <eventmodel.h>
 
@@ -12,8 +13,8 @@ MainWindow::MainWindow(QWidget *parent)
     db.setDatabaseName("fosdem-test.sqlite");
     db.open();
 
-    QTreeView * view = new QTreeView(parent);
-    this->setCentralWidget(view);
-
-    view->setModel(new EventModel());
+    setupUi(this);
+    //TODO Palo: continue
+    //treeView->setModel(new QDirModel);
+    treeView->setModel(new EventModel());
 }
index 94aa77a..1828fd3 100644 (file)
@@ -3,7 +3,9 @@
 
 #include <QtGui/QMainWindow>
 
-class MainWindow : public QMainWindow
+#include <ui_mainwindow.h>
+
+class MainWindow : public QMainWindow, private Ui::MainWindow
 {
     Q_OBJECT
 
diff --git a/src/gui/mainwindow.ui b/src/gui/mainwindow.ui
new file mode 100644 (file)
index 0000000..bdce5c7
--- /dev/null
@@ -0,0 +1,64 @@
+<ui version="4.0" >
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>600</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>MainWindow</string>
+  </property>
+  <widget class="QWidget" name="centralwidget" >
+   <widget class="QTabWidget" name="tabWidget" >
+    <property name="geometry" >
+     <rect>
+      <x>0</x>
+      <y>0</y>
+      <width>791</width>
+      <height>551</height>
+     </rect>
+    </property>
+    <property name="currentIndex" >
+     <number>0</number>
+    </property>
+    <widget class="QWidget" name="tab" >
+     <attribute name="title" >
+      <string>Tab 1</string>
+     </attribute>
+     <widget class="QTreeView" name="treeView" >
+      <property name="geometry" >
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>781</width>
+        <height>521</height>
+       </rect>
+      </property>
+     </widget>
+    </widget>
+    <widget class="QWidget" name="tab_2" >
+     <attribute name="title" >
+      <string>Tab 2</string>
+     </attribute>
+    </widget>
+   </widget>
+  </widget>
+  <widget class="QMenuBar" name="menubar" >
+   <property name="geometry" >
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>800</width>
+     <height>25</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QStatusBar" name="statusbar" />
+ </widget>
+ <resources/>
+ <connections/>
+</ui>