← Back to team overview

uonedb-qt team mailing list archive

[Merge] lp:~kalikiana/u1db-qt/creator into lp:u1db-qt

 

Christian Dywan has proposed merging lp:~kalikiana/u1db-qt/creator into lp:u1db-qt.

Commit message:
Add QtCreator Application templates to -dev package

Requested reviews:
  U1DB Qt developers (uonedb-qt)

For more details, see:
https://code.launchpad.net/~kalikiana/u1db-qt/creator/+merge/161752

Add QtCreator Application templates to -dev package
-- 
https://code.launchpad.net/~kalikiana/u1db-qt/creator/+merge/161752
Your team U1DB Qt developers is requested to review the proposed merge of lp:~kalikiana/u1db-qt/creator into lp:u1db-qt.
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2013-04-24 09:02:41 +0000
+++ CMakeLists.txt	2013-05-01 00:39:26 +0000
@@ -25,6 +25,7 @@
 add_subdirectory(examples)
 add_subdirectory(gallery)
 add_subdirectory(documentation)
+add_subdirectory(qtcreator)
 
 # PkgConfig file
 set (PREFIX "${CMAKE_INSTALL_PREFIX}")

=== modified file 'debian/changelog'
--- debian/changelog	2013-04-23 11:02:54 +0000
+++ debian/changelog	2013-05-01 00:39:26 +0000
@@ -1,3 +1,8 @@
+u1db-qt (0.1.3) quantal; urgency=low
+  * Add QtCreator Application templates to -dev package
+ 
+ -- Christian Dywan <christian.dywan@xxxxxxxxxxxxx>  Tue, 30 Apr 2013 17:36:40  -0700
+
 u1db-qt (0.1.2) quantal; urgency=low
   * Documentation packages -doc and -examples
  

=== modified file 'debian/libu1db-qt5-dev.install'
--- debian/libu1db-qt5-dev.install	2013-03-27 11:39:41 +0000
+++ debian/libu1db-qt5-dev.install	2013-05-01 00:39:26 +0000
@@ -1,3 +1,4 @@
 usr/lib/lib*.so
 usr/include/lib*/*.h
 usr/lib/pkgconfig/lib*.pc
+usr/share/qtcreator/templates/qml/*

=== added directory 'qtcreator'
=== added file 'qtcreator/CMakeLists.txt'
--- qtcreator/CMakeLists.txt	1970-01-01 00:00:00 +0000
+++ qtcreator/CMakeLists.txt	2013-05-01 00:39:26 +0000
@@ -0,0 +1,10 @@
+set(U1DB_WIZARDS "${CMAKE_INSTALL_PREFIX}/share/qtcreator/templates/qml")
+
+install(DIRECTORY "settings"
+    DESTINATION "${U1DB_WIZARDS}"
+    )
+
+install(DIRECTORY "contacts"
+    DESTINATION "${U1DB_WIZARDS}"
+    )
+

=== added directory 'qtcreator/contacts'
=== added file 'qtcreator/contacts/main.qml'
--- qtcreator/contacts/main.qml	1970-01-01 00:00:00 +0000
+++ qtcreator/contacts/main.qml	2013-05-01 00:39:26 +0000
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2013 Canonical, Ltd.
+ *
+ * Authors:
+ *  Christian Dywan <christian.dywan@xxxxxxxxxxxxx>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.0
+import U1db 1.0 as U1db
+import Ubuntu.Components 0.1
+import Ubuntu.Components.ListItems 0.1 as ListItem
+
+MainView {
+    width: units.gu(45)
+    height: units.gu(80)
+
+    U1db.Database {
+        id: contactsDatabase
+        /*
+            Uncomment to persistently store contacts on disk
+        path: "contacts.db"
+        */
+    }
+
+    U1db.Document {
+        database: contactsDatabase
+        docId: 'person0'
+        create: true
+        defaults: { 'name': 'John', 'city': 'Dublin', 'phone': 65849 }
+    }
+
+    U1db.Document {
+        database: contactsDatabase
+        docId: 'person1'
+        create: true
+        defaults: { 'name': 'Ivanka', 'city': 'Dublin', 'phone': 98765 }
+    }
+
+    U1db.Document {
+        database: contactsDatabase
+        docId: 'person2'
+        create: true
+        defaults: { 'name': 'Leonardo', 'city': 'Rome', 'phone': 12345 }
+    }
+
+    U1db.Index {
+        database: contactsDatabase
+        id: byCityName
+        expression: [ "city" ]
+    }
+
+    U1db.Query {
+        id: numberOne
+        index: byCityName
+        query: [ "Dublin" ]
+    }
+
+    Page {
+        Tabs {
+            Tab {
+                title: i18n.tr("People living in Dublin")
+                page: Page {
+                    anchors.centerIn: parent
+                    ListView {
+                        width: units.gu(45)
+                        height: units.gu(80)
+                        model: numberOne
+                        delegate: ListItem.Subtitled {
+                            text: contents.name
+                            subText: contents.city
+                        }
+                    }
+                }
+            }
+         }
+    }
+}
+

=== added file 'qtcreator/contacts/template.xml'
--- qtcreator/contacts/template.xml	1970-01-01 00:00:00 +0000
+++ qtcreator/contacts/template.xml	2013-05-01 00:39:26 +0000
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<template openeditor="main.qml" priority="2"
+    featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick, QtSupport.Wizards.FeatureQtQuick.2"
+    id="QB.U1DbContactsWithUbuntuComponents">
+    <displayname>Showing a U1Db query in a ListView</displayname>
+    <description>Ubuntu Components can be used to display a U1Db query.&lt;br/&gt;Any changes are updated automatically.&lt;br/&gt;&lt;br/&gt;Requires &lt;b&gt;Qt 5.0&lt;/b&gt; or newer.</description>
+</template>

=== added directory 'qtcreator/settings'
=== added file 'qtcreator/settings/main.qml'
--- qtcreator/settings/main.qml	1970-01-01 00:00:00 +0000
+++ qtcreator/settings/main.qml	2013-05-01 00:39:26 +0000
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2013 Canonical, Ltd.
+ *
+ * Authors:
+ *  Christian Dywan <christian.dywan@xxxxxxxxxxxxx>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.0
+import U1db 1.0 as U1db
+import Ubuntu.Components 0.1
+
+MainView {
+    width: units.gu(45)
+    height: units.gu(80)
+
+    U1db.Database {
+        id: settingsDatabase
+        /*
+            Uncomment to persistently store settings on disk
+        path: "settings.db"
+        */
+    }
+
+    U1db.Document {
+        id: settingsDocument
+        database: settingsDatabase
+        docId: 'settings'
+        create: true
+        defaults: { "sound": true, "music": false, "username": "Joe User" }
+    }
+
+    Page {
+        Tabs {
+            Tab {
+                title: i18n.tr("Game Settings")
+                page: Page {
+                    anchors.centerIn: parent
+                    Column {
+                        spacing: units.gu(2)
+                        Row {
+                            spacing: units.gu(2)
+                            Label {
+                                text: i18n.tr("Username")
+                                width: units.gu(19)
+                                anchors.verticalCenter: parent.verticalCenter
+                            }
+                            TextField {
+                                placeholderText: settingsDocument.contents.username
+                            }
+                        }
+                        Row {
+                            spacing: units.gu(2)
+                            Label {
+                                text: i18n.tr("Sound")
+                                width: units.gu(19)
+                                anchors.verticalCenter: parent.verticalCenter
+                            }
+                            Switch {
+                                checked: settingsDocument.contents.sound
+                            }
+                        }
+                        Row {
+                            spacing: units.gu(2)
+                            Label {
+                                text: i18n.tr("Music")
+                                width: units.gu(19)
+                                anchors.verticalCenter: parent.verticalCenter
+                            }
+                            Switch {
+                                checked: settingsDocument.contents.music
+                            }
+                        }
+                    }
+                }
+            }
+         }
+    }
+}
+

=== added file 'qtcreator/settings/template.xml'
--- qtcreator/settings/template.xml	1970-01-01 00:00:00 +0000
+++ qtcreator/settings/template.xml	2013-05-01 00:39:26 +0000
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<template openeditor="main.qml" priority="2"
+    featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick, QtSupport.Wizards.FeatureQtQuick.2"
+    id="QB.U1DbSettingsWithQtQuick2.0">
+    <displayname>Storing app settings in U1Db</displayname>
+    <description>A straightforward example of storing data in a U1Db document.&lt;br/&gt;The data can be displayed using standard QML items.&lt;br/&gt;&lt;br/&gt;Requires &lt;b&gt;Qt 5.0&lt;/b&gt; or newer.</description>
+</template>


Follow ups