Merge lp:~kalikiana/u1db-qt/trunk into lp:u1db-qt

Proposed by Cris Dywan
Status: Merged
Approved by: Cris Dywan
Approved revision: 70
Merged at revision: 59
Proposed branch: lp:~kalikiana/u1db-qt/trunk
Merge into: lp:u1db-qt
Diff against target: 1033 lines (+725/-84)
11 files modified
CMakeLists.txt (+5/-0)
database.cpp (+14/-0)
document.cpp (+1/-0)
document.h (+4/-0)
documentation/base.css (+638/-0)
documentation/concepts.qdoc (+31/-84)
documentation/u1db.qdocconf (+22/-0)
index.cpp (+1/-0)
index.h (+4/-0)
query.cpp (+1/-0)
query.h (+4/-0)
To merge this branch: bzr merge lp:~kalikiana/u1db-qt/trunk
Reviewer Review Type Date Requested Status
Cris Dywan Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+157141@code.launchpad.net

Commit message

Install docs into QtAssistant, add Ubuntu style and fix Concepts

Description of the change

Install docs into QtAssistant, add Ubuntu style and fix Concepts

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-03-12 16:08:00 +0000
3+++ CMakeLists.txt 2013-04-04 15:35:27 +0000
4@@ -77,6 +77,11 @@
5 enable_testing()
6
7 add_custom_target(check COMMAND "env" "CTEST_OUTPUT_ON_FAILURE=1" "${CMAKE_CTEST_COMMAND}")
8+add_custom_target(doc "qdoc" "u1db.qdocconf"
9+ COMMAND "sed" "-r" "-i" "'s@(</head>)@<link rel=\"stylesheet\" type=\"text/css\" href=\"style/base.css\" />\\1@'" "./output/html/*.html"
10+ COMMAND "qhelpgenerator" "./output/html/u1dbqt.qhp"
11+ COMMAND "assistant" "-register" "./output/html/u1dbqt.qch"
12+ WORKING_DIRECTORY "documentation")
13 add_subdirectory(modules)
14 add_subdirectory(tests)
15
16
17=== modified file 'database.cpp'
18--- database.cpp 2013-04-02 14:33:49 +0000
19+++ database.cpp 2013-04-04 15:35:27 +0000
20@@ -32,7 +32,21 @@
21 QT_BEGIN_NAMESPACE_U1DB
22
23 /*!
24+ \page classes.html
25+ \title All Classes
26+ \ingroup classlists
27+
28+ \brief If you know the name of the class you want, find it here.
29+
30+ This is a list of all U1db classes.
31+
32+ \generatelist annotatedclasses
33+*/
34+
35+/*!
36 \class Database
37+ \inmodule U1Db
38+ \ingroup modules
39
40 \brief The Database class implements the on-disk storage of an individual
41 U1DB database.
42
43=== modified file 'document.cpp'
44--- document.cpp 2013-04-03 09:43:05 +0000
45+++ document.cpp 2013-04-04 15:35:27 +0000
46@@ -32,6 +32,7 @@
47
48 /*!
49 \class Document
50+ \inmodule U1db
51
52 \brief The Document class proxies a single document stored in the Database.
53
54
55=== modified file 'document.h'
56--- document.h 2013-02-27 16:47:21 +0000
57+++ document.h 2013-04-04 15:35:27 +0000
58@@ -30,7 +30,11 @@
59
60 class Q_DECL_EXPORT Document : public QObject {
61 Q_OBJECT
62+#ifdef Q_QDOC
63+ Q_PROPERTY(Database* database READ getDatabase WRITE setDatabase NOTIFY databaseChanged)
64+#else
65 Q_PROPERTY(QT_PREPEND_NAMESPACE_U1DB(Database*) database READ getDatabase WRITE setDatabase NOTIFY databaseChanged)
66+#endif
67 Q_PROPERTY(QString docId READ getDocId WRITE setDocId NOTIFY docIdChanged)
68 Q_PROPERTY(bool create READ getCreate WRITE setCreate NOTIFY createChanged)
69 Q_PROPERTY(QVariant defaults READ getDefaults WRITE setDefaults NOTIFY defaultsChanged)
70
71=== added file 'documentation/base.css'
72--- documentation/base.css 1970-01-01 00:00:00 +0000
73+++ documentation/base.css 2013-04-04 15:35:27 +0000
74@@ -0,0 +1,638 @@
75+/**
76+* Ubuntu Developer base stylesheet
77+*
78+* A base stylesheet containing site-wide styles
79+*
80+* @project Ubuntu Developer
81+* @version 1.0
82+* @author Canonical Web Team: Steve Edwards
83+* @copyright 2011 Canonical Ltd.
84+*/
85+
86+/**
87+* @section Global
88+*/
89+
90+body {
91+ font-family: 'Ubuntu', 'Ubuntu Beta', UbuntuBeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
92+ font-size: 13px;
93+ line-height: 1.4;
94+ color: #333;
95+}
96+a {
97+ color: #dd4814;
98+ text-decoration: none;
99+ outline: 0;
100+}
101+p, dl {
102+ margin-bottom: 10px;
103+}
104+strong {
105+ font-weight: bold;
106+}
107+em {
108+ font-style: italic;
109+}
110+code{
111+ padding: 10px;
112+ font-family: 'Ubuntu Mono', 'Consolas', 'Monaco', 'DejaVu Sans Mono', Courier, monospace;
113+ background-color: #fdf6f2;
114+ display: block;
115+ margin-bottom: 10px;
116+ -moz-border-radius: 4px;
117+ -webkit-border-radius: 4px;
118+ border-radius: 4px;
119+}
120+h1 {
121+ font-size: 36px;
122+ line-height: 1.1;
123+ margin-bottom: 20px;
124+}
125+article h1,
126+h2 {
127+ font-size: 24px;
128+ line-height: 1.2;
129+ margin-bottom: 14px;
130+}
131+h3 {
132+ font-size: 16px;
133+ line-height: 1.3;
134+ margin-bottom: 8px;
135+}
136+h4 {
137+ font-weight: bold;
138+}
139+
140+time {
141+ color:#999;
142+}
143+
144+/**
145+* @section Structure
146+*/
147+
148+.header-login,
149+.header-navigation div,
150+.header-content div {
151+ margin: 0 auto;
152+ width: 940px;
153+}
154+
155+.header-content h1{
156+ background-color:#ffffff;
157+ display:inline-block;
158+}
159+
160+.header-content h2{
161+ background-color:#ffffff;
162+ display:table;
163+}
164+
165+.header-login ul {
166+ margin: 4px 0;
167+ float: right;
168+}
169+.header-login li {
170+ margin-right: 10px;
171+ float: left;
172+}
173+.header-login a {
174+ color: #333;
175+}
176+.header-navigation {
177+ border-top: 2px solid #dd4814;
178+ border-bottom: 2px solid #dd4814;
179+ background-color: #fff;
180+ height: 54px;
181+ clear: right;
182+ overflow: hidden;
183+}
184+.header-navigation nav ul {
185+ border-right: 1px solid #dd4814;
186+ float: right;
187+}
188+.header-navigation nav li {
189+ border-left: 1px solid #dd4814;
190+ float: left;
191+ height: 54px;
192+}
193+.header-navigation nav a {
194+ padding: 18px 14px 0;
195+ font-size: 14px;
196+ display: block;
197+ height: 36px;
198+}
199+.header-navigation nav a:hover {
200+ background-color: #fcece7;
201+}
202+.header-navigation nav .current_page_item a,
203+.header-navigation nav .current_page_parent a,
204+.header-navigation nav .current_page_ancestor a {
205+ background-color: #dd4814;
206+ color: #fff;
207+}
208+.header-navigation input {
209+ margin: 12px 10px 0 10px;
210+ padding: 5px;
211+ border-top: 1px solid #a1a1a1;
212+ border-right: 1px solid #e0e0e0;
213+ border-bottom: 1px solid #fff;
214+ border-left: 1px solid #e0e0e0;
215+ width: 90px;
216+ font-style: italic;
217+ color: #ccc;
218+ -moz-border-radius: 3px;
219+ -webkit-border-radius: 3px;
220+ border-radius: 3px;
221+ -moz-box-shadow: inset 0 1px 1px #e0e0e0;
222+ -webkit-box-shadow: inset 0 1px 1px #e0e0e0;
223+ box-shadow: inset 0 1px 1px #e0e0e0;
224+}
225+.header-navigation h2 {
226+ margin: 18px 0 0 6px;
227+ text-transform: lowercase;
228+ font-size: 22px;
229+ color: #dd4814;
230+ float: left;
231+}
232+.header-navigation .logo-ubuntu {
233+ margin-top: 12px;
234+ float: left;
235+}
236+.header-content .header-navigation-secondary {
237+ margin-bottom: 40px;
238+ padding: 0;
239+ position: relative;
240+ z-index: 2;
241+}
242+.header-navigation-secondary div {
243+ padding: 0;
244+ border: 2px solid #dd4814;
245+ -moz-border-radius: 0px 0px 4px 4px;
246+ -webkit-border-radius: 0px 0px 4px 4px;
247+ border-radius: 0px 0px 4px 4px;
248+ background: #fff;
249+ border-top: 0px;
250+ width: 936px;
251+}
252+.header-navigation-secondary nav li {
253+ float: left;
254+}
255+.header-navigation-secondary nav li a {
256+ color: #333;
257+ display: block;
258+ height: 25px;
259+ padding: 8px 8px 0;
260+}
261+.header-navigation-secondary nav li:hover,
262+.header-navigation-secondary nav .current_page_item a {
263+ background: url("../img/sec-nav-hover.gif");
264+}
265+.header-content {
266+ padding-bottom: 30px;
267+ border-bottom: 1px solid #e0e0e0;
268+ -moz-box-shadow: 0 1px 3px #e0e0e0;
269+ -webkit-box-shadow: 0 1px 3px #e0e0e0;
270+ box-shadow: 0 1px 3px #e0e0e0;
271+ margin-bottom: 3px;
272+ position: relative;
273+ overflow: hidden;
274+}
275+footer {
276+ padding: 10px 10px 40px 10px;
277+ position: relative;
278+ -moz-border-radius: 0 0 4px 4px;
279+ -webkit-border-radius: 0 0 4px 4px;
280+ border-radius: 0 0 4px 4px;
281+ font-size: 12px;
282+ background: url("../img/background-footer.png") repeat scroll 0 0 #f7f6f5;
283+}
284+footer div {
285+ margin: 0 auto;
286+ padding: 0 10px;
287+ width: 940px;
288+}
289+footer a {
290+ color: #000;
291+}
292+footer nav ul {
293+ margin: 10px 17px 30px 0;
294+ width: 172px;
295+ display: inline-block;
296+ vertical-align: top;
297+ height: auto;
298+ zoom: 1;
299+ *display: inline;
300+}
301+footer nav ul.last {
302+ margin-right: 0;
303+}
304+footer nav li {
305+ margin-bottom: 8px;
306+}
307+footer nav li:first-child {
308+ font-weight: bold;
309+}
310+footer p {
311+ margin-bottom: 0;
312+}
313+#content {
314+ padding-top: 35px;
315+}
316+.arrow-nav {
317+ display: none;
318+ position: absolute;
319+ top: -1px;
320+ z-index: 3;
321+}
322+.shadow {
323+ margin: 30px 0 3px 0;
324+ border-bottom: 1px solid #e0e0e0;
325+ -moz-box-shadow: 0 2px 3px #e0e0e0;
326+ -webkit-box-shadow: 0 2px 3px #e0e0e0;
327+ box-shadow: 0 2px 3px #e0e0e0;
328+ height: 3px;
329+}
330+
331+/**
332+* @section Site-wide
333+*/
334+
335+#content h2{
336+ font-size:24px;
337+}
338+
339+.box-orange {
340+ padding: 10px;
341+ border: 3px solid #dd4814;
342+ -moz-border-radius: 4px;
343+ -webkit-border-radius: 4px;
344+ border-radius: 4px;
345+}
346+.box-orange .link-action-small {
347+ float: right;
348+ margin: 0 0 0 20px;
349+}
350+.link-bug {
351+ margin-left: 10px;
352+ color: #999;
353+}
354+.link-action {
355+ float: left;
356+ margin-bottom: 20px;
357+ padding: 8px 12px;
358+ display: block;
359+ background-color: #dd4814;
360+ color: #fff;
361+ -moz-border-radius: 20px;
362+ -webkit-border-radius: 20px;
363+ border-radius: 20px;
364+ font-size: 16px;
365+ line-height: 1.3;
366+ border-top: 3px solid #e6633a;
367+ border-bottom: 3px solid #c03d14;
368+}
369+.link-action2 {
370+ float: left;
371+ display: block;
372+ color: #fff;
373+ font-size: 16px;
374+ line-height: 1.3;
375+}
376+.link-action2 span{
377+ display:block;
378+ float:left;
379+}
380+.link-action2 .cta-left{
381+ background:url(../img/button-cta-left.png) no-repeat;
382+ width:22px;
383+ height:48px;
384+}
385+.link-action2 .cta-center{
386+ background:url(../img/button-cta-slice.png) repeat-x;
387+ line-height:45px;
388+ height:48px;
389+}
390+.link-action2 .cta-right{
391+ background:url(../img/button-cta-right.png) no-repeat;
392+ width:22px;
393+ height:48px;
394+}
395+
396+.link-action-small {
397+ float: left;
398+ display: block;
399+ color: #fff;
400+ font-size: 16px;
401+}
402+.link-action-small span{
403+ display:block;
404+ float:left;
405+ height:42px;
406+}
407+.link-action-small .cta-left{
408+ background:url(../img/button-cta-left-small.png) no-repeat;
409+ width:19px;
410+}
411+.link-action-small .cta-center{
412+ background:url(../img/button-cta-slice-small.png) repeat-x;
413+ line-height:42px;
414+}
415+.link-action-small .cta-right{
416+ background:url(../img/button-cta-right-small.png) no-repeat;
417+ width:19px;
418+}
419+
420+.link-action:active {
421+ position: relative;
422+ top: 1px;
423+}
424+.link-action2:active {
425+ position: relative;
426+ top: 1px;
427+}
428+.link-action-small:active {
429+ position: relative;
430+ top: 1px;
431+}
432+.list-bullets li {
433+ margin-bottom: 10px;
434+ list-style: disc;
435+ list-style-position: inside;
436+}
437+.box {
438+ margin-bottom: 30px;
439+ padding: 15px;
440+ border: 1px solid #aea79f;
441+ -moz-border-radius: 4px;
442+ -webkit-border-radius: 4px;
443+ border-radius: 4px;
444+}
445+.box-padded {
446+ margin-bottom: 30px;
447+ padding: 5px;
448+ border: 2px solid #aea79f;
449+ -moz-border-radius: 4px;
450+ -webkit-border-radius: 4px;
451+ border-radius: 4px;
452+ background: url("../img/pattern-featured.gif") repeat scroll 0 0 #ebe9e7;
453+ overflow: hidden;
454+}
455+.box-padded h3 {
456+ margin: 5px 0 10px 5px;
457+}
458+.box-padded div {
459+ padding: 10px;
460+ border: 1px solid #aea79f;
461+ -moz-border-radius: 4px;
462+ -webkit-border-radius: 4px;
463+ border-radius: 4px;
464+ background-color: #fff;
465+ overflow: hidden;
466+}
467+.box-padded li {
468+ padding: 0 10px;
469+ float: left;
470+ width: 211px;
471+ border-right: 1px dotted #aea79f;
472+}
473+.box-padded li.first {
474+ padding: 0;
475+ margin-bottom: 0;
476+}
477+.box-padded li.last {
478+ border: 0;
479+ width: 217px;
480+}
481+.box-padded img {
482+ margin: 0 10px 50px 0;
483+ float: left;
484+ -moz-border-radius: 8px;
485+ -webkit-border-radius: 8px;
486+ border-radius: 8px;
487+}
488+.box-clear {
489+ margin-bottom: 40px;
490+}
491+.box-clear .grid-4.first {
492+ margin-right: 15px;
493+ padding-right: 15px;
494+}
495+.box-clear .grid-4 {
496+ margin-left: 0;
497+ margin-right: 10px;
498+ padding-right: 10px;
499+ width: 298px;
500+}
501+.box-clear time {
502+ display: block;
503+ border-bottom: 1px dotted #aea79f;
504+ padding-bottom: 10px;
505+ margin-bottom: 10px;
506+}
507+.box-clear div.first {
508+ border-right: 1px dotted #aea79f;
509+}
510+.box-clear a {
511+ display: block;
512+}
513+.box-clear .rss {
514+ background: url("../img/rss.jpg") no-repeat scroll 0 center;
515+ padding-left: 20px;
516+}
517+.box-clear .location {
518+ display: block;
519+ margin-bottom: 1px;
520+}
521+.box-clear .last {
522+ margin: 0;
523+ padding-right: 0;
524+ -moz-border-radius: 4px;
525+ -webkit-border-radius: 4px;
526+ border-radius: 4px;
527+ width: 293px;
528+}
529+
530+/* Widgets */
531+
532+.ui-state-focus {
533+ outline: none;
534+}
535+.ui-accordion {
536+ border-bottom: 1px dotted #aea79f;
537+}
538+.ui-accordion a {
539+ display: block;
540+}
541+.ui-accordion h3 {
542+ margin-bottom: 0;
543+ border-top: 1px dotted #aea79f;
544+ position: relative;
545+ font-size: 13px;
546+ font-weight: bold;
547+}
548+.ui-accordion h3 a {
549+ padding: 10px 0;
550+ color: #333;
551+}
552+.ui-accordion h4 {
553+ margin-bottom: 5px;
554+}
555+.ui-accordion div fieldset {
556+ padding-bottom: 5px;
557+}
558+.ui-accordion div li,
559+.ui-accordion div input {
560+ margin-bottom: 10px;
561+}
562+.ui-accordion .ui-icon {
563+ position: absolute;
564+ top: 15px;
565+ right: 0;
566+ display: block;
567+ width: 8px;
568+ height: 8px;
569+ background: url("../img/icon-accordion-inactive.png") 0 0 no-repeat transparent;
570+}
571+.ui-accordion .ui-state-active .ui-icon {
572+ background-image: url("../img/icon-accordion-active.png");
573+}
574+.ui-accordion .current_page_item a {
575+ color: #333;
576+}
577+.container-tweet {
578+ -moz-border-radius: 4px 4px 4px 4px;
579+ -webkit-border-radius: 4px 4px 4px 4px;
580+ border-radius: 4px 4px 4px 4px;
581+ padding: 10px 10px 10px;
582+ background-color: #f7f7f7;
583+}
584+.container-tweet .tweet-follow {
585+ margin-top: 10px;
586+ margin-bottom: -10px;
587+ padding-left: 55px;
588+ padding-bottom: 6px;
589+ background: url("../img/tweet-follow.png") 0 5px no-repeat;
590+ display: block;
591+}
592+.container-tweet .tweet-follow span {
593+ font-size: 16px;
594+ font-weight: bold;
595+ line-height: 1.2;
596+ display: block;
597+}
598+.tweet a {
599+ display: inline;
600+}
601+.tweet .tweet_text {
602+ padding: 10px;
603+ background-color: #fff;
604+ -moz-border-radius: 4px 4px 4px 4px;
605+ -webkit-border-radius: 4px 4px 4px 4px;
606+ border-radius: 4px 4px 4px 4px;
607+ border: 1px solid #dd4814;
608+ font-size: 16px;
609+ display: block;
610+ clear: both;
611+}
612+.tweet.tweet-small .tweet_text {
613+ font-size: inherit;
614+}
615+.tweet .tweet_text a {
616+ color: #333;
617+}
618+.tweet .tweet_time,
619+.tweet .tweet_user_and_time {
620+ padding: 15px 0 10px 0;
621+ position: relative;
622+ top: -2px;
623+ background: url("../img/tweet-arrow.png") no-repeat;
624+ display: block;
625+}
626+.tweet .tweet_odd .tweet_time,
627+.tweet .tweet_odd .tweet_user_and_time {
628+ background-position: right 0;
629+ float: right;
630+}
631+.tweet .tweet_even .tweet_time,
632+.tweet .tweet_even .tweet_user_and_time {
633+ background-position: left 0;
634+ float: left;
635+}
636+
637+/* Search */
638+
639+#content .list-search li {
640+ list-style-type:none;
641+ border:0px;
642+ margin-bottom: 15px;
643+ padding-top: 15px;
644+}
645+
646+/* Blog */
647+
648+.blog-article #nav-single {
649+ margin-top: 30px;
650+ margin-bottom: 30px;
651+}
652+.blog-article #nav-single .nav-next {
653+ float: right;
654+}
655+.blog-article article header .entry-meta {
656+ margin-bottom: 20px;
657+}
658+.blog-article article .entry-meta {
659+ color: #999;
660+}
661+.blog-article #respond form input[type="submit"] {
662+ float: left;
663+ cursor: pointer;
664+ margin-bottom: 20px;
665+ padding: 8px 12px;
666+ display: block;
667+ background-color: #dd4814;
668+ color: #fff;
669+ -moz-border-radius: 20px;
670+ -webkit-border-radius: 20px;
671+ border-radius: 20px;
672+ font-size: 16px;
673+ line-height: 1.3;
674+ border-top: 3px solid #e6633a;
675+ border-left: 3px solid #e6633a;
676+ border-right: 3px solid #e6633a;
677+ border-bottom: 3px solid #c03d14;
678+}
679+.blog-article #respond form input[type="submit"]:active {
680+ position: relative;
681+ top: 1px;
682+}
683+
684+.alignnone{
685+ float:left;
686+ margin:10px 20px 10px 0;
687+}
688+.alignleft{
689+ float:left;
690+ margin:10px 20px 10px 0;
691+}
692+.alignright{
693+ float:right;
694+ margin:10px 0 10px 20px;
695+}
696+
697+.aligncenter{
698+ float:left;
699+ margin:10px 20px 10px 0;
700+}
701+.entry-content h2, .entry-content h3{
702+ margin-top:20px;
703+}
704+.entry-content ul li{
705+ list-style-type: circle;
706+ margin-left:16px;
707+}
708+
709+.entry-content hr{
710+ border:none;
711+ border-top: 1px dotted #AEA79F;
712+}
713
714=== modified file 'documentation/concepts.qdoc'
715--- documentation/concepts.qdoc 2013-03-14 11:29:54 +0000
716+++ documentation/concepts.qdoc 2013-04-04 15:35:27 +0000
717@@ -20,12 +20,12 @@
718
719
720 /*!
721+\page concepts.html
722+\title U1DB Design Conctepts
723
724 This concept guide will describe a wide variety of U1Db-Qt functionality and usage. It will cover:
725
726 \list 1
727- \li Brief description of U1DB
728- \li What is the difference between U1DB and U1Db-Qt?
729 \li Overview of U1Db Documents and Databases
730 \li Creating Documents and Databases
731 \li Database keys and Document contents
732@@ -44,42 +44,28 @@
733 \li Using a Document without a Database
734 \endlist
735
736- */
737-
738-/*!
739-
740 \section1 Brief Description of U1DB
741
742 U1DB is a database API for synchronised databases of JSON documents. It’s simple to use in applications, and allows apps to store documents and synchronise them between machines and devices. U1DB is the database designed to work everywhere, backed by the platform’s native data storage capabilities. This means that you can use u1db on different platforms, from different languages, and backed on to different databases, and sync between all of them.
743
744- */
745-
746-/*!
747-
748 \section1 What is the difference between U1DB and U1Db-Qt
749
750 U1Db-Qt is the QML implementation of U1DB. It is a QML plugin written in C++ and allows for creating and manipulating U1DB databases via a more declarative approach within a QML application.
751
752- */
753-
754- /*!
755-
756 A Database is very simple to create. It only needs an id and a path where the file will be created. A Database is a model, which can be used by elements, such as the ListView further in this example.
757
758+ \qml
759 U1db.Database {
760 id: aDatabase
761 path: "aU1DbDSatabase2"
762 }
763-
764- */
765-
766-
767- /*!
768+ \endqml
769
770 A Document can be declared at runtime. It requires at the very least a unique 'docId', but that alone won't do anything special. The snipet below snippet demonstrates the basic requirements.
771
772 In addition to this, this example displays text from the database for a specific docId and id key in a text area called 'documentContent. To update the text area at startup with either the default value or a value from the database the onCompleted function is utilized, which is also demonstrated below.
773
774+ \qml
775 U1db.Document {
776 id: aDocument
777 database: aDatabase
778@@ -92,32 +78,22 @@
779 }
780
781 }
782-
783- */
784-
785-
786-
787- /*!
788+ \endqml
789
790 It should be possible to use a document without a database, as demonstrated in this snippet. Additionally this document will use the concept of sub-keys, as exemplified by the "bookmarks" id key + contents. This example will attempt to use the bookmark document to store docId values from the database, which will be displayed in a ListView on the second tab of the application. The user will be able to select a value from the ListView and the first tab will be modified accordingly.
791
792+ \qml
793 U1db.Document {
794 id: aBookmarkDocument
795 docId: 'bookmarks'
796 create: true
797 defaults: { "bookmarks": [{}] }
798 }
799-
800-
801- */
802-
803-
804-
805-
806- /*!
807+ \endqml
808
809 The listDocs method retrieves all the docId values from the current database. In this demonstration the values are put into an array, which is then checked to locate the docId for the current and previous documents within the database.
810
811+ \qml
812 var documentIds = {}
813
814 documentIds = documentObject.database.listDocs()
815@@ -132,64 +108,44 @@
816 }
817
818 }
819-
820- */
821-
822-
823-
824-
825-
826-
827- /*!
828+ \endqml
829
830 These steps demonstrate the creation of a temporary document, based on a copy of the global document. This will then be used to determine if there is already a document in the database with the same docId as the address bar, and additionally with a key id with the same name.
831
832- var tempDocument = {}
833+ \qml
834 var tempFieldName = addressBarText;
835- var tempContents = {};
836
837- tempDocument = aDocument
838+ var tempDocument = aDocument
839 tempDocument.docId = addressBarText;
840
841- tempContents = tempDocument.contents
842-
843- NOTE: For simplicity sake this example sometimes uses the same value for both the docId and the key id, as seen here. Real life implimentations can and will differ, and this will be demonstrated elsewhere in the example code.
844-
845- */
846-
847-
848- /*!
849+ var tempContents = tempDocument.contents
850+ \endqml
851+
852+ \b{Note: For simplicity sake this example sometimes uses the same value for both the docId and the key id, as seen here. Real life implimentations can and will differ, and this will be demonstrated elsewhere in the example code.}
853
854 Here the contents of the temporary document are modified, which then replaces the global document.
855
856+ \qml
857 documentContent.text = 'More Hello World...';
858
859- tempContents = {}
860+ var tempContents = {}
861 tempContents[tempFieldName] = documentContent.text
862 tempDocument.contents = tempContents
863 aDocument = tempDocument
864-
865- */
866-
867-
868- /*!
869+ \endqml
870
871 In this instance the current document's content is updated from the text view. The unique key and docId are not modified because the database already contains a record with those properties.
872
873- tempContents = {}
874+ \qml
875+ var tempContents = {}
876 tempFieldName = getCurrentDocumentKey(aDocument.contents)
877 tempContents[tempFieldName] = documentContent.text
878 aDocument.contents = tempContents
879-
880- */
881-
882-
883-
884-
885-
886-
887- /*! Here a rectangle is defined that represents the lower portion of our application. It will contain all the main parts of the application.
888-
889+ \endqml
890+
891+ Here a rectangle is defined that represents the lower portion of our application. It will contain all the main parts of the application.
892+
893+ \qml
894 Rectangle {
895
896 width: units.gu(45)
897@@ -202,13 +158,11 @@
898
899 }
900
901- */
902-
903-
904- /*!
905+ \endqml
906
907 The following TextArea is for displaying contents for the current state of the global document, as defined by the key / name in the address bar.
908
909+ \qml
910 TextArea{
911
912 id: documentContent
913@@ -222,17 +176,11 @@
914 color: "#000000"
915
916 }
917-
918- */
919-
920-
921-
922-
923-
924- /*!
925+ \endqml
926
927 There is an object within in the 'aDocument' model defined earlier called 'contents', which contains a key called 'hello', which represents a search string. In this example the key will represent the name of a document in the database, which will be displayed in the address bar. Displaying the key is demonstrated here:
928
929+ \qml
930 text: displayKey(aDocument.contents)
931
932 function displayKey(documentObject){
933@@ -242,6 +190,5 @@
934 return keys[0]
935
936 }
937-
938- */
939+ \endqml
940
941
942=== modified file 'documentation/u1db.qdocconf'
943--- documentation/u1db.qdocconf 2013-03-18 09:30:41 +0000
944+++ documentation/u1db.qdocconf 2013-04-04 15:35:27 +0000
945@@ -2,6 +2,20 @@
946 description = U1Db-Qt plugin documentation
947
948 sourcedirs = ..
949+headers = ../database.h \
950+ ../document.h \
951+ ../index.h \
952+ ../query.h \
953+ ../global.h
954+Cpp.ignoretokens = Q_DECL_EXPORT \
955+ Q_PROPERTY \
956+ QT_BEGIN_NAMESPACE_U1DB \
957+
958+defines = Q_QDOC
959+Cpp.ignoredirectives = Q_ENUMS \
960+ Q_FLAGS \
961+ QT_PREPEND_NAMESPACE_U1DB \
962+ Q_DISABLE_COPY
963 exampledirs = ../examples
964 imagedirs = images
965
966@@ -12,3 +26,11 @@
967
968 outputdir = output/html
969 outputformats = HTML
970+syntaxhighlighting = true
971+HTML.stylesheets = base.css
972+
973+qhp.projects = U1DbQt
974+qhp.U1DbQt.file = u1dbqt.qhp
975+qhp.U1DbQt.namespace = net.launchpad.u1db-qt
976+qhp.U1DbQt.virtualFolder = u1dbqt
977+
978
979=== modified file 'index.cpp'
980--- index.cpp 2013-04-03 09:44:52 +0000
981+++ index.cpp 2013-04-04 15:35:27 +0000
982@@ -32,6 +32,7 @@
983
984 /*!
985 \class Index
986+ \inmodule U1db
987
988 \brief The Index class defines an index to be stored in the database and
989 queried using Query. Changes in documents affected by the index also update
990
991=== modified file 'index.h'
992--- index.h 2013-02-28 17:59:51 +0000
993+++ index.h 2013-04-04 15:35:27 +0000
994@@ -30,7 +30,11 @@
995
996 class Q_DECL_EXPORT Index : public QObject {
997 Q_OBJECT
998+#ifdef Q_QDOC
999+ Q_PROPERTY(Database* database READ getDatabase WRITE setDatabase NOTIFY databaseChanged)
1000+#else
1001 Q_PROPERTY(QT_PREPEND_NAMESPACE_U1DB(Database*) database READ getDatabase WRITE setDatabase NOTIFY databaseChanged)
1002+#endif
1003 Q_PROPERTY(QString name READ getName WRITE setName NOTIFY nameChanged)
1004 Q_PROPERTY(QStringList expression READ getExpression WRITE setExpression NOTIFY expressionChanged)
1005 public:
1006
1007=== modified file 'query.cpp'
1008--- query.cpp 2013-04-03 09:45:24 +0000
1009+++ query.cpp 2013-04-04 15:35:27 +0000
1010@@ -33,6 +33,7 @@
1011
1012 /*!
1013 \class Query
1014+ \inmodule U1db
1015
1016 \brief The Query class generates a filtered list of documents based on either
1017 a query or a range, and using the given Index.
1018
1019=== modified file 'query.h'
1020--- query.h 2013-02-28 17:59:51 +0000
1021+++ query.h 2013-04-04 15:35:27 +0000
1022@@ -29,7 +29,11 @@
1023
1024 class Q_DECL_EXPORT Query : public QAbstractListModel {
1025 Q_OBJECT
1026+#ifdef Q_QDOC
1027+ Q_PROPERTY(Index* index READ getIndex WRITE setIndex NOTIFY indexChanged)
1028+#else
1029 Q_PROPERTY(QT_PREPEND_NAMESPACE_U1DB(Index*) index READ getIndex WRITE setIndex NOTIFY indexChanged)
1030+#endif
1031 Q_PROPERTY(QVariant query READ getQuery WRITE setQuery NOTIFY queryChanged)
1032 Q_PROPERTY(QVariant range READ getRange WRITE setRange NOTIFY rangeChanged)
1033 public:

Subscribers

People subscribed via source and target branches

to all changes: