Merge lp:~kevin-wright-1/u1db-qt/documentation-april-8-2013-i into lp:u1db-qt

Proposed by Kevin Wright
Status: Merged
Approved by: Cris Dywan
Approved revision: 69
Merged at revision: 64
Proposed branch: lp:~kevin-wright-1/u1db-qt/documentation-april-8-2013-i
Merge into: lp:u1db-qt
Diff against target: 5542 lines (+3279/-2111)
26 files modified
documentation/base.css (+0/-638)
documentation/style/base.css (+638/-0)
documentation/style/css.css (+12/-0)
documentation/style/css_002.css (+6/-0)
documentation/style/qtquick.css (+772/-0)
documentation/style/reset.css (+8/-0)
documentation/style/scratch.css (+61/-0)
documentation/u1db.qdocconf (+30/-3)
examples/u1db-qt-example-1.qml (+0/-98)
examples/u1db-qt-example-1/u1db-qt-example-1.qdoc (+24/-0)
examples/u1db-qt-example-1/u1db-qt-example-1.qml (+98/-0)
examples/u1db-qt-example-2.qml (+0/-100)
examples/u1db-qt-example-2/u1db-qt-example-2.qdoc (+24/-0)
examples/u1db-qt-example-2/u1db-qt-example-2.qml (+99/-0)
examples/u1db-qt-example-2b.qml (+0/-110)
examples/u1db-qt-example-2b/u1db-qt-example-2b.qdoc (+24/-0)
examples/u1db-qt-example-2b/u1db-qt-example-2b.qml (+111/-0)
examples/u1db-qt-example-3.qml (+0/-479)
examples/u1db-qt-example-3/u1db-qt-example-3.qdoc (+24/-0)
examples/u1db-qt-example-3/u1db-qt-example-3.qml (+481/-0)
examples/u1db-qt-example-4.qml (+0/-516)
examples/u1db-qt-example-4/u1db-qt-example-4.qdoc (+24/-0)
examples/u1db-qt-example-4/u1db-qt-example-4.qml (+518/-0)
examples/u1db-qt-example-5.qml (+0/-167)
examples/u1db-qt-example-5/u1db-qt-example-5.qdoc (+203/-0)
examples/u1db-qt-example-5/u1db-qt-example-5.qml (+122/-0)
To merge this branch: bzr merge lp:~kevin-wright-1/u1db-qt/documentation-april-8-2013-i
Reviewer Review Type Date Requested Status
Cris Dywan Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+157622@code.launchpad.net

Commit message

Moved qdoc markup from qml example files into .qdoc files. Provided a sub-directory under 'examples' for each existing example that includes both the example qml and corresponding qdoc file. Modified u1db.qdocconf to account for these changes. Additionally modified u1db.qdocconf to automatically add the correct styles to each html output file (required some additional modifications to postheader, footer etc. to support the style sheets)

Description of the change

Moved qdoc markup from qml example files into .qdoc files. Provided a sub-directory under 'examples' for each existing example that includes both the example qml and corresponding qdoc file. Modified u1db.qdocconf to account for these changes. Additionally modified u1db.qdocconf to automatically add the correct styles to each html output file (required some additional modifications to postheader, footer etc. to support the style sheets).

To post a comment you must log in.
Revision history for this message
Kevin Wright (kevin-wright-1) wrote :

Only some of the qdoc markup has been migrated to separate qdoc files from the qml examples. This will be corrected in a commit to follow.

Also, some known issues:

* qdoc creates additional html output files for some examples that are not necessary
* qdoc adds the title twice at the start of the file -- one in <li> tags and the other <h1>
* Can't seem to reference the example's qml code

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=== removed file 'documentation/base.css'
2--- documentation/base.css 2013-04-04 13:54:32 +0000
3+++ documentation/base.css 1970-01-01 00:00:00 +0000
4@@ -1,638 +0,0 @@
5-/**
6-* Ubuntu Developer base stylesheet
7-*
8-* A base stylesheet containing site-wide styles
9-*
10-* @project Ubuntu Developer
11-* @version 1.0
12-* @author Canonical Web Team: Steve Edwards
13-* @copyright 2011 Canonical Ltd.
14-*/
15-
16-/**
17-* @section Global
18-*/
19-
20-body {
21- font-family: 'Ubuntu', 'Ubuntu Beta', UbuntuBeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
22- font-size: 13px;
23- line-height: 1.4;
24- color: #333;
25-}
26-a {
27- color: #dd4814;
28- text-decoration: none;
29- outline: 0;
30-}
31-p, dl {
32- margin-bottom: 10px;
33-}
34-strong {
35- font-weight: bold;
36-}
37-em {
38- font-style: italic;
39-}
40-code{
41- padding: 10px;
42- font-family: 'Ubuntu Mono', 'Consolas', 'Monaco', 'DejaVu Sans Mono', Courier, monospace;
43- background-color: #fdf6f2;
44- display: block;
45- margin-bottom: 10px;
46- -moz-border-radius: 4px;
47- -webkit-border-radius: 4px;
48- border-radius: 4px;
49-}
50-h1 {
51- font-size: 36px;
52- line-height: 1.1;
53- margin-bottom: 20px;
54-}
55-article h1,
56-h2 {
57- font-size: 24px;
58- line-height: 1.2;
59- margin-bottom: 14px;
60-}
61-h3 {
62- font-size: 16px;
63- line-height: 1.3;
64- margin-bottom: 8px;
65-}
66-h4 {
67- font-weight: bold;
68-}
69-
70-time {
71- color:#999;
72-}
73-
74-/**
75-* @section Structure
76-*/
77-
78-.header-login,
79-.header-navigation div,
80-.header-content div {
81- margin: 0 auto;
82- width: 940px;
83-}
84-
85-.header-content h1{
86- background-color:#ffffff;
87- display:inline-block;
88-}
89-
90-.header-content h2{
91- background-color:#ffffff;
92- display:table;
93-}
94-
95-.header-login ul {
96- margin: 4px 0;
97- float: right;
98-}
99-.header-login li {
100- margin-right: 10px;
101- float: left;
102-}
103-.header-login a {
104- color: #333;
105-}
106-.header-navigation {
107- border-top: 2px solid #dd4814;
108- border-bottom: 2px solid #dd4814;
109- background-color: #fff;
110- height: 54px;
111- clear: right;
112- overflow: hidden;
113-}
114-.header-navigation nav ul {
115- border-right: 1px solid #dd4814;
116- float: right;
117-}
118-.header-navigation nav li {
119- border-left: 1px solid #dd4814;
120- float: left;
121- height: 54px;
122-}
123-.header-navigation nav a {
124- padding: 18px 14px 0;
125- font-size: 14px;
126- display: block;
127- height: 36px;
128-}
129-.header-navigation nav a:hover {
130- background-color: #fcece7;
131-}
132-.header-navigation nav .current_page_item a,
133-.header-navigation nav .current_page_parent a,
134-.header-navigation nav .current_page_ancestor a {
135- background-color: #dd4814;
136- color: #fff;
137-}
138-.header-navigation input {
139- margin: 12px 10px 0 10px;
140- padding: 5px;
141- border-top: 1px solid #a1a1a1;
142- border-right: 1px solid #e0e0e0;
143- border-bottom: 1px solid #fff;
144- border-left: 1px solid #e0e0e0;
145- width: 90px;
146- font-style: italic;
147- color: #ccc;
148- -moz-border-radius: 3px;
149- -webkit-border-radius: 3px;
150- border-radius: 3px;
151- -moz-box-shadow: inset 0 1px 1px #e0e0e0;
152- -webkit-box-shadow: inset 0 1px 1px #e0e0e0;
153- box-shadow: inset 0 1px 1px #e0e0e0;
154-}
155-.header-navigation h2 {
156- margin: 18px 0 0 6px;
157- text-transform: lowercase;
158- font-size: 22px;
159- color: #dd4814;
160- float: left;
161-}
162-.header-navigation .logo-ubuntu {
163- margin-top: 12px;
164- float: left;
165-}
166-.header-content .header-navigation-secondary {
167- margin-bottom: 40px;
168- padding: 0;
169- position: relative;
170- z-index: 2;
171-}
172-.header-navigation-secondary div {
173- padding: 0;
174- border: 2px solid #dd4814;
175- -moz-border-radius: 0px 0px 4px 4px;
176- -webkit-border-radius: 0px 0px 4px 4px;
177- border-radius: 0px 0px 4px 4px;
178- background: #fff;
179- border-top: 0px;
180- width: 936px;
181-}
182-.header-navigation-secondary nav li {
183- float: left;
184-}
185-.header-navigation-secondary nav li a {
186- color: #333;
187- display: block;
188- height: 25px;
189- padding: 8px 8px 0;
190-}
191-.header-navigation-secondary nav li:hover,
192-.header-navigation-secondary nav .current_page_item a {
193- background: url("../img/sec-nav-hover.gif");
194-}
195-.header-content {
196- padding-bottom: 30px;
197- border-bottom: 1px solid #e0e0e0;
198- -moz-box-shadow: 0 1px 3px #e0e0e0;
199- -webkit-box-shadow: 0 1px 3px #e0e0e0;
200- box-shadow: 0 1px 3px #e0e0e0;
201- margin-bottom: 3px;
202- position: relative;
203- overflow: hidden;
204-}
205-footer {
206- padding: 10px 10px 40px 10px;
207- position: relative;
208- -moz-border-radius: 0 0 4px 4px;
209- -webkit-border-radius: 0 0 4px 4px;
210- border-radius: 0 0 4px 4px;
211- font-size: 12px;
212- background: url("../img/background-footer.png") repeat scroll 0 0 #f7f6f5;
213-}
214-footer div {
215- margin: 0 auto;
216- padding: 0 10px;
217- width: 940px;
218-}
219-footer a {
220- color: #000;
221-}
222-footer nav ul {
223- margin: 10px 17px 30px 0;
224- width: 172px;
225- display: inline-block;
226- vertical-align: top;
227- height: auto;
228- zoom: 1;
229- *display: inline;
230-}
231-footer nav ul.last {
232- margin-right: 0;
233-}
234-footer nav li {
235- margin-bottom: 8px;
236-}
237-footer nav li:first-child {
238- font-weight: bold;
239-}
240-footer p {
241- margin-bottom: 0;
242-}
243-#content {
244- padding-top: 35px;
245-}
246-.arrow-nav {
247- display: none;
248- position: absolute;
249- top: -1px;
250- z-index: 3;
251-}
252-.shadow {
253- margin: 30px 0 3px 0;
254- border-bottom: 1px solid #e0e0e0;
255- -moz-box-shadow: 0 2px 3px #e0e0e0;
256- -webkit-box-shadow: 0 2px 3px #e0e0e0;
257- box-shadow: 0 2px 3px #e0e0e0;
258- height: 3px;
259-}
260-
261-/**
262-* @section Site-wide
263-*/
264-
265-#content h2{
266- font-size:24px;
267-}
268-
269-.box-orange {
270- padding: 10px;
271- border: 3px solid #dd4814;
272- -moz-border-radius: 4px;
273- -webkit-border-radius: 4px;
274- border-radius: 4px;
275-}
276-.box-orange .link-action-small {
277- float: right;
278- margin: 0 0 0 20px;
279-}
280-.link-bug {
281- margin-left: 10px;
282- color: #999;
283-}
284-.link-action {
285- float: left;
286- margin-bottom: 20px;
287- padding: 8px 12px;
288- display: block;
289- background-color: #dd4814;
290- color: #fff;
291- -moz-border-radius: 20px;
292- -webkit-border-radius: 20px;
293- border-radius: 20px;
294- font-size: 16px;
295- line-height: 1.3;
296- border-top: 3px solid #e6633a;
297- border-bottom: 3px solid #c03d14;
298-}
299-.link-action2 {
300- float: left;
301- display: block;
302- color: #fff;
303- font-size: 16px;
304- line-height: 1.3;
305-}
306-.link-action2 span{
307- display:block;
308- float:left;
309-}
310-.link-action2 .cta-left{
311- background:url(../img/button-cta-left.png) no-repeat;
312- width:22px;
313- height:48px;
314-}
315-.link-action2 .cta-center{
316- background:url(../img/button-cta-slice.png) repeat-x;
317- line-height:45px;
318- height:48px;
319-}
320-.link-action2 .cta-right{
321- background:url(../img/button-cta-right.png) no-repeat;
322- width:22px;
323- height:48px;
324-}
325-
326-.link-action-small {
327- float: left;
328- display: block;
329- color: #fff;
330- font-size: 16px;
331-}
332-.link-action-small span{
333- display:block;
334- float:left;
335- height:42px;
336-}
337-.link-action-small .cta-left{
338- background:url(../img/button-cta-left-small.png) no-repeat;
339- width:19px;
340-}
341-.link-action-small .cta-center{
342- background:url(../img/button-cta-slice-small.png) repeat-x;
343- line-height:42px;
344-}
345-.link-action-small .cta-right{
346- background:url(../img/button-cta-right-small.png) no-repeat;
347- width:19px;
348-}
349-
350-.link-action:active {
351- position: relative;
352- top: 1px;
353-}
354-.link-action2:active {
355- position: relative;
356- top: 1px;
357-}
358-.link-action-small:active {
359- position: relative;
360- top: 1px;
361-}
362-.list-bullets li {
363- margin-bottom: 10px;
364- list-style: disc;
365- list-style-position: inside;
366-}
367-.box {
368- margin-bottom: 30px;
369- padding: 15px;
370- border: 1px solid #aea79f;
371- -moz-border-radius: 4px;
372- -webkit-border-radius: 4px;
373- border-radius: 4px;
374-}
375-.box-padded {
376- margin-bottom: 30px;
377- padding: 5px;
378- border: 2px solid #aea79f;
379- -moz-border-radius: 4px;
380- -webkit-border-radius: 4px;
381- border-radius: 4px;
382- background: url("../img/pattern-featured.gif") repeat scroll 0 0 #ebe9e7;
383- overflow: hidden;
384-}
385-.box-padded h3 {
386- margin: 5px 0 10px 5px;
387-}
388-.box-padded div {
389- padding: 10px;
390- border: 1px solid #aea79f;
391- -moz-border-radius: 4px;
392- -webkit-border-radius: 4px;
393- border-radius: 4px;
394- background-color: #fff;
395- overflow: hidden;
396-}
397-.box-padded li {
398- padding: 0 10px;
399- float: left;
400- width: 211px;
401- border-right: 1px dotted #aea79f;
402-}
403-.box-padded li.first {
404- padding: 0;
405- margin-bottom: 0;
406-}
407-.box-padded li.last {
408- border: 0;
409- width: 217px;
410-}
411-.box-padded img {
412- margin: 0 10px 50px 0;
413- float: left;
414- -moz-border-radius: 8px;
415- -webkit-border-radius: 8px;
416- border-radius: 8px;
417-}
418-.box-clear {
419- margin-bottom: 40px;
420-}
421-.box-clear .grid-4.first {
422- margin-right: 15px;
423- padding-right: 15px;
424-}
425-.box-clear .grid-4 {
426- margin-left: 0;
427- margin-right: 10px;
428- padding-right: 10px;
429- width: 298px;
430-}
431-.box-clear time {
432- display: block;
433- border-bottom: 1px dotted #aea79f;
434- padding-bottom: 10px;
435- margin-bottom: 10px;
436-}
437-.box-clear div.first {
438- border-right: 1px dotted #aea79f;
439-}
440-.box-clear a {
441- display: block;
442-}
443-.box-clear .rss {
444- background: url("../img/rss.jpg") no-repeat scroll 0 center;
445- padding-left: 20px;
446-}
447-.box-clear .location {
448- display: block;
449- margin-bottom: 1px;
450-}
451-.box-clear .last {
452- margin: 0;
453- padding-right: 0;
454- -moz-border-radius: 4px;
455- -webkit-border-radius: 4px;
456- border-radius: 4px;
457- width: 293px;
458-}
459-
460-/* Widgets */
461-
462-.ui-state-focus {
463- outline: none;
464-}
465-.ui-accordion {
466- border-bottom: 1px dotted #aea79f;
467-}
468-.ui-accordion a {
469- display: block;
470-}
471-.ui-accordion h3 {
472- margin-bottom: 0;
473- border-top: 1px dotted #aea79f;
474- position: relative;
475- font-size: 13px;
476- font-weight: bold;
477-}
478-.ui-accordion h3 a {
479- padding: 10px 0;
480- color: #333;
481-}
482-.ui-accordion h4 {
483- margin-bottom: 5px;
484-}
485-.ui-accordion div fieldset {
486- padding-bottom: 5px;
487-}
488-.ui-accordion div li,
489-.ui-accordion div input {
490- margin-bottom: 10px;
491-}
492-.ui-accordion .ui-icon {
493- position: absolute;
494- top: 15px;
495- right: 0;
496- display: block;
497- width: 8px;
498- height: 8px;
499- background: url("../img/icon-accordion-inactive.png") 0 0 no-repeat transparent;
500-}
501-.ui-accordion .ui-state-active .ui-icon {
502- background-image: url("../img/icon-accordion-active.png");
503-}
504-.ui-accordion .current_page_item a {
505- color: #333;
506-}
507-.container-tweet {
508- -moz-border-radius: 4px 4px 4px 4px;
509- -webkit-border-radius: 4px 4px 4px 4px;
510- border-radius: 4px 4px 4px 4px;
511- padding: 10px 10px 10px;
512- background-color: #f7f7f7;
513-}
514-.container-tweet .tweet-follow {
515- margin-top: 10px;
516- margin-bottom: -10px;
517- padding-left: 55px;
518- padding-bottom: 6px;
519- background: url("../img/tweet-follow.png") 0 5px no-repeat;
520- display: block;
521-}
522-.container-tweet .tweet-follow span {
523- font-size: 16px;
524- font-weight: bold;
525- line-height: 1.2;
526- display: block;
527-}
528-.tweet a {
529- display: inline;
530-}
531-.tweet .tweet_text {
532- padding: 10px;
533- background-color: #fff;
534- -moz-border-radius: 4px 4px 4px 4px;
535- -webkit-border-radius: 4px 4px 4px 4px;
536- border-radius: 4px 4px 4px 4px;
537- border: 1px solid #dd4814;
538- font-size: 16px;
539- display: block;
540- clear: both;
541-}
542-.tweet.tweet-small .tweet_text {
543- font-size: inherit;
544-}
545-.tweet .tweet_text a {
546- color: #333;
547-}
548-.tweet .tweet_time,
549-.tweet .tweet_user_and_time {
550- padding: 15px 0 10px 0;
551- position: relative;
552- top: -2px;
553- background: url("../img/tweet-arrow.png") no-repeat;
554- display: block;
555-}
556-.tweet .tweet_odd .tweet_time,
557-.tweet .tweet_odd .tweet_user_and_time {
558- background-position: right 0;
559- float: right;
560-}
561-.tweet .tweet_even .tweet_time,
562-.tweet .tweet_even .tweet_user_and_time {
563- background-position: left 0;
564- float: left;
565-}
566-
567-/* Search */
568-
569-#content .list-search li {
570- list-style-type:none;
571- border:0px;
572- margin-bottom: 15px;
573- padding-top: 15px;
574-}
575-
576-/* Blog */
577-
578-.blog-article #nav-single {
579- margin-top: 30px;
580- margin-bottom: 30px;
581-}
582-.blog-article #nav-single .nav-next {
583- float: right;
584-}
585-.blog-article article header .entry-meta {
586- margin-bottom: 20px;
587-}
588-.blog-article article .entry-meta {
589- color: #999;
590-}
591-.blog-article #respond form input[type="submit"] {
592- float: left;
593- cursor: pointer;
594- margin-bottom: 20px;
595- padding: 8px 12px;
596- display: block;
597- background-color: #dd4814;
598- color: #fff;
599- -moz-border-radius: 20px;
600- -webkit-border-radius: 20px;
601- border-radius: 20px;
602- font-size: 16px;
603- line-height: 1.3;
604- border-top: 3px solid #e6633a;
605- border-left: 3px solid #e6633a;
606- border-right: 3px solid #e6633a;
607- border-bottom: 3px solid #c03d14;
608-}
609-.blog-article #respond form input[type="submit"]:active {
610- position: relative;
611- top: 1px;
612-}
613-
614-.alignnone{
615- float:left;
616- margin:10px 20px 10px 0;
617-}
618-.alignleft{
619- float:left;
620- margin:10px 20px 10px 0;
621-}
622-.alignright{
623- float:right;
624- margin:10px 0 10px 20px;
625-}
626-
627-.aligncenter{
628- float:left;
629- margin:10px 20px 10px 0;
630-}
631-.entry-content h2, .entry-content h3{
632- margin-top:20px;
633-}
634-.entry-content ul li{
635- list-style-type: circle;
636- margin-left:16px;
637-}
638-
639-.entry-content hr{
640- border:none;
641- border-top: 1px dotted #AEA79F;
642-}
643
644=== added directory 'documentation/style'
645=== added file 'documentation/style/base.css'
646--- documentation/style/base.css 1970-01-01 00:00:00 +0000
647+++ documentation/style/base.css 2013-04-08 10:35:25 +0000
648@@ -0,0 +1,638 @@
649+/**
650+* Ubuntu Developer base stylesheet
651+*
652+* A base stylesheet containing site-wide styles
653+*
654+* @project Ubuntu Developer
655+* @version 1.0
656+* @author Canonical Web Team: Steve Edwards
657+* @copyright 2011 Canonical Ltd.
658+*/
659+
660+/**
661+* @section Global
662+*/
663+
664+body {
665+ font-family: 'Ubuntu', 'Ubuntu Beta', UbuntuBeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
666+ font-size: 13px;
667+ line-height: 1.4;
668+ color: #333;
669+}
670+a {
671+ color: #dd4814;
672+ text-decoration: none;
673+ outline: 0;
674+}
675+p, dl {
676+ margin-bottom: 10px;
677+}
678+strong {
679+ font-weight: bold;
680+}
681+em {
682+ font-style: italic;
683+}
684+code{
685+ padding: 10px;
686+ font-family: 'Ubuntu Mono', 'Consolas', 'Monaco', 'DejaVu Sans Mono', Courier, monospace;
687+ background-color: #fdf6f2;
688+ display: block;
689+ margin-bottom: 10px;
690+ -moz-border-radius: 4px;
691+ -webkit-border-radius: 4px;
692+ border-radius: 4px;
693+}
694+h1 {
695+ font-size: 36px;
696+ line-height: 1.1;
697+ margin-bottom: 20px;
698+}
699+article h1,
700+h2 {
701+ font-size: 24px;
702+ line-height: 1.2;
703+ margin-bottom: 14px;
704+}
705+h3 {
706+ font-size: 16px;
707+ line-height: 1.3;
708+ margin-bottom: 8px;
709+}
710+h4 {
711+ font-weight: bold;
712+}
713+
714+time {
715+ color:#999;
716+}
717+
718+/**
719+* @section Structure
720+*/
721+
722+.header-login,
723+.header-navigation div,
724+.header-content div {
725+ margin: 0 auto;
726+ width: 940px;
727+}
728+
729+.header-content h1{
730+ background-color:#ffffff;
731+ display:inline-block;
732+}
733+
734+.header-content h2{
735+ background-color:#ffffff;
736+ display:table;
737+}
738+
739+.header-login ul {
740+ margin: 4px 0;
741+ float: right;
742+}
743+.header-login li {
744+ margin-right: 10px;
745+ float: left;
746+}
747+.header-login a {
748+ color: #333;
749+}
750+.header-navigation {
751+ border-top: 2px solid #dd4814;
752+ border-bottom: 2px solid #dd4814;
753+ background-color: #fff;
754+ height: 54px;
755+ clear: right;
756+ overflow: hidden;
757+}
758+.header-navigation nav ul {
759+ border-right: 1px solid #dd4814;
760+ float: right;
761+}
762+.header-navigation nav li {
763+ border-left: 1px solid #dd4814;
764+ float: left;
765+ height: 54px;
766+}
767+.header-navigation nav a {
768+ padding: 18px 14px 0;
769+ font-size: 14px;
770+ display: block;
771+ height: 36px;
772+}
773+.header-navigation nav a:hover {
774+ background-color: #fcece7;
775+}
776+.header-navigation nav .current_page_item a,
777+.header-navigation nav .current_page_parent a,
778+.header-navigation nav .current_page_ancestor a {
779+ background-color: #dd4814;
780+ color: #fff;
781+}
782+.header-navigation input {
783+ margin: 12px 10px 0 10px;
784+ padding: 5px;
785+ border-top: 1px solid #a1a1a1;
786+ border-right: 1px solid #e0e0e0;
787+ border-bottom: 1px solid #fff;
788+ border-left: 1px solid #e0e0e0;
789+ width: 90px;
790+ font-style: italic;
791+ color: #ccc;
792+ -moz-border-radius: 3px;
793+ -webkit-border-radius: 3px;
794+ border-radius: 3px;
795+ -moz-box-shadow: inset 0 1px 1px #e0e0e0;
796+ -webkit-box-shadow: inset 0 1px 1px #e0e0e0;
797+ box-shadow: inset 0 1px 1px #e0e0e0;
798+}
799+.header-navigation h2 {
800+ margin: 18px 0 0 6px;
801+ text-transform: lowercase;
802+ font-size: 22px;
803+ color: #dd4814;
804+ float: left;
805+}
806+.header-navigation .logo-ubuntu {
807+ margin-top: 12px;
808+ float: left;
809+}
810+.header-content .header-navigation-secondary {
811+ margin-bottom: 40px;
812+ padding: 0;
813+ position: relative;
814+ z-index: 2;
815+}
816+.header-navigation-secondary div {
817+ padding: 0;
818+ border: 2px solid #dd4814;
819+ -moz-border-radius: 0px 0px 4px 4px;
820+ -webkit-border-radius: 0px 0px 4px 4px;
821+ border-radius: 0px 0px 4px 4px;
822+ background: #fff;
823+ border-top: 0px;
824+ width: 936px;
825+}
826+.header-navigation-secondary nav li {
827+ float: left;
828+}
829+.header-navigation-secondary nav li a {
830+ color: #333;
831+ display: block;
832+ height: 25px;
833+ padding: 8px 8px 0;
834+}
835+.header-navigation-secondary nav li:hover,
836+.header-navigation-secondary nav .current_page_item a {
837+ background: url("../img/sec-nav-hover.gif");
838+}
839+.header-content {
840+ padding-bottom: 30px;
841+ border-bottom: 1px solid #e0e0e0;
842+ -moz-box-shadow: 0 1px 3px #e0e0e0;
843+ -webkit-box-shadow: 0 1px 3px #e0e0e0;
844+ box-shadow: 0 1px 3px #e0e0e0;
845+ margin-bottom: 3px;
846+ position: relative;
847+ overflow: hidden;
848+}
849+footer {
850+ padding: 10px 10px 40px 10px;
851+ position: relative;
852+ -moz-border-radius: 0 0 4px 4px;
853+ -webkit-border-radius: 0 0 4px 4px;
854+ border-radius: 0 0 4px 4px;
855+ font-size: 12px;
856+ background: url("../img/background-footer.png") repeat scroll 0 0 #f7f6f5;
857+}
858+footer div {
859+ margin: 0 auto;
860+ padding: 0 10px;
861+ width: 940px;
862+}
863+footer a {
864+ color: #000;
865+}
866+footer nav ul {
867+ margin: 10px 17px 30px 0;
868+ width: 172px;
869+ display: inline-block;
870+ vertical-align: top;
871+ height: auto;
872+ zoom: 1;
873+ *display: inline;
874+}
875+footer nav ul.last {
876+ margin-right: 0;
877+}
878+footer nav li {
879+ margin-bottom: 8px;
880+}
881+footer nav li:first-child {
882+ font-weight: bold;
883+}
884+footer p {
885+ margin-bottom: 0;
886+}
887+#content {
888+ padding-top: 35px;
889+}
890+.arrow-nav {
891+ display: none;
892+ position: absolute;
893+ top: -1px;
894+ z-index: 3;
895+}
896+.shadow {
897+ margin: 30px 0 3px 0;
898+ border-bottom: 1px solid #e0e0e0;
899+ -moz-box-shadow: 0 2px 3px #e0e0e0;
900+ -webkit-box-shadow: 0 2px 3px #e0e0e0;
901+ box-shadow: 0 2px 3px #e0e0e0;
902+ height: 3px;
903+}
904+
905+/**
906+* @section Site-wide
907+*/
908+
909+#content h2{
910+ font-size:24px;
911+}
912+
913+.box-orange {
914+ padding: 10px;
915+ border: 3px solid #dd4814;
916+ -moz-border-radius: 4px;
917+ -webkit-border-radius: 4px;
918+ border-radius: 4px;
919+}
920+.box-orange .link-action-small {
921+ float: right;
922+ margin: 0 0 0 20px;
923+}
924+.link-bug {
925+ margin-left: 10px;
926+ color: #999;
927+}
928+.link-action {
929+ float: left;
930+ margin-bottom: 20px;
931+ padding: 8px 12px;
932+ display: block;
933+ background-color: #dd4814;
934+ color: #fff;
935+ -moz-border-radius: 20px;
936+ -webkit-border-radius: 20px;
937+ border-radius: 20px;
938+ font-size: 16px;
939+ line-height: 1.3;
940+ border-top: 3px solid #e6633a;
941+ border-bottom: 3px solid #c03d14;
942+}
943+.link-action2 {
944+ float: left;
945+ display: block;
946+ color: #fff;
947+ font-size: 16px;
948+ line-height: 1.3;
949+}
950+.link-action2 span{
951+ display:block;
952+ float:left;
953+}
954+.link-action2 .cta-left{
955+ background:url(../img/button-cta-left.png) no-repeat;
956+ width:22px;
957+ height:48px;
958+}
959+.link-action2 .cta-center{
960+ background:url(../img/button-cta-slice.png) repeat-x;
961+ line-height:45px;
962+ height:48px;
963+}
964+.link-action2 .cta-right{
965+ background:url(../img/button-cta-right.png) no-repeat;
966+ width:22px;
967+ height:48px;
968+}
969+
970+.link-action-small {
971+ float: left;
972+ display: block;
973+ color: #fff;
974+ font-size: 16px;
975+}
976+.link-action-small span{
977+ display:block;
978+ float:left;
979+ height:42px;
980+}
981+.link-action-small .cta-left{
982+ background:url(../img/button-cta-left-small.png) no-repeat;
983+ width:19px;
984+}
985+.link-action-small .cta-center{
986+ background:url(../img/button-cta-slice-small.png) repeat-x;
987+ line-height:42px;
988+}
989+.link-action-small .cta-right{
990+ background:url(../img/button-cta-right-small.png) no-repeat;
991+ width:19px;
992+}
993+
994+.link-action:active {
995+ position: relative;
996+ top: 1px;
997+}
998+.link-action2:active {
999+ position: relative;
1000+ top: 1px;
1001+}
1002+.link-action-small:active {
1003+ position: relative;
1004+ top: 1px;
1005+}
1006+.list-bullets li {
1007+ margin-bottom: 10px;
1008+ list-style: disc;
1009+ list-style-position: inside;
1010+}
1011+.box {
1012+ margin-bottom: 30px;
1013+ padding: 15px;
1014+ border: 1px solid #aea79f;
1015+ -moz-border-radius: 4px;
1016+ -webkit-border-radius: 4px;
1017+ border-radius: 4px;
1018+}
1019+.box-padded {
1020+ margin-bottom: 30px;
1021+ padding: 5px;
1022+ border: 2px solid #aea79f;
1023+ -moz-border-radius: 4px;
1024+ -webkit-border-radius: 4px;
1025+ border-radius: 4px;
1026+ background: url("../img/pattern-featured.gif") repeat scroll 0 0 #ebe9e7;
1027+ overflow: hidden;
1028+}
1029+.box-padded h3 {
1030+ margin: 5px 0 10px 5px;
1031+}
1032+.box-padded div {
1033+ padding: 10px;
1034+ border: 1px solid #aea79f;
1035+ -moz-border-radius: 4px;
1036+ -webkit-border-radius: 4px;
1037+ border-radius: 4px;
1038+ background-color: #fff;
1039+ overflow: hidden;
1040+}
1041+.box-padded li {
1042+ padding: 0 10px;
1043+ float: left;
1044+ width: 211px;
1045+ border-right: 1px dotted #aea79f;
1046+}
1047+.box-padded li.first {
1048+ padding: 0;
1049+ margin-bottom: 0;
1050+}
1051+.box-padded li.last {
1052+ border: 0;
1053+ width: 217px;
1054+}
1055+.box-padded img {
1056+ margin: 0 10px 50px 0;
1057+ float: left;
1058+ -moz-border-radius: 8px;
1059+ -webkit-border-radius: 8px;
1060+ border-radius: 8px;
1061+}
1062+.box-clear {
1063+ margin-bottom: 40px;
1064+}
1065+.box-clear .grid-4.first {
1066+ margin-right: 15px;
1067+ padding-right: 15px;
1068+}
1069+.box-clear .grid-4 {
1070+ margin-left: 0;
1071+ margin-right: 10px;
1072+ padding-right: 10px;
1073+ width: 298px;
1074+}
1075+.box-clear time {
1076+ display: block;
1077+ border-bottom: 1px dotted #aea79f;
1078+ padding-bottom: 10px;
1079+ margin-bottom: 10px;
1080+}
1081+.box-clear div.first {
1082+ border-right: 1px dotted #aea79f;
1083+}
1084+.box-clear a {
1085+ display: block;
1086+}
1087+.box-clear .rss {
1088+ background: url("../img/rss.jpg") no-repeat scroll 0 center;
1089+ padding-left: 20px;
1090+}
1091+.box-clear .location {
1092+ display: block;
1093+ margin-bottom: 1px;
1094+}
1095+.box-clear .last {
1096+ margin: 0;
1097+ padding-right: 0;
1098+ -moz-border-radius: 4px;
1099+ -webkit-border-radius: 4px;
1100+ border-radius: 4px;
1101+ width: 293px;
1102+}
1103+
1104+/* Widgets */
1105+
1106+.ui-state-focus {
1107+ outline: none;
1108+}
1109+.ui-accordion {
1110+ border-bottom: 1px dotted #aea79f;
1111+}
1112+.ui-accordion a {
1113+ display: block;
1114+}
1115+.ui-accordion h3 {
1116+ margin-bottom: 0;
1117+ border-top: 1px dotted #aea79f;
1118+ position: relative;
1119+ font-size: 13px;
1120+ font-weight: bold;
1121+}
1122+.ui-accordion h3 a {
1123+ padding: 10px 0;
1124+ color: #333;
1125+}
1126+.ui-accordion h4 {
1127+ margin-bottom: 5px;
1128+}
1129+.ui-accordion div fieldset {
1130+ padding-bottom: 5px;
1131+}
1132+.ui-accordion div li,
1133+.ui-accordion div input {
1134+ margin-bottom: 10px;
1135+}
1136+.ui-accordion .ui-icon {
1137+ position: absolute;
1138+ top: 15px;
1139+ right: 0;
1140+ display: block;
1141+ width: 8px;
1142+ height: 8px;
1143+ background: url("../img/icon-accordion-inactive.png") 0 0 no-repeat transparent;
1144+}
1145+.ui-accordion .ui-state-active .ui-icon {
1146+ background-image: url("../img/icon-accordion-active.png");
1147+}
1148+.ui-accordion .current_page_item a {
1149+ color: #333;
1150+}
1151+.container-tweet {
1152+ -moz-border-radius: 4px 4px 4px 4px;
1153+ -webkit-border-radius: 4px 4px 4px 4px;
1154+ border-radius: 4px 4px 4px 4px;
1155+ padding: 10px 10px 10px;
1156+ background-color: #f7f7f7;
1157+}
1158+.container-tweet .tweet-follow {
1159+ margin-top: 10px;
1160+ margin-bottom: -10px;
1161+ padding-left: 55px;
1162+ padding-bottom: 6px;
1163+ background: url("../img/tweet-follow.png") 0 5px no-repeat;
1164+ display: block;
1165+}
1166+.container-tweet .tweet-follow span {
1167+ font-size: 16px;
1168+ font-weight: bold;
1169+ line-height: 1.2;
1170+ display: block;
1171+}
1172+.tweet a {
1173+ display: inline;
1174+}
1175+.tweet .tweet_text {
1176+ padding: 10px;
1177+ background-color: #fff;
1178+ -moz-border-radius: 4px 4px 4px 4px;
1179+ -webkit-border-radius: 4px 4px 4px 4px;
1180+ border-radius: 4px 4px 4px 4px;
1181+ border: 1px solid #dd4814;
1182+ font-size: 16px;
1183+ display: block;
1184+ clear: both;
1185+}
1186+.tweet.tweet-small .tweet_text {
1187+ font-size: inherit;
1188+}
1189+.tweet .tweet_text a {
1190+ color: #333;
1191+}
1192+.tweet .tweet_time,
1193+.tweet .tweet_user_and_time {
1194+ padding: 15px 0 10px 0;
1195+ position: relative;
1196+ top: -2px;
1197+ background: url("../img/tweet-arrow.png") no-repeat;
1198+ display: block;
1199+}
1200+.tweet .tweet_odd .tweet_time,
1201+.tweet .tweet_odd .tweet_user_and_time {
1202+ background-position: right 0;
1203+ float: right;
1204+}
1205+.tweet .tweet_even .tweet_time,
1206+.tweet .tweet_even .tweet_user_and_time {
1207+ background-position: left 0;
1208+ float: left;
1209+}
1210+
1211+/* Search */
1212+
1213+#content .list-search li {
1214+ list-style-type:none;
1215+ border:0px;
1216+ margin-bottom: 15px;
1217+ padding-top: 15px;
1218+}
1219+
1220+/* Blog */
1221+
1222+.blog-article #nav-single {
1223+ margin-top: 30px;
1224+ margin-bottom: 30px;
1225+}
1226+.blog-article #nav-single .nav-next {
1227+ float: right;
1228+}
1229+.blog-article article header .entry-meta {
1230+ margin-bottom: 20px;
1231+}
1232+.blog-article article .entry-meta {
1233+ color: #999;
1234+}
1235+.blog-article #respond form input[type="submit"] {
1236+ float: left;
1237+ cursor: pointer;
1238+ margin-bottom: 20px;
1239+ padding: 8px 12px;
1240+ display: block;
1241+ background-color: #dd4814;
1242+ color: #fff;
1243+ -moz-border-radius: 20px;
1244+ -webkit-border-radius: 20px;
1245+ border-radius: 20px;
1246+ font-size: 16px;
1247+ line-height: 1.3;
1248+ border-top: 3px solid #e6633a;
1249+ border-left: 3px solid #e6633a;
1250+ border-right: 3px solid #e6633a;
1251+ border-bottom: 3px solid #c03d14;
1252+}
1253+.blog-article #respond form input[type="submit"]:active {
1254+ position: relative;
1255+ top: 1px;
1256+}
1257+
1258+.alignnone{
1259+ float:left;
1260+ margin:10px 20px 10px 0;
1261+}
1262+.alignleft{
1263+ float:left;
1264+ margin:10px 20px 10px 0;
1265+}
1266+.alignright{
1267+ float:right;
1268+ margin:10px 0 10px 20px;
1269+}
1270+
1271+.aligncenter{
1272+ float:left;
1273+ margin:10px 20px 10px 0;
1274+}
1275+.entry-content h2, .entry-content h3{
1276+ margin-top:20px;
1277+}
1278+.entry-content ul li{
1279+ list-style-type: circle;
1280+ margin-left:16px;
1281+}
1282+
1283+.entry-content hr{
1284+ border:none;
1285+ border-top: 1px dotted #AEA79F;
1286+}
1287
1288=== added file 'documentation/style/css.css'
1289--- documentation/style/css.css 1970-01-01 00:00:00 +0000
1290+++ documentation/style/css.css 2013-04-08 10:35:25 +0000
1291@@ -0,0 +1,12 @@
1292+@font-face {
1293+ font-family: 'Ubuntu';
1294+ font-style: normal;
1295+ font-weight: 400;
1296+ src: local('Ubuntu'), url(http://themes.googleusercontent.com/static/fonts/ubuntu/v4/_xyN3apAT_yRRDeqB3sPRg.woff) format('woff');
1297+}
1298+@font-face {
1299+ font-family: 'Ubuntu';
1300+ font-style: italic;
1301+ font-weight: 400;
1302+ src: local('Ubuntu Italic'), local('Ubuntu-Italic'), url(http://themes.googleusercontent.com/static/fonts/ubuntu/v4/kbP_6ONYVgE-bLa9ZRbvvvesZW2xOQ-xsNqO47m55DA.woff) format('woff');
1303+}
1304
1305=== added file 'documentation/style/css_002.css'
1306--- documentation/style/css_002.css 1970-01-01 00:00:00 +0000
1307+++ documentation/style/css_002.css 2013-04-08 10:35:25 +0000
1308@@ -0,0 +1,6 @@
1309+@font-face {
1310+ font-family: 'Ubuntu Mono';
1311+ font-style: normal;
1312+ font-weight: 400;
1313+ src: local('Ubuntu Mono'), local('UbuntuMono-Regular'), url(http://themes.googleusercontent.com/static/fonts/ubuntumono/v3/ViZhet7Ak-LRXZMXzuAfkYbN6UDyHWBl620a-IRfuBk.woff) format('woff');
1314+}
1315
1316=== added file 'documentation/style/qtquick.css'
1317--- documentation/style/qtquick.css 1970-01-01 00:00:00 +0000
1318+++ documentation/style/qtquick.css 2013-04-08 10:35:25 +0000
1319@@ -0,0 +1,772 @@
1320+@media screen
1321+{
1322+
1323+/* basic elements */
1324+ html
1325+ {
1326+ color: #000000;
1327+ background: #FFFFFF;
1328+ }
1329+ table
1330+ {
1331+ border-collapse: collapse;
1332+ border-spacing: 0;
1333+ }
1334+ fieldset, img
1335+ {
1336+ border: 0;
1337+ max-width:100%;
1338+ }
1339+ address, caption, cite, code, dfn, em, strong, th, var, optgroup
1340+ {
1341+ font-style: inherit;
1342+ font-weight: inherit;
1343+ }
1344+ del, ins
1345+ {
1346+ text-decoration: none;
1347+ }
1348+ ol li
1349+ {
1350+ list-style: decimal;
1351+ }
1352+ ul li
1353+ {
1354+ list-style: none;
1355+ }
1356+ caption, th
1357+ {
1358+ text-align: left;
1359+ }
1360+ h1.title
1361+ {
1362+ font-weight: bold;
1363+ font-size: 150%;
1364+ }
1365+ h0
1366+ {
1367+ font-weight: bold;
1368+ font-size: 130%;
1369+ }
1370+ h1, h2, h3, h4, h5, h6
1371+ {
1372+ font-size: 100%;
1373+ }
1374+ q:before, q:after
1375+ {
1376+ content: '';
1377+ }
1378+ abbr, acronym
1379+ {
1380+ border: 0;
1381+ font-variant: normal;
1382+ }
1383+ sup, sub
1384+ {
1385+ vertical-align: baseline;
1386+ }
1387+ tt, .qmlreadonly span, .qmldefault span
1388+ {
1389+ word-spacing:0.5em;
1390+ }
1391+ legend
1392+ {
1393+ color: #000000;
1394+ }
1395+ strong
1396+ {
1397+ font-weight: bold;
1398+ }
1399+ em
1400+ {
1401+ font-style: italic;
1402+ }
1403+
1404+ body
1405+ {
1406+ margin: 0 1.5em 0 1.5em;
1407+ font-family: ubuntu;
1408+ line-height: normal
1409+ }
1410+ a
1411+ {
1412+ color: #00732F;
1413+ text-decoration: none;
1414+ }
1415+ hr
1416+ {
1417+ background-color: #E6E6E6;
1418+ border: 1px solid #E6E6E6;
1419+ height: 1px;
1420+ width: 100%;
1421+ text-align: left;
1422+ margin: 1.5em 0 1.5em 0;
1423+ }
1424+
1425+ pre
1426+ {
1427+ border: 1px solid #DDDDDD;
1428+ -moz-border-radius: 0.7em 0.7em 0.7em 0.7em;
1429+ -webkit-border-radius: 0.7em 0.7em 0.7em 0.7em;
1430+ border-radius: 0.7em 0.7em 0.7em 0.7em;
1431+ padding: 1em 1em 1em 1em;
1432+ overflow-x: auto;
1433+ }
1434+ table, pre
1435+ {
1436+ -moz-border-radius: 0.7em 0.7em 0.7em 0.7em;
1437+ -webkit-border-radius: 0.7em 0.7em 0.7em 0.7em;
1438+ border-radius: 0.7em 0.7em 0.7em 0.7em;
1439+ background-color: #F6F6F6;
1440+ border: 1px solid #E6E6E6;
1441+ border-collapse: separate;
1442+ margin-bottom: 2.5em;
1443+ }
1444+ pre {
1445+ font-size: 90%;
1446+ display: block;
1447+ overflow:hidden;
1448+ }
1449+ thead
1450+ {
1451+ margin-top: 0.5em;
1452+ font-weight: bold
1453+ }
1454+ th
1455+ {
1456+ padding: 0.5em 1.5em 0.5em 1em;
1457+ background-color: #E1E1E1;
1458+ border-left: 1px solid #E6E6E6;
1459+ }
1460+ td
1461+ {
1462+ padding: 0.25em 1.5em 0.25em 1em;
1463+ }
1464+
1465+ td.rightAlign
1466+ {
1467+ padding: 0.25em 0.5em 0.25em 1em;
1468+ }
1469+ table tr.odd
1470+ {
1471+ border-left: 1px solid #E6E6E6;
1472+ background-color: #F6F6F6;
1473+ color: black;
1474+ }
1475+ table tr.even
1476+ {
1477+ border-left: 1px solid #E6E6E6;
1478+ background-color: #ffffff;
1479+ color: #202020;
1480+ }
1481+
1482+ div.float-left
1483+ {
1484+ float: left; margin-right: 2em
1485+ }
1486+ div.float-right
1487+ {
1488+ float: right; margin-left: 2em
1489+ }
1490+
1491+ span.comment
1492+ {
1493+ color: #008B00;
1494+ }
1495+ span.string, span.char
1496+ {
1497+ color: #000084;
1498+ }
1499+ span.number
1500+ {
1501+ color: #a46200;
1502+ }
1503+ span.operator
1504+ {
1505+ color: #202020;
1506+ }
1507+ span.keyword
1508+ {
1509+ color: #840000;
1510+ }
1511+ span.name
1512+ {
1513+ color: black
1514+ }
1515+ span.type
1516+ {
1517+ font-weight: bold
1518+ }
1519+ span.type a:visited
1520+ {
1521+ color: #0F5300;
1522+ }
1523+ span.preprocessor
1524+ {
1525+ color: #404040
1526+ }
1527+/* end basic elements */
1528+
1529+/* font style elements */
1530+ .heading
1531+ {
1532+ font-weight: bold;
1533+ font-size: 125%;
1534+ }
1535+ .subtitle
1536+ {
1537+ font-size: 110%
1538+ }
1539+ .small-subtitle
1540+ {
1541+ font-size: 100%
1542+ }
1543+ .red
1544+ {
1545+ color:red;
1546+ }
1547+/* end font style elements */
1548+
1549+/* global settings*/
1550+ .header, .footer
1551+ {
1552+ display: block;
1553+ clear: both;
1554+ overflow: hidden;
1555+ }
1556+/* end global settings*/
1557+
1558+/* header elements */
1559+ .header .qtref
1560+ {
1561+ color: #00732F;
1562+ font-weight: bold;
1563+ font-size: 130%;
1564+ }
1565+
1566+ .header .content
1567+ {
1568+ margin-left: 5px;
1569+ margin-top: 5px;
1570+ margin-bottom: 0.5em;
1571+ }
1572+
1573+ .header .breadcrumb
1574+ {
1575+ font-size: 90%;
1576+ padding: 0.5em 0 0.5em 1em;
1577+ margin: 0;
1578+ background-color: #fafafa;
1579+ height: 1.35em;
1580+ border-bottom: 1px solid #d1d1d1;
1581+ }
1582+
1583+ .header .breadcrumb ul
1584+ {
1585+ margin: 0;
1586+ padding: 0;
1587+ }
1588+
1589+ .header .content
1590+ {
1591+ word-wrap: break-word;
1592+ }
1593+
1594+ .header .breadcrumb ul li
1595+ {
1596+ float: left;
1597+ background: url(../images/breadcrumb.png) no-repeat 0 3px;
1598+ padding-left: 1.5em;
1599+ margin-left: 1.5em;
1600+ }
1601+
1602+ .header .breadcrumb ul li.last
1603+ {
1604+ font-weight: normal;
1605+ }
1606+
1607+ .header .breadcrumb ul li a
1608+ {
1609+ color: #00732F;
1610+ }
1611+
1612+ .header .breadcrumb ul li.first
1613+ {
1614+ background-image: none;
1615+ padding-left: 0;
1616+ margin-left: 0;
1617+ }
1618+
1619+ .header .content ol li {
1620+ background: none;
1621+ margin-bottom: 1.0em;
1622+ margin-left: 1.2em;
1623+ padding-left: 0
1624+ }
1625+
1626+ .header .content li
1627+ {
1628+ background: url(../images/bullet_sq.png) no-repeat 0 5px;
1629+ margin-bottom: 1em;
1630+ padding-left: 1.2em;
1631+ }
1632+
1633+/* end header elements */
1634+
1635+/* content elements */
1636+ .content h1
1637+ {
1638+ font-weight: bold;
1639+ font-size: 130%
1640+ }
1641+
1642+ .content h2
1643+ {
1644+ font-weight: bold;
1645+ font-size: 120%;
1646+ width: 100%;
1647+ }
1648+ .content h3
1649+ {
1650+ font-weight: bold;
1651+ font-size: 110%;
1652+ width: 100%;
1653+ }
1654+ .content table p
1655+ {
1656+ margin: 0
1657+ }
1658+ .content ul
1659+ {
1660+ padding-left: 2.5em;
1661+ }
1662+ .content li
1663+ {
1664+ padding-top: 0.25em;
1665+ padding-bottom: 0.25em;
1666+ }
1667+ .content ul img {
1668+ vertical-align: middle;
1669+ }
1670+
1671+ .content a:visited
1672+ {
1673+ color: #4c0033;
1674+ text-decoration: none;
1675+ }
1676+
1677+ .content a:visited:hover
1678+ {
1679+ color: #4c0033;
1680+ text-decoration: underline;
1681+ }
1682+
1683+ a:hover
1684+ {
1685+ color: #4c0033;
1686+ text-decoration: underline;
1687+ }
1688+ descr p a
1689+ {
1690+ text-decoration: underline;
1691+ }
1692+
1693+ .descr p a:visited
1694+ {
1695+ text-decoration: underline;
1696+ }
1697+
1698+ .alphaChar{
1699+ width:95%;
1700+ background-color:#F6F6F6;
1701+ border:1px solid #E6E6E6;
1702+ -moz-border-radius: 7px 7px 7px 7px;
1703+ border-radius: 7px 7px 7px 7px;
1704+ -webkit-border-radius: 7px 7px 7px 7px;
1705+ font-size:12pt;
1706+ padding-left:10px;
1707+ margin-top:10px;
1708+ margin-bottom:10px;
1709+ }
1710+ .flowList{
1711+ /*vertical-align:top;*/
1712+ /*margin:20px auto;*/
1713+
1714+ column-count:3;
1715+ -webkit-column-count:3;
1716+ -moz-column-count:3;
1717+/*
1718+ column-width:100%;
1719+ -webkit-column-width:200px;
1720+ -col-column-width:200px;
1721+*/
1722+ column-gap:41px;
1723+ -webkit-column-gap:41px;
1724+ -moz-column-gap:41px;
1725+
1726+ column-rule: 1px dashed #ccc;
1727+ -webkit-column-rule: 1px dashed #ccc;
1728+ -moz-column-rule: 1px dashed #ccc;
1729+ }
1730+
1731+ .flowList dl{
1732+ }
1733+ .flowList dd{
1734+ /*display:inline-block;*/
1735+ margin-left:10px;
1736+ min-width:250px;
1737+ line-height: 1.5;
1738+ min-width:100%;
1739+ min-height:15px;
1740+ }
1741+
1742+ .flowList dd a{
1743+ }
1744+
1745+ .mainContent
1746+ {
1747+ padding-left:5px;
1748+ }
1749+
1750+ .content .flowList p{
1751+ padding:0px;
1752+ }
1753+
1754+ .content .alignedsummary
1755+ {
1756+ margin: 15px;
1757+ }
1758+
1759+
1760+ .qmltype
1761+ {
1762+ text-align: center;
1763+ font-size: 120%;
1764+ }
1765+ .qmlreadonly
1766+ {
1767+ padding-left: 5px;
1768+ float: right;
1769+ color: #254117;
1770+ }
1771+
1772+ .qmldefault
1773+ {
1774+ padding-left: 5px;
1775+ float: right;
1776+ color: red;
1777+ }
1778+
1779+ .qmldoc
1780+ {
1781+ }
1782+
1783+ .generic .alphaChar{
1784+ margin-top:5px;
1785+ }
1786+
1787+ .generic .odd .alphaChar{
1788+ background-color: #F6F6F6;
1789+ }
1790+
1791+ .generic .even .alphaChar{
1792+ background-color: #FFFFFF;
1793+ }
1794+
1795+ .memItemRight{
1796+ padding: 0.25em 1.5em 0.25em 0;
1797+ }
1798+ .highlightedCode
1799+ {
1800+ margin: 1.0em;
1801+ }
1802+ .annotated td {
1803+ padding: 0.25em 0.5em 0.25em 0.5em;
1804+ }
1805+
1806+ .toc
1807+ {
1808+ font-size: 80%
1809+ }
1810+
1811+ .header .content .toc ul
1812+ {
1813+ padding-left: 0px;
1814+ }
1815+
1816+ .content .toc h3 {
1817+ border-bottom: 0px;
1818+ margin-top: 0px;
1819+ }
1820+
1821+ .content .toc h3 a:hover {
1822+ color: #00732F;
1823+ text-decoration: none;
1824+ }
1825+
1826+ .content .toc .level2
1827+ {
1828+ margin-left: 1.5em;
1829+ }
1830+
1831+ .content .toc .level3
1832+ {
1833+ margin-left: 3.0em;
1834+ }
1835+
1836+ .content ul li
1837+ {
1838+ background: url(../images/bullet_sq.png) no-repeat 0 0.7em;
1839+ padding-left: 1em
1840+ }
1841+
1842+ .content .toc li
1843+ {
1844+ background: url(../images/bullet_dn.png) no-repeat 0 5px;
1845+ padding-left: 1em
1846+ }
1847+
1848+ .relpage
1849+ {
1850+ -moz-border-radius: 7px 7px 7px 7px;
1851+ -webkit-border-radius: 7px 7px 7px 7px;
1852+ border-radius: 7px 7px 7px 7px;
1853+ border: 1px solid #DDDDDD;
1854+ padding: 25px 25px;
1855+ clear: both;
1856+ }
1857+ .relpage ul
1858+ {
1859+ float: none;
1860+ padding: 1.5em;
1861+ }
1862+
1863+ h3.fn, span.fn
1864+ {
1865+ -moz-border-radius:7px 7px 7px 7px;
1866+ -webkit-border-radius:7px 7px 7px 7px;
1867+ border-radius:7px 7px 7px 7px;
1868+ background-color: #F6F6F6;
1869+ border-width: 1px;
1870+ border-style: solid;
1871+ border-color: #E6E6E6;
1872+ font-weight: bold;
1873+ word-spacing:3px;
1874+ padding:3px 5px;
1875+ }
1876+
1877+ .functionIndex {
1878+ font-size:12pt;
1879+ word-spacing:10px;
1880+ margin-bottom:10px;
1881+ background-color: #F6F6F6;
1882+ border-width: 1px;
1883+ border-style: solid;
1884+ border-color: #E6E6E6;
1885+ -moz-border-radius: 7px 7px 7px 7px;
1886+ -webkit-border-radius: 7px 7px 7px 7px;
1887+ border-radius: 7px 7px 7px 7px;
1888+ width:100%;
1889+ }
1890+
1891+ .centerAlign
1892+ {
1893+ text-align:center;
1894+ }
1895+
1896+ .rightAlign
1897+ {
1898+ text-align:right;
1899+ }
1900+
1901+ .leftAlign
1902+ {
1903+ text-align:left;
1904+ }
1905+
1906+ .topAlign{
1907+ vertical-align:top
1908+ }
1909+
1910+ .functionIndex a{
1911+ display:inline-block;
1912+ }
1913+
1914+/* end content elements */
1915+/* footer elements */
1916+
1917+ .footer
1918+ {
1919+ color: #393735;
1920+ font-size: 0.75em;
1921+ text-align: center;
1922+ padding-top: 1.5em;
1923+ padding-bottom: 1em;
1924+ background-color: #E6E7E8;
1925+ margin: 0;
1926+ }
1927+ .footer p
1928+ {
1929+ margin: 0.25em
1930+ }
1931+ .small
1932+ {
1933+ font-size: 0.5em;
1934+ }
1935+/* end footer elements */
1936+
1937+ .item {
1938+ float: left;
1939+ position: relative;
1940+ width: 100%;
1941+ overflow: hidden;
1942+ }
1943+
1944+
1945+ .item .primary {
1946+ margin-right: 220px;
1947+ position: relative;
1948+ }
1949+
1950+ .item hr {
1951+ margin-left: -220px;
1952+ }
1953+
1954+ .item .secondary {
1955+ float: right;
1956+ width: 200px;
1957+ position: relative;
1958+ }
1959+
1960+ .item .cols {
1961+ clear: both;
1962+ display: block;
1963+ }
1964+
1965+ .item .cols .col {
1966+ float: left;
1967+ margin-left: 1.5%;
1968+ }
1969+
1970+ .item .cols .col.first {
1971+ margin-left: 0;
1972+ }
1973+
1974+ .item .cols.two .col {
1975+ width: 45%;
1976+ }
1977+
1978+ .item .box {
1979+ margin: 0 0 10px 0;
1980+ }
1981+
1982+ .item .box h3 {
1983+ margin: 0 0 10px 0;
1984+ }
1985+
1986+ .cols.unclear {
1987+ clear:none;
1988+ }
1989+}
1990+
1991+/* end of screen media */
1992+
1993+/* start of print media */
1994+
1995+@media print
1996+{
1997+ input, textarea, .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft, #feedbackBox, #blurpage, .toc, .breadcrumb, .toolbar, .floatingResult
1998+ {
1999+ display: none;
2000+ background: none;
2001+ }
2002+ .content
2003+ {
2004+ background: none;
2005+ display: block;
2006+ width: 100%; margin: 0; float: none;
2007+ }
2008+}
2009+/* end of print media */
2010+
2011+
2012+/* modify the TOC layouts */
2013+div.toc ul {
2014+ padding-left: 20px;
2015+}
2016+div.toc li {
2017+ padding-left: 4px;
2018+}
2019+/* Remove the border around images*/
2020+a img
2021+{
2022+ border:none;
2023+}
2024+
2025+/*Add styling to the front pages*/
2026+
2027+.threecolumn_area
2028+{
2029+ padding-top: 20px;
2030+ padding-bottom: 20px;
2031+}
2032+.threecolumn_piece
2033+{
2034+ display: inline-block;
2035+ margin-left: 78px;
2036+ margin-top: 8px;
2037+ padding: 0;
2038+ vertical-align: top;
2039+ width: 25.5%;
2040+}
2041+div.threecolumn_piece ul {
2042+ list-style-type: none;
2043+ padding-left: 0px;
2044+ margin-top: 2px;
2045+}
2046+div.threecolumn_piece p {
2047+ margin-bottom: 7px;
2048+ color: #5C626E;
2049+ text-decoration: none;
2050+ font-weight: bold;
2051+}
2052+div.threecolumn_piece li {
2053+ padding-left: 0px;
2054+ margin-bottom: 5px;
2055+}
2056+div.threecolumn_piece a {
2057+ font-weight: normal;
2058+}
2059+/* Add style to guide page*/
2060+.fourcolumn_area
2061+{
2062+ padding-top: 20px;
2063+ padding-bottom: 20px;
2064+}
2065+.fourcolumn_piece
2066+{
2067+ display: inline-block;
2068+ margin-left: 35px;
2069+ margin-top: 8px;
2070+ padding: 0;
2071+ vertical-align: top;
2072+ width: 21.3%;
2073+}
2074+div.fourcolumn_piece ul {
2075+ list-style-type: none;
2076+ padding-left: 0px;
2077+ margin-top: 2px;
2078+}
2079+div.fourcolumn_piece p {
2080+ margin-bottom: 7px;
2081+ color: #40444D;
2082+ text-decoration: none;
2083+ font-weight: bold;
2084+}
2085+div.fourcolumn_piece li {
2086+ padding-left: 0px;
2087+ margin-bottom: 5px;
2088+}
2089+div.fourcolumn_piece a {
2090+ font-weight: normal;
2091+}
2092
2093=== added file 'documentation/style/reset.css'
2094--- documentation/style/reset.css 1970-01-01 00:00:00 +0000
2095+++ documentation/style/reset.css 2013-04-08 10:35:25 +0000
2096@@ -0,0 +1,8 @@
2097+/*
2098+Copyright (c) 2010, Yahoo! Inc. All rights reserved.
2099+Code licensed under the BSD License:
2100+http://developer.yahoo.com/yui/license.html
2101+version: 3.3.0
2102+build: 3167
2103+*/
2104+html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}
2105\ No newline at end of file
2106
2107=== added file 'documentation/style/scratch.css'
2108--- documentation/style/scratch.css 1970-01-01 00:00:00 +0000
2109+++ documentation/style/scratch.css 2013-04-08 10:35:25 +0000
2110@@ -0,0 +1,61 @@
2111+body {
2112+ margin: 0;
2113+}
2114+
2115+
2116+div.toc ul {
2117+ padding: 0;
2118+}
2119+
2120+div.toc li {
2121+ margin-bottom: 3px;
2122+}
2123+
2124+h1.title {
2125+ font-size: 36px;
2126+ line-height: 1.1;
2127+ font-weight: normal;
2128+}
2129+h0, h2 {
2130+ font-size: 24px;
2131+ line-height: 1.2;
2132+ margin: 14px 0;
2133+ font-weight: normal;
2134+ display: block;
2135+}
2136+a:hover {
2137+ color: #dd4814;
2138+ text-decoration: underline;
2139+ outline: 0;
2140+}
2141+table, pre {
2142+ border-radius: 0;
2143+}
2144+
2145+.annotated td {
2146+ padding: 0.8em 1em 0.3em;
2147+}
2148+.wrapper {
2149+ width: 940px;
2150+ margin: 0 auto;
2151+}
2152+.main-content {
2153+ width: 668px;
2154+ position: relative;
2155+ left: 270px;
2156+}
2157+.title {
2158+ margin-left: -270px;
2159+ margin-top: 30px;
2160+ margin-bottom: 50px;
2161+}
2162+.toc {
2163+ margin-left: -270px;
2164+ font-size: 100%;
2165+ margin-bottom: 40px;
2166+ padding: 0;
2167+ z-index: 2;
2168+ position: absolute;
2169+ top: 100px;
2170+ width: 250px;
2171+}
2172
2173=== modified file 'documentation/u1db.qdocconf'
2174--- documentation/u1db.qdocconf 2013-04-04 13:54:32 +0000
2175+++ documentation/u1db.qdocconf 2013-04-08 10:35:25 +0000
2176@@ -16,18 +16,45 @@
2177 Q_FLAGS \
2178 QT_PREPEND_NAMESPACE_U1DB \
2179 Q_DISABLE_COPY
2180-exampledirs = ../examples
2181+exampledirs = ../examples/u1db-qt-example-1 \
2182+../examples/u1db-qt-example-2 \
2183+../examples/u1db-qt-example-2b \
2184+../examples/u1db-qt-example-3 \
2185+../examples/u1db-qt-example-4 \
2186+../examples/u1db-qt-example-5
2187+
2188 imagedirs = images
2189
2190 sources.fileextensions = "*.cpp *.qdoc *.mm *.qml"
2191 headers.fileextensions = "*.h *.ch *.h++ *.hh *.hpp *.hxx"
2192-examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml"
2193+examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp"
2194 examples.imageextensions = "*.png *.jpeg *.jpg *.gif *.mng"
2195
2196 outputdir = output/html
2197 outputformats = HTML
2198 syntaxhighlighting = true
2199-HTML.stylesheets = base.css
2200+
2201+HTML.postheader = "<div class=\"wrapper\">\n" \
2202+ "<div class=\"main-content\">\n"
2203+
2204+HTML.footer = "</div>\n" \
2205+"</div>\n"
2206+
2207+HTML.headerstyles = "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/css.css\">\n" \
2208+"<link rel=\"stylesheet\" type=\"text/css\" href=\"style/css_002.css\">\n" \
2209+"<link rel=\"stylesheet\" type=\"text/css\" href=\"style/reset.css\">\n" \
2210+"<link rel=\"stylesheet\" type=\"text/css\" href=\"style/qtquick.css\">\n" \
2211+"<link rel=\"stylesheet\" type=\"text/css\" href=\"style/base.css\">\n" \
2212+"<link rel=\"stylesheet\" type=\"text/css\" href=\"style/scratch.css\">\n"
2213+
2214+
2215+HTML.stylesheets = style/base.css \
2216+style/css.css \
2217+style/css_002.css \
2218+style/reset.css \
2219+style/qtquick.css \
2220+style/base.css \
2221+style/scratch.css \
2222
2223 qhp.projects = U1DbQt
2224 qhp.U1DbQt.file = u1dbqt.qhp
2225
2226=== added directory 'examples/u1db-qt-example-1'
2227=== removed file 'examples/u1db-qt-example-1.qml'
2228--- examples/u1db-qt-example-1.qml 2013-03-28 07:57:31 +0000
2229+++ examples/u1db-qt-example-1.qml 1970-01-01 00:00:00 +0000
2230@@ -1,98 +0,0 @@
2231-/*
2232- * Copyright (C) 2013 Canonical, Ltd.
2233- *
2234- * Authors:
2235- * Kevin Wright <kevin.wright@canonical.com>
2236- *
2237- * This program is free software; you can redistribute it and/or modify
2238- * it under the terms of the GNU Lesser General Public License as published by
2239- * the Free Software Foundation; version 3.
2240- *
2241- * This program is distributed in the hope that it will be useful,
2242- * but WITHOUT ANY WARRANTY; without even the implied warranty of
2243- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2244- * GNU Lesser General Public License for more details.
2245- *
2246- * You should have received a copy of the GNU Lesser General Public License
2247- * along with this program. If not, see <http://www.gnu.org/licenses/>.
2248- */
2249-
2250-import QtQuick 2.0
2251-import U1db 1.0 as U1db
2252-import Ubuntu.Components 0.1
2253-
2254-
2255-MainView {
2256-
2257- id: u1dbView
2258- width: units.gu(45)
2259- height: units.gu(80)
2260-
2261- /*!
2262-
2263- 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.
2264-
2265- */
2266-
2267- U1db.Database {
2268- id: aDatabase
2269- path: "aDatabase1"
2270- }
2271-
2272- /*!
2273-
2274- A Document can be declared at runtime. It requires at the very least a unique 'docId', but that alone won't do anything special. In order for a document to be entered into the database the below snippet demonstrates the basic requirements. The id might be optional.
2275-
2276-
2277- */
2278-
2279- U1db.Document {
2280- id: aDocument
2281- database: aDatabase
2282- docId: 'helloworld'
2283- create: true
2284- defaults: { "hello": "Hello World!" }
2285- }
2286-
2287- Tabs {
2288- id: tabs
2289- anchors.fill: parent
2290-
2291- Tab {
2292- objectName: "Tab1"
2293-
2294- title: i18n.tr("Hello U1Db!")
2295-
2296- page: Page {
2297- id: helloPage
2298- ListView {
2299- width: units.gu(45)
2300- height: units.gu(80)
2301-
2302- /*
2303- Here is the reference to the Database model mentioned earlier.
2304- */
2305- model: aDatabase
2306-
2307- /* A delegate will be created for each Document retrieved from the Database */
2308- delegate: Text {
2309- x: 66; y: 77
2310- text: {
2311- /*!
2312- The object called 'contents' contains a string as demonstrated here. In this example 'hello' is our search string.
2313-
2314- text: contents.hello
2315- */
2316- text: contents.hello
2317- }
2318- }
2319- }
2320- }
2321-
2322-
2323- }
2324-
2325-
2326- }
2327-
2328-}
2329
2330=== added file 'examples/u1db-qt-example-1/u1db-qt-example-1.qdoc'
2331--- examples/u1db-qt-example-1/u1db-qt-example-1.qdoc 1970-01-01 00:00:00 +0000
2332+++ examples/u1db-qt-example-1/u1db-qt-example-1.qdoc 2013-04-08 10:35:25 +0000
2333@@ -0,0 +1,24 @@
2334+/*
2335+ * Copyright (C) 2013 Canonical, Ltd.
2336+ *
2337+ * Authors:
2338+ * Kevin Wright <kevin.wright@canonical.com>
2339+ *
2340+ * This program is free software; you can redistribute it and/or modify
2341+ * it under the terms of the GNU Lesser General Public License as published by
2342+ * the Free Software Foundation; version 3.
2343+ *
2344+ * This program is distributed in the hope that it will be useful,
2345+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2346+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2347+ * GNU Lesser General Public License for more details.
2348+ *
2349+ * You should have received a copy of the GNU Lesser General Public License
2350+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2351+ */
2352+
2353+/*!
2354+
2355+\example u1db-qt-example-1
2356+
2357+*/
2358
2359=== added file 'examples/u1db-qt-example-1/u1db-qt-example-1.qml'
2360--- examples/u1db-qt-example-1/u1db-qt-example-1.qml 1970-01-01 00:00:00 +0000
2361+++ examples/u1db-qt-example-1/u1db-qt-example-1.qml 2013-04-08 10:35:25 +0000
2362@@ -0,0 +1,98 @@
2363+/*
2364+ * Copyright (C) 2013 Canonical, Ltd.
2365+ *
2366+ * Authors:
2367+ * Kevin Wright <kevin.wright@canonical.com>
2368+ *
2369+ * This program is free software; you can redistribute it and/or modify
2370+ * it under the terms of the GNU Lesser General Public License as published by
2371+ * the Free Software Foundation; version 3.
2372+ *
2373+ * This program is distributed in the hope that it will be useful,
2374+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2375+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2376+ * GNU Lesser General Public License for more details.
2377+ *
2378+ * You should have received a copy of the GNU Lesser General Public License
2379+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2380+ */
2381+
2382+import QtQuick 2.0
2383+import U1db 1.0 as U1db
2384+import Ubuntu.Components 0.1
2385+
2386+
2387+MainView {
2388+
2389+ id: u1dbView
2390+ width: units.gu(45)
2391+ height: units.gu(80)
2392+
2393+ /*!
2394+
2395+ 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.
2396+
2397+ */
2398+
2399+ U1db.Database {
2400+ id: aDatabase
2401+ path: "aDatabase1"
2402+ }
2403+
2404+ /*!
2405+
2406+ A Document can be declared at runtime. It requires at the very least a unique 'docId', but that alone won't do anything special. In order for a document to be entered into the database the below snippet demonstrates the basic requirements. The id might be optional.
2407+
2408+
2409+ */
2410+
2411+ U1db.Document {
2412+ id: aDocument
2413+ database: aDatabase
2414+ docId: 'helloworld'
2415+ create: true
2416+ defaults: { "hello": "Hello World!" }
2417+ }
2418+
2419+ Tabs {
2420+ id: tabs
2421+ anchors.fill: parent
2422+
2423+ Tab {
2424+ objectName: "Tab1"
2425+
2426+ title: i18n.tr("Hello U1Db!")
2427+
2428+ page: Page {
2429+ id: helloPage
2430+ ListView {
2431+ width: units.gu(45)
2432+ height: units.gu(80)
2433+
2434+ /*
2435+ Here is the reference to the Database model mentioned earlier.
2436+ */
2437+ model: aDatabase
2438+
2439+ /* A delegate will be created for each Document retrieved from the Database */
2440+ delegate: Text {
2441+ x: 66; y: 77
2442+ text: {
2443+ /*!
2444+ The object called 'contents' contains a string as demonstrated here. In this example 'hello' is our search string.
2445+
2446+ text: contents.hello
2447+ */
2448+ text: contents.hello
2449+ }
2450+ }
2451+ }
2452+ }
2453+
2454+
2455+ }
2456+
2457+
2458+ }
2459+
2460+}
2461
2462=== added directory 'examples/u1db-qt-example-2'
2463=== removed file 'examples/u1db-qt-example-2.qml'
2464--- examples/u1db-qt-example-2.qml 2013-03-28 07:57:31 +0000
2465+++ examples/u1db-qt-example-2.qml 1970-01-01 00:00:00 +0000
2466@@ -1,100 +0,0 @@
2467-/*
2468- * Copyright (C) 2013 Canonical, Ltd.
2469- *
2470- * Authors:
2471- * Kevin Wright <kevin.wright@canonical.com>
2472- *
2473- * This program is free software; you can redistribute it and/or modify
2474- * it under the terms of the GNU Lesser General Public License as published by
2475- * the Free Software Foundation; version 3.
2476- *
2477- * This program is distributed in the hope that it will be useful,
2478- * but WITHOUT ANY WARRANTY; without even the implied warranty of
2479- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2480- * GNU Lesser General Public License for more details.
2481- *
2482- * You should have received a copy of the GNU Lesser General Public License
2483- * along with this program. If not, see <http://www.gnu.org/licenses/>.
2484- */
2485-
2486-import QtQuick 2.0
2487-import U1db 1.0 as U1db
2488-import Ubuntu.Components 0.1
2489-
2490-
2491-MainView {
2492-
2493- id: u1dbView
2494- width: units.gu(45)
2495- height: units.gu(80)
2496-
2497- /*!
2498-
2499- 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.
2500-
2501- */
2502-
2503- U1db.Database {
2504- id: aDatabase
2505- path: "aDatabase2"
2506- }
2507-
2508- Timer {
2509-
2510- property int i: 0; interval: 5000; running: true; repeat: true
2511- onTriggered: newDocumentObject()
2512-
2513- function newDocumentObject() {
2514-
2515- var qmlString = "import QtQuick 2.0; import U1db 1.0 as U1db; U1db.Document {id: aDcoument"+i+";database: aDatabase;docId: 'helloworld"+i+"';create: true; defaults: { 'hello': 'Hello New Document "+i+"!' }}"
2516-
2517- Qt.createQmlObject(qmlString, u1dbView, "dynamicNewDocument"+i);
2518-
2519- i = i+1
2520- }
2521-
2522- }
2523-
2524- Tabs {
2525- id: tabs
2526- anchors.fill: parent
2527-
2528- Tab {
2529- objectName: "Tab1"
2530-
2531- title: i18n.tr("Hello U1Db!")
2532-
2533- page: Page {
2534- id: helloPage
2535- ListView {
2536- width: units.gu(45)
2537- height: units.gu(80)
2538-
2539- /*
2540- Here is the reference to the Database model mentioned earlier.
2541- */
2542- model: aDatabase
2543-
2544- /* A delegate will be created for each Document retrieved from the Database */
2545- delegate: Text {
2546- x: 66; y: 77
2547- text: {
2548- /*!
2549- The object called 'contents' contains a string as demonstrated here. In this example 'hello' is our search string.
2550-
2551- text: contents.hello
2552- */
2553-
2554- text: contents.hello
2555- }
2556- }
2557- }
2558- }
2559-
2560-
2561- }
2562-
2563-
2564- }
2565-
2566-}
2567
2568=== added file 'examples/u1db-qt-example-2/u1db-qt-example-2.qdoc'
2569--- examples/u1db-qt-example-2/u1db-qt-example-2.qdoc 1970-01-01 00:00:00 +0000
2570+++ examples/u1db-qt-example-2/u1db-qt-example-2.qdoc 2013-04-08 10:35:25 +0000
2571@@ -0,0 +1,24 @@
2572+/*
2573+ * Copyright (C) 2013 Canonical, Ltd.
2574+ *
2575+ * Authors:
2576+ * Kevin Wright <kevin.wright@canonical.com>
2577+ *
2578+ * This program is free software; you can redistribute it and/or modify
2579+ * it under the terms of the GNU Lesser General Public License as published by
2580+ * the Free Software Foundation; version 3.
2581+ *
2582+ * This program is distributed in the hope that it will be useful,
2583+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2584+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2585+ * GNU Lesser General Public License for more details.
2586+ *
2587+ * You should have received a copy of the GNU Lesser General Public License
2588+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2589+ */
2590+
2591+/*!
2592+
2593+\example u1db-qt-example-2
2594+
2595+*/
2596
2597=== added file 'examples/u1db-qt-example-2/u1db-qt-example-2.qml'
2598--- examples/u1db-qt-example-2/u1db-qt-example-2.qml 1970-01-01 00:00:00 +0000
2599+++ examples/u1db-qt-example-2/u1db-qt-example-2.qml 2013-04-08 10:35:25 +0000
2600@@ -0,0 +1,99 @@
2601+/*
2602+ * Copyright (C) 2013 Canonical, Ltd.
2603+ *
2604+ * Authors:
2605+ * Kevin Wright <kevin.wright@canonical.com>
2606+ *
2607+ * This program is free software; you can redistribute it and/or modify
2608+ * it under the terms of the GNU Lesser General Public License as published by
2609+ * the Free Software Foundation; version 3.
2610+ *
2611+ * This program is distributed in the hope that it will be useful,
2612+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2613+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2614+ * GNU Lesser General Public License for more details.
2615+ *
2616+ * You should have received a copy of the GNU Lesser General Public License
2617+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2618+ */
2619+
2620+import QtQuick 2.0
2621+import U1db 1.0 as U1db
2622+import Ubuntu.Components 0.1
2623+
2624+MainView {
2625+
2626+ id: u1dbView
2627+ width: units.gu(45)
2628+ height: units.gu(80)
2629+
2630+ /*!
2631+
2632+ 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.
2633+
2634+ */
2635+
2636+ U1db.Database {
2637+ id: aDatabase
2638+ path: "aDatabase2"
2639+ }
2640+
2641+ Timer {
2642+
2643+ property int i: 0; interval: 5000; running: true; repeat: true
2644+ onTriggered: newDocumentObject()
2645+
2646+ function newDocumentObject() {
2647+
2648+ var qmlString = "import QtQuick 2.0; import U1db 1.0 as U1db; U1db.Document {id: aDcoument"+i+";database: aDatabase;docId: 'helloworld"+i+"';create: true; defaults: { 'hello': 'Hello New Document "+i+"!' }}"
2649+
2650+ Qt.createQmlObject(qmlString, u1dbView, "dynamicNewDocument"+i);
2651+
2652+ i = i+1
2653+ }
2654+
2655+ }
2656+
2657+ Tabs {
2658+ id: tabs
2659+ anchors.fill: parent
2660+
2661+ Tab {
2662+ objectName: "Tab1"
2663+
2664+ title: i18n.tr("Hello U1Db!")
2665+
2666+ page: Page {
2667+ id: helloPage
2668+ ListView {
2669+ width: units.gu(45)
2670+ height: units.gu(80)
2671+
2672+ /*
2673+ Here is the reference to the Database model mentioned earlier.
2674+ */
2675+ model: aDatabase
2676+
2677+ /* A delegate will be created for each Document retrieved from the Database */
2678+ delegate: Text {
2679+ x: 66; y: 77
2680+ text: {
2681+ /*!
2682+ The object called 'contents' contains a string as demonstrated here. In this example 'hello' is our search string.
2683+
2684+ text: contents.hello
2685+ */
2686+
2687+ text: contents.hello
2688+ }
2689+ }
2690+ }
2691+ }
2692+
2693+
2694+ }
2695+
2696+
2697+ }
2698+
2699+}
2700
2701=== added directory 'examples/u1db-qt-example-2b'
2702=== removed file 'examples/u1db-qt-example-2b.qml'
2703--- examples/u1db-qt-example-2b.qml 2013-03-28 07:57:31 +0000
2704+++ examples/u1db-qt-example-2b.qml 1970-01-01 00:00:00 +0000
2705@@ -1,110 +0,0 @@
2706-/*
2707- * Copyright (C) 2013 Canonical, Ltd.
2708- *
2709- * Authors:
2710- * Kevin Wright <kevin.wright@canonical.com>
2711- *
2712- * This program is free software; you can redistribute it and/or modify
2713- * it under the terms of the GNU Lesser General Public License as published by
2714- * the Free Software Foundation; version 3.
2715- *
2716- * This program is distributed in the hope that it will be useful,
2717- * but WITHOUT ANY WARRANTY; without even the implied warranty of
2718- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2719- * GNU Lesser General Public License for more details.
2720- *
2721- * You should have received a copy of the GNU Lesser General Public License
2722- * along with this program. If not, see <http://www.gnu.org/licenses/>.
2723- */
2724-
2725-import QtQuick 2.0
2726-import U1db 1.0 as U1db
2727-import Ubuntu.Components 0.1
2728-
2729-/*!
2730-
2731-This example demonstrates how to create and query one level of sub-fields in a document.
2732-
2733-*/
2734-
2735-MainView {
2736-
2737- id: u1dbView
2738- width: units.gu(45)
2739- height: units.gu(80)
2740-
2741- U1db.Database {
2742- id: aDatabase
2743- path: "aDatabase2b"
2744- }
2745-
2746- /*!
2747-
2748- This snippet demonstrates how to create content that includes nested fields. The main field is 'hello', while the sub-field for each entry is 'value'. Later in the example it will be shown how to access each of these in the delegate of a ListView.
2749-
2750- U1db.Document {
2751- id: aDocument
2752- database: aDatabase
2753- docId: 'hello'
2754- create: true
2755- defaults: { "hello": [{"value":"99 Hello Worlds on the wall...!"},{"value":"98 Hello Worlds on the wall...!"},{"value":"97 Hello Worlds on the wall...!"},{"value":"...and so on..."}] }
2756- }
2757-
2758- */
2759-
2760- U1db.Document {
2761- id: aDocument
2762- database: aDatabase
2763- docId: 'hello'
2764- create: true
2765- defaults: { "hello": [{"value":"99 Hello Worlds on the wall...!"},{"value":"98 Hello Worlds on the wall...!"},{"value":"97 Hello Worlds on the wall...!"},{"value":"...and so on..."}] }
2766- }
2767-
2768- Tabs {
2769- id: tabs
2770- anchors.fill: parent
2771-
2772- Tab {
2773- objectName: "Tab1"
2774-
2775- title: i18n.tr("Hello U1Db!")
2776-
2777- page: Page {
2778-
2779- id: helloPage
2780-
2781- ListView {
2782- width: units.gu(45)
2783- height: units.gu(80)
2784- anchors.fill: parent
2785- model: aDocument.contents.hello
2786-
2787- /*!
2788-
2789- Determining the current record is easy. All that is required is to access it using the delegate's own 'index' value, as shown here:
2790-
2791- delegate: Text {
2792- height: 30
2793- text: aDocument.contents.hello[index].value
2794- }
2795-
2796-
2797- Remember that when the entries were created the sub-field was 'value'. So where index = 0, 'aDocument.contents.hello[0].value' will produce '99 Hello Worlds on the wall...!'. Each entry in the document will in turn create its own delegate with a new index number, which can then be used to extract the 'value' (or whatever other sub-field has been created).
2798-
2799- */
2800-
2801- delegate: Text {
2802- height: 30
2803- text: aDocument.contents.hello[index].value
2804- }
2805-
2806- }
2807-
2808- }
2809-
2810- }
2811-
2812-
2813- }
2814-}
2815-
2816
2817=== added file 'examples/u1db-qt-example-2b/u1db-qt-example-2b.qdoc'
2818--- examples/u1db-qt-example-2b/u1db-qt-example-2b.qdoc 1970-01-01 00:00:00 +0000
2819+++ examples/u1db-qt-example-2b/u1db-qt-example-2b.qdoc 2013-04-08 10:35:25 +0000
2820@@ -0,0 +1,24 @@
2821+/*
2822+ * Copyright (C) 2013 Canonical, Ltd.
2823+ *
2824+ * Authors:
2825+ * Kevin Wright <kevin.wright@canonical.com>
2826+ *
2827+ * This program is free software; you can redistribute it and/or modify
2828+ * it under the terms of the GNU Lesser General Public License as published by
2829+ * the Free Software Foundation; version 3.
2830+ *
2831+ * This program is distributed in the hope that it will be useful,
2832+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2833+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2834+ * GNU Lesser General Public License for more details.
2835+ *
2836+ * You should have received a copy of the GNU Lesser General Public License
2837+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2838+ */
2839+
2840+/*!
2841+
2842+\example u1db-qt-example-2b
2843+
2844+*/
2845
2846=== added file 'examples/u1db-qt-example-2b/u1db-qt-example-2b.qml'
2847--- examples/u1db-qt-example-2b/u1db-qt-example-2b.qml 1970-01-01 00:00:00 +0000
2848+++ examples/u1db-qt-example-2b/u1db-qt-example-2b.qml 2013-04-08 10:35:25 +0000
2849@@ -0,0 +1,111 @@
2850+/*
2851+ * Copyright (C) 2013 Canonical, Ltd.
2852+ *
2853+ * Authors:
2854+ * Kevin Wright <kevin.wright@canonical.com>
2855+ *
2856+ * This program is free software; you can redistribute it and/or modify
2857+ * it under the terms of the GNU Lesser General Public License as published by
2858+ * the Free Software Foundation; version 3.
2859+ *
2860+ * This program is distributed in the hope that it will be useful,
2861+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2862+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2863+ * GNU Lesser General Public License for more details.
2864+ *
2865+ * You should have received a copy of the GNU Lesser General Public License
2866+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2867+ */
2868+
2869+import QtQuick 2.0
2870+import U1db 1.0 as U1db
2871+import Ubuntu.Components 0.1
2872+
2873+
2874+/*!
2875+
2876+This example demonstrates how to create and query one level of sub-fields in a document.
2877+
2878+*/
2879+
2880+MainView {
2881+
2882+ id: u1dbView
2883+ width: units.gu(45)
2884+ height: units.gu(80)
2885+
2886+ U1db.Database {
2887+ id: aDatabase
2888+ path: "aDatabase2b"
2889+ }
2890+
2891+ /*!
2892+
2893+ This snippet demonstrates how to create content that includes nested fields. The main field is 'hello', while the sub-field for each entry is 'value'. Later in the example it will be shown how to access each of these in the delegate of a ListView.
2894+
2895+ U1db.Document {
2896+ id: aDocument
2897+ database: aDatabase
2898+ docId: 'hello'
2899+ create: true
2900+ defaults: { "hello": [{"value":"99 Hello Worlds on the wall...!"},{"value":"98 Hello Worlds on the wall...!"},{"value":"97 Hello Worlds on the wall...!"},{"value":"...and so on..."}] }
2901+ }
2902+
2903+ */
2904+
2905+ U1db.Document {
2906+ id: aDocument
2907+ database: aDatabase
2908+ docId: 'hello'
2909+ create: true
2910+ defaults: { "hello": [{"value":"99 Hello Worlds on the wall...!"},{"value":"98 Hello Worlds on the wall...!"},{"value":"97 Hello Worlds on the wall...!"},{"value":"...and so on..."}] }
2911+ }
2912+
2913+ Tabs {
2914+ id: tabs
2915+ anchors.fill: parent
2916+
2917+ Tab {
2918+ objectName: "Tab1"
2919+
2920+ title: i18n.tr("Hello U1Db!")
2921+
2922+ page: Page {
2923+
2924+ id: helloPage
2925+
2926+ ListView {
2927+ width: units.gu(45)
2928+ height: units.gu(80)
2929+ anchors.fill: parent
2930+ model: aDocument.contents.hello
2931+
2932+ /*!
2933+
2934+ Determining the current record is easy. All that is required is to access it using the delegate's own 'index' value, as shown here:
2935+
2936+ delegate: Text {
2937+ height: 30
2938+ text: aDocument.contents.hello[index].value
2939+ }
2940+
2941+
2942+ Remember that when the entries were created the sub-field was 'value'. So where index = 0, 'aDocument.contents.hello[0].value' will produce '99 Hello Worlds on the wall...!'. Each entry in the document will in turn create its own delegate with a new index number, which can then be used to extract the 'value' (or whatever other sub-field has been created).
2943+
2944+ */
2945+
2946+ delegate: Text {
2947+ height: 30
2948+ text: aDocument.contents.hello[index].value
2949+ }
2950+
2951+ }
2952+
2953+ }
2954+
2955+ }
2956+
2957+
2958+ }
2959+}
2960+
2961
2962=== added directory 'examples/u1db-qt-example-3'
2963=== removed file 'examples/u1db-qt-example-3.qml'
2964--- examples/u1db-qt-example-3.qml 2013-03-28 07:57:31 +0000
2965+++ examples/u1db-qt-example-3.qml 1970-01-01 00:00:00 +0000
2966@@ -1,479 +0,0 @@
2967-/*
2968- * Copyright (C) 2013 Canonical, Ltd.
2969- *
2970- * Authors:
2971- * Kevin Wright <kevin.wright@canonical.com>
2972- *
2973- * This program is free software; you can redistribute it and/or modify
2974- * it under the terms of the GNU Lesser General Public License as published by
2975- * the Free Software Foundation; version 3.
2976- *
2977- * This program is distributed in the hope that it will be useful,
2978- * but WITHOUT ANY WARRANTY; without even the implied warranty of
2979- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2980- * GNU Lesser General Public License for more details.
2981- *
2982- * You should have received a copy of the GNU Lesser General Public License
2983- * along with this program. If not, see <http://www.gnu.org/licenses/>.
2984- */
2985-
2986-import QtQuick 2.0
2987-import U1db 1.0 as U1db
2988-import Ubuntu.Components 0.1
2989-
2990-/*!
2991-
2992-This example and tutorial is designed to show a wide variety of U1Db-Qt functionality and usage. The example demonstrates:
2993-
2994-\list 1
2995- \li Combining U1Db-Qt with elements and components that do not utilize models
2996- \li Blending the U1Db-Qt plugin with QML and Javascript
2997-\endlist
2998-
2999- */
3000-
3001-Item {
3002-
3003- width: units.gu(45)
3004- height: units.gu(80)
3005-
3006- /*!
3007-
3008- 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.
3009-
3010- U1db.Database {
3011- id: aDatabase
3012- path: "aDatabase3"
3013- }
3014-
3015- */
3016-
3017- U1db.Database {
3018- id: aDatabase
3019- path: "aDatabase3"
3020- }
3021-
3022- /*!
3023-
3024- 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.
3025-
3026- 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.
3027-
3028- U1db.Document {
3029- id: aDocument
3030- database: aDatabase
3031- docId: 'helloworld'
3032- create: true
3033- defaults: { "helloworld":"Hello World" }
3034-
3035- Component.onCompleted: {
3036- documentContent.text = aDocument.contents.helloworld
3037- }
3038-
3039- }
3040-
3041- */
3042-
3043- U1db.Document {
3044- id: aDocument
3045- database: aDatabase
3046- docId: 'helloworld'
3047- create: true
3048- defaults: { "helloworld":"Hello World" }
3049-
3050- Component.onCompleted: {
3051- documentContent.text = aDocument.contents.helloworld
3052- }
3053-
3054- }
3055-
3056- function switchToPreviousDocument(documentObject){
3057-
3058- aDocument.docId = getPreviousDocumentId(documentObject)
3059-
3060- }
3061-
3062- function switchToNextDocument(){
3063-
3064- aDocument.docId = getNextDocumentId(aDocument)
3065-
3066- }
3067-
3068-
3069- function getPreviousDocumentId(documentObject){
3070-
3071- if(typeof documentObject!='undefined'){
3072-
3073- /*!
3074-
3075- 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.
3076-
3077- var documentIds = {}
3078-
3079- documentIds = documentObject.database.listDocs()
3080-
3081- for(var i = 0; i < documentIds.length; i++){
3082-
3083- if(documentIds[i]===documentObject.docId && i > 0){
3084- return documentIds[i-1]
3085- }
3086- else if(documentIds[i]===documentObject.docId && i==0){
3087- return documentIds[documentIds.length-1]
3088- }
3089-
3090- }
3091-
3092- */
3093-
3094- var documentIds = {}
3095-
3096- documentIds = documentObject.database.listDocs()
3097-
3098- for(var i = 0; i < documentIds.length; i++){
3099-
3100- if(documentIds[i]===documentObject.docId && i > 0){
3101- return documentIds[i-1]
3102- }
3103- else if(documentIds[i]===documentObject.docId && i==0){
3104- return documentIds[documentIds.length-1]
3105- }
3106-
3107- }
3108-
3109- return documentIds[0]
3110-
3111- }
3112-
3113- else{
3114-
3115- print("Error!")
3116-
3117- return ''
3118- }
3119-
3120-
3121- }
3122-
3123- function getNextDocumentId(documentObject){
3124-
3125- if(typeof documentObject!='undefined'){
3126-
3127- var documentIds = documentObject.database.listDocs()
3128-
3129- for(var i = 0; i < documentIds.length; i++){
3130-
3131- if(documentIds[i]===documentObject.docId && i < (documentIds.length-1)){
3132- return documentIds[i+1]
3133- }
3134- else if(documentIds[i]===documentObject.docId && i==(documentIds.length-1)){
3135- return documentIds[0]
3136- }
3137-
3138- }
3139-
3140- return documentIds[0]
3141-
3142- }
3143-
3144- else{
3145-
3146- print("Error!")
3147-
3148- return ''
3149- }
3150-
3151-
3152- }
3153-
3154- function getCurrentDocumentKey(contentsObject){
3155-
3156- if(typeof contentsObject!='undefined'){
3157-
3158- var keys = Object.keys(contentsObject);
3159-
3160- return keys[0]
3161-
3162- }
3163-
3164- else{
3165-
3166- return ''
3167- }
3168-
3169-
3170-
3171- }
3172-
3173-
3174- function updateContentWindow(documentText, addressBarText) {
3175-
3176- // Somewhere below need to check for things like invalid docId
3177-
3178- if(documentText!==addressBarText) {
3179-
3180- /*!
3181-
3182- 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.
3183-
3184- var tempDocument = {}
3185- var tempFieldName = addressBarText;
3186- var tempContents = {};
3187-
3188- tempDocument = aDocument
3189- tempDocument.docId = addressBarText;
3190-
3191- tempContents = tempDocument.contents
3192-
3193- 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.
3194-
3195- */
3196-
3197- var tempDocument = {}
3198- var tempFieldName = addressBarText;
3199- var tempContents = {};
3200-
3201- tempDocument = aDocument
3202- tempDocument.docId = addressBarText;
3203-
3204- tempContents = tempDocument.contents
3205-
3206- if(typeof tempContents !='undefined' && typeof tempContents[tempFieldName]!='undefined') {
3207-
3208- aDocument = tempDocument
3209- documentContent.text = tempContents[tempFieldName]
3210-
3211- }
3212- else {
3213-
3214- /*!
3215-
3216- Here the contents of the temporary document are modified, which then replaces the global document.
3217-
3218- documentContent.text = 'More Hello World...';
3219-
3220- tempContents = {}
3221- tempContents[tempFieldName] = documentContent.text
3222- tempDocument.contents = tempContents
3223- aDocument = tempDocument
3224-
3225- */
3226-
3227- documentContent.text = 'More Hello World...';
3228-
3229- tempContents = {}
3230- tempContents[tempFieldName] = documentContent.text
3231- tempDocument.contents = tempContents
3232- aDocument = tempDocument
3233-
3234- }
3235-
3236- }
3237- else {
3238-
3239- /*!
3240-
3241- 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.
3242-
3243- tempContents = {}
3244- tempFieldName = getCurrentDocumentKey(aDocument.contents)
3245- tempContents[tempFieldName] = documentContent.text
3246- aDocument.contents = tempContents
3247-
3248- */
3249-
3250- tempContents = {}
3251- tempFieldName = getCurrentDocumentKey(aDocument.contents)
3252- tempContents[tempFieldName] = documentContent.text
3253- aDocument.contents = tempContents
3254-
3255- }
3256-
3257- }
3258-
3259- MainView {
3260-
3261- id: u1dbView
3262- width: units.gu(45)
3263- height: units.gu(80)
3264- anchors.top: parent.top;
3265-
3266- Tabs {
3267- id: tabs
3268- anchors.fill: parent
3269-
3270- Tab {
3271- objectName: "Tab1"
3272-
3273- title: i18n.tr("Hello U1Db!")
3274-
3275- page: Page {
3276-
3277- id: helloPage
3278-
3279- /*! Here a rectangle is defined that represents the lower portion of our application. It will contain all the main parts of the application.
3280-
3281- Rectangle {
3282-
3283- width: units.gu(45)
3284- height: units.gu(70)
3285- anchors.bottom: parent.bottom
3286-
3287- color: "#00FFFFFF"
3288-
3289- // The remainder of the main part of the application goes here ...
3290-
3291- }
3292-
3293- */
3294-
3295- Rectangle {
3296-
3297- width: units.gu(45)
3298- height: units.gu(70)
3299- anchors.bottom: parent.bottom
3300-
3301- color: "#00FFFFFF"
3302-
3303- Rectangle {
3304-
3305- width: units.gu(45)
3306- height: units.gu(60)
3307- anchors.bottom: parent.bottom
3308-
3309- /*!
3310-
3311- 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.
3312-
3313- TextArea{
3314-
3315- id: documentContent
3316-
3317- selectByMouse : false
3318-
3319- x: units.gu(1)
3320- y: units.gu(1)
3321- width: units.gu(43)
3322- height: units.gu(58)
3323- color: "#000000"
3324-
3325- }
3326-
3327- */
3328-
3329- TextArea{
3330-
3331- id: documentContent
3332-
3333- selectByMouse : false
3334-
3335- x: units.gu(1)
3336- y: units.gu(1)
3337- width: units.gu(43)
3338- height: units.gu(58)
3339- color: "#000000"
3340-
3341- }
3342-
3343- }
3344-
3345- // This rectangle contains our navigation controls
3346-
3347- Rectangle {
3348-
3349- width: units.gu(43)
3350- height: units.gu(5)
3351- anchors.top: addressBarArea.bottom
3352- x: units.gu(1.5)
3353- color: "#00FFFFFF"
3354-
3355- Row{
3356-
3357- width: units.gu(43)
3358- height: units.gu(5)
3359- anchors.verticalCenter: parent.verticalCenter
3360- spacing: units.gu(2)
3361-
3362- Button {
3363- text: "<"
3364- onClicked: updateContentWindow(switchToPreviousDocument(aDocument), addressBar.text)
3365- }
3366- Button {
3367- text: "Home"
3368- onClicked: updateContentWindow(getCurrentDocumentKey(aDocument.contents),'helloworld')
3369- }
3370- Button {
3371- text: "Save"
3372- onClicked: updateContentWindow(getCurrentDocumentKey(aDocument.contents),addressBar.text)
3373- }
3374- Button {
3375- text: ">"
3376- onClicked: updateContentWindow(switchToNextDocument(aDocument), addressBar.text)
3377- }
3378-
3379-
3380-
3381- }
3382-
3383- }
3384-
3385- Rectangle {
3386-
3387- id: addressBarArea
3388-
3389- width: units.gu(45)
3390- height: units.gu(5)
3391- anchors.top: parent.top
3392-
3393- TextField {
3394-
3395- id: addressBar
3396-
3397- width: units.gu(43)
3398- anchors.verticalCenter: parent.verticalCenter
3399- x: units.gu(1)
3400-
3401- hasClearButton: false
3402-
3403- /*!
3404- There is an object within in the 'aDocument' model defined earlier called 'contents', which contains a key called 'helloworld', which represents a search string. In our 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:
3405-
3406- text: displayKey(aDocument.contents)
3407-
3408- function displayKey(documentObject){
3409-
3410- var keys = Object.keys(documentObject);
3411-
3412- return keys[0]
3413-
3414- }
3415-
3416- */
3417-
3418- text: getCurrentDocumentKey(aDocument.contents)
3419-
3420-
3421- onAccepted: {
3422-
3423- onClicked: updateContentWindow(getCurrentDocumentKey(aDocument.contents),addressBar.text)
3424-
3425- }
3426-
3427-
3428- }
3429-
3430-
3431- }
3432-
3433-
3434- }
3435-
3436-
3437- }
3438-
3439- }
3440-
3441- }
3442-
3443- }
3444-
3445-}
3446
3447=== added file 'examples/u1db-qt-example-3/u1db-qt-example-3.qdoc'
3448--- examples/u1db-qt-example-3/u1db-qt-example-3.qdoc 1970-01-01 00:00:00 +0000
3449+++ examples/u1db-qt-example-3/u1db-qt-example-3.qdoc 2013-04-08 10:35:25 +0000
3450@@ -0,0 +1,24 @@
3451+/*
3452+ * Copyright (C) 2013 Canonical, Ltd.
3453+ *
3454+ * Authors:
3455+ * Kevin Wright <kevin.wright@canonical.com>
3456+ *
3457+ * This program is free software; you can redistribute it and/or modify
3458+ * it under the terms of the GNU Lesser General Public License as published by
3459+ * the Free Software Foundation; version 3.
3460+ *
3461+ * This program is distributed in the hope that it will be useful,
3462+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3463+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3464+ * GNU Lesser General Public License for more details.
3465+ *
3466+ * You should have received a copy of the GNU Lesser General Public License
3467+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3468+ */
3469+
3470+/*!
3471+
3472+\example u1db-qt-example-3
3473+
3474+*/
3475
3476=== added file 'examples/u1db-qt-example-3/u1db-qt-example-3.qml'
3477--- examples/u1db-qt-example-3/u1db-qt-example-3.qml 1970-01-01 00:00:00 +0000
3478+++ examples/u1db-qt-example-3/u1db-qt-example-3.qml 2013-04-08 10:35:25 +0000
3479@@ -0,0 +1,481 @@
3480+/*
3481+ * Copyright (C) 2013 Canonical, Ltd.
3482+ *
3483+ * Authors:
3484+ * Kevin Wright <kevin.wright@canonical.com>
3485+ *
3486+ * This program is free software; you can redistribute it and/or modify
3487+ * it under the terms of the GNU Lesser General Public License as published by
3488+ * the Free Software Foundation; version 3.
3489+ *
3490+ * This program is distributed in the hope that it will be useful,
3491+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3492+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3493+ * GNU Lesser General Public License for more details.
3494+ *
3495+ * You should have received a copy of the GNU Lesser General Public License
3496+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3497+ */
3498+
3499+import QtQuick 2.0
3500+import U1db 1.0 as U1db
3501+import Ubuntu.Components 0.1
3502+
3503+
3504+
3505+/*!
3506+
3507+This example and tutorial is designed to show a wide variety of U1Db-Qt functionality and usage. The example demonstrates:
3508+
3509+\list 1
3510+ \li Combining U1Db-Qt with elements and components that do not utilize models
3511+ \li Blending the U1Db-Qt plugin with QML and Javascript
3512+\endlist
3513+
3514+ */
3515+
3516+Item {
3517+
3518+ width: units.gu(45)
3519+ height: units.gu(80)
3520+
3521+ /*!
3522+
3523+ 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.
3524+
3525+ U1db.Database {
3526+ id: aDatabase
3527+ path: "aDatabase3"
3528+ }
3529+
3530+ */
3531+
3532+ U1db.Database {
3533+ id: aDatabase
3534+ path: "aDatabase3"
3535+ }
3536+
3537+ /*!
3538+
3539+ 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.
3540+
3541+ 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.
3542+
3543+ U1db.Document {
3544+ id: aDocument
3545+ database: aDatabase
3546+ docId: 'helloworld'
3547+ create: true
3548+ defaults: { "helloworld":"Hello World" }
3549+
3550+ Component.onCompleted: {
3551+ documentContent.text = aDocument.contents.helloworld
3552+ }
3553+
3554+ }
3555+
3556+ */
3557+
3558+ U1db.Document {
3559+ id: aDocument
3560+ database: aDatabase
3561+ docId: 'helloworld'
3562+ create: true
3563+ defaults: { "helloworld":"Hello World" }
3564+
3565+ Component.onCompleted: {
3566+ documentContent.text = aDocument.contents.helloworld
3567+ }
3568+
3569+ }
3570+
3571+ function switchToPreviousDocument(documentObject){
3572+
3573+ aDocument.docId = getPreviousDocumentId(documentObject)
3574+
3575+ }
3576+
3577+ function switchToNextDocument(){
3578+
3579+ aDocument.docId = getNextDocumentId(aDocument)
3580+
3581+ }
3582+
3583+
3584+ function getPreviousDocumentId(documentObject){
3585+
3586+ if(typeof documentObject!='undefined'){
3587+
3588+ /*!
3589+
3590+ 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.
3591+
3592+ var documentIds = {}
3593+
3594+ documentIds = documentObject.database.listDocs()
3595+
3596+ for(var i = 0; i < documentIds.length; i++){
3597+
3598+ if(documentIds[i]===documentObject.docId && i > 0){
3599+ return documentIds[i-1]
3600+ }
3601+ else if(documentIds[i]===documentObject.docId && i==0){
3602+ return documentIds[documentIds.length-1]
3603+ }
3604+
3605+ }
3606+
3607+ */
3608+
3609+ var documentIds = {}
3610+
3611+ documentIds = documentObject.database.listDocs()
3612+
3613+ for(var i = 0; i < documentIds.length; i++){
3614+
3615+ if(documentIds[i]===documentObject.docId && i > 0){
3616+ return documentIds[i-1]
3617+ }
3618+ else if(documentIds[i]===documentObject.docId && i==0){
3619+ return documentIds[documentIds.length-1]
3620+ }
3621+
3622+ }
3623+
3624+ return documentIds[0]
3625+
3626+ }
3627+
3628+ else{
3629+
3630+ print("Error!")
3631+
3632+ return ''
3633+ }
3634+
3635+
3636+ }
3637+
3638+ function getNextDocumentId(documentObject){
3639+
3640+ if(typeof documentObject!='undefined'){
3641+
3642+ var documentIds = documentObject.database.listDocs()
3643+
3644+ for(var i = 0; i < documentIds.length; i++){
3645+
3646+ if(documentIds[i]===documentObject.docId && i < (documentIds.length-1)){
3647+ return documentIds[i+1]
3648+ }
3649+ else if(documentIds[i]===documentObject.docId && i==(documentIds.length-1)){
3650+ return documentIds[0]
3651+ }
3652+
3653+ }
3654+
3655+ return documentIds[0]
3656+
3657+ }
3658+
3659+ else{
3660+
3661+ print("Error!")
3662+
3663+ return ''
3664+ }
3665+
3666+
3667+ }
3668+
3669+ function getCurrentDocumentKey(contentsObject){
3670+
3671+ if(typeof contentsObject!='undefined'){
3672+
3673+ var keys = Object.keys(contentsObject);
3674+
3675+ return keys[0]
3676+
3677+ }
3678+
3679+ else{
3680+
3681+ return ''
3682+ }
3683+
3684+
3685+
3686+ }
3687+
3688+
3689+ function updateContentWindow(documentText, addressBarText) {
3690+
3691+ // Somewhere below need to check for things like invalid docId
3692+
3693+ if(documentText!==addressBarText) {
3694+
3695+ /*!
3696+
3697+ 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.
3698+
3699+ var tempDocument = {}
3700+ var tempFieldName = addressBarText;
3701+ var tempContents = {};
3702+
3703+ tempDocument = aDocument
3704+ tempDocument.docId = addressBarText;
3705+
3706+ tempContents = tempDocument.contents
3707+
3708+ 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.
3709+
3710+ */
3711+
3712+ var tempDocument = {}
3713+ var tempFieldName = addressBarText;
3714+ var tempContents = {};
3715+
3716+ tempDocument = aDocument
3717+ tempDocument.docId = addressBarText;
3718+
3719+ tempContents = tempDocument.contents
3720+
3721+ if(typeof tempContents !='undefined' && typeof tempContents[tempFieldName]!='undefined') {
3722+
3723+ aDocument = tempDocument
3724+ documentContent.text = tempContents[tempFieldName]
3725+
3726+ }
3727+ else {
3728+
3729+ /*!
3730+
3731+ Here the contents of the temporary document are modified, which then replaces the global document.
3732+
3733+ documentContent.text = 'More Hello World...';
3734+
3735+ tempContents = {}
3736+ tempContents[tempFieldName] = documentContent.text
3737+ tempDocument.contents = tempContents
3738+ aDocument = tempDocument
3739+
3740+ */
3741+
3742+ documentContent.text = 'More Hello World...';
3743+
3744+ tempContents = {}
3745+ tempContents[tempFieldName] = documentContent.text
3746+ tempDocument.contents = tempContents
3747+ aDocument = tempDocument
3748+
3749+ }
3750+
3751+ }
3752+ else {
3753+
3754+ /*!
3755+
3756+ 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.
3757+
3758+ tempContents = {}
3759+ tempFieldName = getCurrentDocumentKey(aDocument.contents)
3760+ tempContents[tempFieldName] = documentContent.text
3761+ aDocument.contents = tempContents
3762+
3763+ */
3764+
3765+ tempContents = {}
3766+ tempFieldName = getCurrentDocumentKey(aDocument.contents)
3767+ tempContents[tempFieldName] = documentContent.text
3768+ aDocument.contents = tempContents
3769+
3770+ }
3771+
3772+ }
3773+
3774+ MainView {
3775+
3776+ id: u1dbView
3777+ width: units.gu(45)
3778+ height: units.gu(80)
3779+ anchors.top: parent.top;
3780+
3781+ Tabs {
3782+ id: tabs
3783+ anchors.fill: parent
3784+
3785+ Tab {
3786+ objectName: "Tab1"
3787+
3788+ title: i18n.tr("Hello U1Db!")
3789+
3790+ page: Page {
3791+
3792+ id: helloPage
3793+
3794+ /*! Here a rectangle is defined that represents the lower portion of our application. It will contain all the main parts of the application.
3795+
3796+ Rectangle {
3797+
3798+ width: units.gu(45)
3799+ height: units.gu(70)
3800+ anchors.bottom: parent.bottom
3801+
3802+ color: "#00FFFFFF"
3803+
3804+ // The remainder of the main part of the application goes here ...
3805+
3806+ }
3807+
3808+ */
3809+
3810+ Rectangle {
3811+
3812+ width: units.gu(45)
3813+ height: units.gu(70)
3814+ anchors.bottom: parent.bottom
3815+
3816+ color: "#00FFFFFF"
3817+
3818+ Rectangle {
3819+
3820+ width: units.gu(45)
3821+ height: units.gu(60)
3822+ anchors.bottom: parent.bottom
3823+
3824+ /*!
3825+
3826+ 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.
3827+
3828+ TextArea{
3829+
3830+ id: documentContent
3831+
3832+ selectByMouse : false
3833+
3834+ x: units.gu(1)
3835+ y: units.gu(1)
3836+ width: units.gu(43)
3837+ height: units.gu(58)
3838+ color: "#000000"
3839+
3840+ }
3841+
3842+ */
3843+
3844+ TextArea{
3845+
3846+ id: documentContent
3847+
3848+ selectByMouse : false
3849+
3850+ x: units.gu(1)
3851+ y: units.gu(1)
3852+ width: units.gu(43)
3853+ height: units.gu(58)
3854+ color: "#000000"
3855+
3856+ }
3857+
3858+ }
3859+
3860+ // This rectangle contains our navigation controls
3861+
3862+ Rectangle {
3863+
3864+ width: units.gu(43)
3865+ height: units.gu(5)
3866+ anchors.top: addressBarArea.bottom
3867+ x: units.gu(1.5)
3868+ color: "#00FFFFFF"
3869+
3870+ Row{
3871+
3872+ width: units.gu(43)
3873+ height: units.gu(5)
3874+ anchors.verticalCenter: parent.verticalCenter
3875+ spacing: units.gu(2)
3876+
3877+ Button {
3878+ text: "<"
3879+ onClicked: updateContentWindow(switchToPreviousDocument(aDocument), addressBar.text)
3880+ }
3881+ Button {
3882+ text: "Home"
3883+ onClicked: updateContentWindow(getCurrentDocumentKey(aDocument.contents),'helloworld')
3884+ }
3885+ Button {
3886+ text: "Save"
3887+ onClicked: updateContentWindow(getCurrentDocumentKey(aDocument.contents),addressBar.text)
3888+ }
3889+ Button {
3890+ text: ">"
3891+ onClicked: updateContentWindow(switchToNextDocument(aDocument), addressBar.text)
3892+ }
3893+
3894+
3895+
3896+ }
3897+
3898+ }
3899+
3900+ Rectangle {
3901+
3902+ id: addressBarArea
3903+
3904+ width: units.gu(45)
3905+ height: units.gu(5)
3906+ anchors.top: parent.top
3907+
3908+ TextField {
3909+
3910+ id: addressBar
3911+
3912+ width: units.gu(43)
3913+ anchors.verticalCenter: parent.verticalCenter
3914+ x: units.gu(1)
3915+
3916+ hasClearButton: false
3917+
3918+ /*!
3919+ There is an object within in the 'aDocument' model defined earlier called 'contents', which contains a key called 'helloworld', which represents a search string. In our 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:
3920+
3921+ text: displayKey(aDocument.contents)
3922+
3923+ function displayKey(documentObject){
3924+
3925+ var keys = Object.keys(documentObject);
3926+
3927+ return keys[0]
3928+
3929+ }
3930+
3931+ */
3932+
3933+ text: getCurrentDocumentKey(aDocument.contents)
3934+
3935+
3936+ onAccepted: {
3937+
3938+ onClicked: updateContentWindow(getCurrentDocumentKey(aDocument.contents),addressBar.text)
3939+
3940+ }
3941+
3942+
3943+ }
3944+
3945+
3946+ }
3947+
3948+
3949+ }
3950+
3951+
3952+ }
3953+
3954+ }
3955+
3956+ }
3957+
3958+ }
3959+
3960+}
3961
3962=== added directory 'examples/u1db-qt-example-4'
3963=== removed file 'examples/u1db-qt-example-4.qml'
3964--- examples/u1db-qt-example-4.qml 2013-03-28 07:57:31 +0000
3965+++ examples/u1db-qt-example-4.qml 1970-01-01 00:00:00 +0000
3966@@ -1,516 +0,0 @@
3967-/*
3968- * Copyright (C) 2013 Canonical, Ltd.
3969- *
3970- * Authors:
3971- * Kevin Wright <kevin.wright@canonical.com>
3972- *
3973- * This program is free software; you can redistribute it and/or modify
3974- * it under the terms of the GNU Lesser General Public License as published by
3975- * the Free Software Foundation; version 3.
3976- *
3977- * This program is distributed in the hope that it will be useful,
3978- * but WITHOUT ANY WARRANTY; without even the implied warranty of
3979- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3980- * GNU Lesser General Public License for more details.
3981- *
3982- * You should have received a copy of the GNU Lesser General Public License
3983- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3984- */
3985-
3986-import QtQuick 2.0
3987-import U1db 1.0 as U1db
3988-import Ubuntu.Components 0.1
3989-
3990-/*!
3991-
3992-This example and tutorial is designed to show a wide variety of U1Db-Qt functionality and usage. The example demonstrates:
3993-
3994-\list 1
3995- \li Combining U1Db-Qt with elements and components that do not utilize models
3996- \li Blending the U1Db-Qt plugin with QML and Javascript
3997-\endlist
3998-
3999- */
4000-
4001-Item {
4002-
4003- width: units.gu(45)
4004- height: units.gu(80)
4005-
4006- /*!
4007-
4008- 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.
4009-
4010- U1db.Database {
4011- id: aDatabase
4012- path: "aDatabase4"
4013- }
4014-
4015- */
4016-
4017- U1db.Database {
4018- id: aDatabase
4019- path: "aDatabase4"
4020- }
4021-
4022- /*!
4023-
4024- 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.
4025-
4026- 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.
4027-
4028- U1db.Document {
4029- id: aDocument
4030- database: aDatabase
4031- docId: 'helloworld'
4032- create: true
4033- defaults: { "helloworld":"Hello World" }
4034-
4035- Component.onCompleted: {
4036- documentContent.text = aDocument.contents.helloworld
4037- }
4038-
4039- }
4040-
4041- */
4042-
4043-
4044- U1db.Document {
4045- id: aDocument
4046- database: aDatabase
4047- docId: 'helloworld'
4048- create: true
4049- defaults: { "helloworld":"Hello World" }
4050-
4051- Component.onCompleted: {
4052- documentContent.text = aDocument.contents.helloworld
4053- }
4054-
4055- }
4056-
4057- /*!
4058-
4059- 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.
4060-
4061- U1db.Document {
4062- id: aBookmarkDocument
4063- docId: 'bookmarks'
4064- create: true
4065- defaults: { "bookmarks": [{}] }
4066- }
4067-
4068-
4069- */
4070-
4071-
4072- U1db.Document {
4073- id: aBookmarkDocument
4074- docId: 'bookmarks'
4075- create: true
4076- defaults: { "bookmarks": [{}] }
4077- }
4078-
4079-
4080- function switchToPreviousDocument(documentObject){
4081-
4082- aDocument.docId = getPreviousDocumentId(documentObject)
4083-
4084- }
4085-
4086- function switchToNextDocument(){
4087-
4088- aDocument.docId = getNextDocumentId(aDocument)
4089-
4090- }
4091-
4092- function getPreviousDocumentId(documentObject){
4093-
4094- if(typeof documentObject!='undefined'){
4095-
4096- /*!
4097-
4098- 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.
4099-
4100- var documentIds = {}
4101-
4102- documentIds = documentObject.database.listDocs()
4103-
4104- for(var i = 0; i < documentIds.length; i++){
4105-
4106- if(documentIds[i]===documentObject.docId && i > 0){
4107- return documentIds[i-1]
4108- }
4109- else if(documentIds[i]===documentObject.docId && i==0){
4110- return documentIds[documentIds.length-1]
4111- }
4112-
4113- }
4114-
4115- */
4116-
4117- var documentIds = {}
4118-
4119- documentIds = documentObject.database.listDocs()
4120-
4121- for(var i = 0; i < documentIds.length; i++){
4122-
4123- if(documentIds[i]===documentObject.docId && i > 0){
4124- return documentIds[i-1]
4125- }
4126- else if(documentIds[i]===documentObject.docId && i==0){
4127- return documentIds[documentIds.length-1]
4128- }
4129-
4130- }
4131-
4132- return documentIds[0]
4133-
4134- }
4135-
4136- else{
4137-
4138- print("Error!")
4139-
4140- return ''
4141- }
4142-
4143- }
4144-
4145- function getNextDocumentId(documentObject){
4146-
4147- if(typeof documentObject!='undefined'){
4148-
4149- var documentIds = documentObject.database.listDocs()
4150-
4151- for(var i = 0; i < documentIds.length; i++){
4152-
4153- if(documentIds[i]===documentObject.docId && i < (documentIds.length-1)){
4154- return documentIds[i+1]
4155- }
4156- else if(documentIds[i]===documentObject.docId && i==(documentIds.length-1)){
4157- return documentIds[0]
4158- }
4159-
4160- }
4161-
4162- return documentIds[0]
4163-
4164- }
4165-
4166- else{
4167-
4168- print("Error!")
4169-
4170- return ''
4171- }
4172-
4173- }
4174-
4175- function getCurrentDocumentKey(contentsObject){
4176-
4177- if(typeof contentsObject!='undefined'){
4178-
4179- var keys = Object.keys(contentsObject);
4180-
4181- return keys[0]
4182-
4183- }
4184-
4185- else{
4186-
4187- return ''
4188- }
4189-
4190- }
4191-
4192- function updateContentWindow(documentText, addressBarText) {
4193-
4194- // Somewhere below need to check for things like invalid docId
4195-
4196- if(documentText!==addressBarText) {
4197-
4198- /*!
4199-
4200- 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.
4201-
4202- var tempDocument = {}
4203- var tempFieldName = addressBarText;
4204- var tempContents = {};
4205-
4206- tempDocument = aDocument
4207- tempDocument.docId = addressBarText;
4208-
4209- tempContents = tempDocument.contents
4210-
4211- 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.
4212-
4213- */
4214-
4215- var tempDocument = {}
4216- var tempFieldName = addressBarText;
4217- var tempContents = {};
4218-
4219- tempDocument = aDocument
4220- tempDocument.docId = addressBarText;
4221-
4222- tempContents = tempDocument.contents
4223-
4224- if(typeof tempContents !='undefined' && typeof tempContents[tempFieldName]!='undefined') {
4225-
4226- aDocument = tempDocument
4227- documentContent.text = tempContents[tempFieldName]
4228-
4229- }
4230- else {
4231-
4232- /*!
4233-
4234- Here the contents of the temporary document are modified, which then replaces the global document.
4235-
4236- documentContent.text = 'More Hello World...';
4237-
4238- tempContents = {}
4239- tempContents[tempFieldName] = documentContent.text
4240- tempDocument.contents = tempContents
4241- aDocument = tempDocument
4242-
4243- */
4244-
4245- documentContent.text = 'More Hello World...';
4246-
4247- tempContents = {}
4248- tempContents[tempFieldName] = documentContent.text
4249- tempDocument.contents = tempContents
4250- aDocument = tempDocument
4251-
4252- }
4253-
4254- }
4255- else {
4256-
4257- /*!
4258-
4259- 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.
4260-
4261- tempContents = {}
4262- tempFieldName = getCurrentDocumentKey(aDocument.contents)
4263- tempContents[tempFieldName] = documentContent.text
4264- aDocument.contents = tempContents
4265-
4266- */
4267-
4268- tempContents = {}
4269- tempFieldName = getCurrentDocumentKey(aDocument.contents)
4270- tempContents[tempFieldName] = documentContent.text
4271- aDocument.contents = tempContents
4272-
4273- }
4274-
4275- }
4276-
4277- MainView {
4278-
4279- id: u1dbView
4280- width: units.gu(45)
4281- height: units.gu(80)
4282- anchors.top: parent.top;
4283-
4284- Tabs {
4285- id: tabs
4286- anchors.fill: parent
4287-
4288- Tab {
4289- objectName: "Tab1"
4290-
4291- title: i18n.tr("Hello U1Db!")
4292-
4293- page: Page {
4294-
4295- id: helloPage
4296-
4297- /*! Here a rectangle is defined that represents the lower portion of our application. It will contain all the main parts of the application.
4298-
4299- Rectangle {
4300-
4301- width: units.gu(45)
4302- height: units.gu(70)
4303- anchors.bottom: parent.bottom
4304-
4305- color: "#00FFFFFF"
4306-
4307- // The remainder of the main part of the application goes here ...
4308-
4309- }
4310-
4311- */
4312-
4313- Rectangle {
4314-
4315- width: units.gu(45)
4316- height: units.gu(70)
4317- anchors.bottom: parent.bottom
4318-
4319- color: "#00FFFFFF"
4320-
4321- Rectangle {
4322-
4323- width: units.gu(45)
4324- height: units.gu(60)
4325- anchors.bottom: parent.bottom
4326-
4327- /*!
4328-
4329- 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.
4330-
4331- TextArea{
4332-
4333- id: documentContent
4334-
4335- selectByMouse : false
4336-
4337- x: units.gu(1)
4338- y: units.gu(1)
4339- width: units.gu(43)
4340- height: units.gu(58)
4341- color: "#000000"
4342-
4343- }
4344-
4345- */
4346-
4347- TextArea {
4348-
4349- id: documentContent
4350-
4351- selectByMouse : false
4352-
4353- x: units.gu(1)
4354- y: units.gu(1)
4355- width: units.gu(43)
4356- height: units.gu(58)
4357- color: "#000000"
4358-
4359- }
4360-
4361- }
4362-
4363- // This rectangle contains the navigation controls
4364-
4365- Rectangle {
4366-
4367- width: units.gu(43)
4368- height: units.gu(5)
4369- anchors.top: addressBarArea.bottom
4370- x: units.gu(1.5)
4371- color: "#00FFFFFF"
4372-
4373- Row {
4374-
4375- width: units.gu(43)
4376- height: units.gu(5)
4377- anchors.verticalCenter: parent.verticalCenter
4378- spacing: units.gu(2)
4379-
4380- Button {
4381- text: "<"
4382- onClicked: updateContentWindow(switchToPreviousDocument(aDocument), addressBar.text)
4383- }
4384- Button {
4385- text: "Home"
4386- onClicked: updateContentWindow(getCurrentDocumentKey(aDocument.contents),'helloworld')
4387- }
4388- Button {
4389- text: "Save"
4390- onClicked: updateContentWindow(getCurrentDocumentKey(aDocument.contents),addressBar.text)
4391- }
4392- Button {
4393- text: ">"
4394- onClicked: updateContentWindow(switchToNextDocument(aDocument), addressBar.text)
4395- }
4396-
4397- }
4398-
4399- }
4400-
4401- Rectangle {
4402-
4403- id: addressBarArea
4404-
4405- width: units.gu(45)
4406- height: units.gu(5)
4407- anchors.top: parent.top
4408-
4409- TextField {
4410-
4411- id: addressBar
4412-
4413- width: units.gu(43)
4414- anchors.verticalCenter: parent.verticalCenter
4415- x: units.gu(1)
4416-
4417- hasClearButton: false
4418-
4419- /*!
4420-
4421- 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:
4422-
4423- text: displayKey(aDocument.contents)
4424-
4425- function displayKey(documentObject){
4426-
4427- var keys = Object.keys(documentObject);
4428-
4429- return keys[0]
4430-
4431- }
4432-
4433- */
4434-
4435- text: getCurrentDocumentKey(aDocument.contents)
4436-
4437-
4438- onAccepted: {
4439-
4440- onClicked: updateContentWindow(getCurrentDocumentKey(aDocument.contents),addressBar.text)
4441-
4442- }
4443-
4444-
4445- }
4446-
4447-
4448- }
4449-
4450-
4451- }
4452-
4453-
4454- }
4455-
4456- }
4457-
4458- Tab {
4459- objectName: "Tab2"
4460-
4461- title: i18n.tr("Bookmarks")
4462-
4463- page: Page {
4464-
4465- id: bookmarkPage
4466-
4467- }
4468-
4469- }
4470-
4471-
4472- }
4473-
4474-
4475-
4476-
4477-
4478-
4479-
4480- }
4481-
4482-}
4483
4484=== added file 'examples/u1db-qt-example-4/u1db-qt-example-4.qdoc'
4485--- examples/u1db-qt-example-4/u1db-qt-example-4.qdoc 1970-01-01 00:00:00 +0000
4486+++ examples/u1db-qt-example-4/u1db-qt-example-4.qdoc 2013-04-08 10:35:25 +0000
4487@@ -0,0 +1,24 @@
4488+/*
4489+ * Copyright (C) 2013 Canonical, Ltd.
4490+ *
4491+ * Authors:
4492+ * Kevin Wright <kevin.wright@canonical.com>
4493+ *
4494+ * This program is free software; you can redistribute it and/or modify
4495+ * it under the terms of the GNU Lesser General Public License as published by
4496+ * the Free Software Foundation; version 3.
4497+ *
4498+ * This program is distributed in the hope that it will be useful,
4499+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4500+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4501+ * GNU Lesser General Public License for more details.
4502+ *
4503+ * You should have received a copy of the GNU Lesser General Public License
4504+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4505+ */
4506+
4507+/*!
4508+
4509+\example u1db-qt-example-4
4510+
4511+*/
4512
4513=== added file 'examples/u1db-qt-example-4/u1db-qt-example-4.qml'
4514--- examples/u1db-qt-example-4/u1db-qt-example-4.qml 1970-01-01 00:00:00 +0000
4515+++ examples/u1db-qt-example-4/u1db-qt-example-4.qml 2013-04-08 10:35:25 +0000
4516@@ -0,0 +1,518 @@
4517+/*
4518+ * Copyright (C) 2013 Canonical, Ltd.
4519+ *
4520+ * Authors:
4521+ * Kevin Wright <kevin.wright@canonical.com>
4522+ *
4523+ * This program is free software; you can redistribute it and/or modify
4524+ * it under the terms of the GNU Lesser General Public License as published by
4525+ * the Free Software Foundation; version 3.
4526+ *
4527+ * This program is distributed in the hope that it will be useful,
4528+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4529+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4530+ * GNU Lesser General Public License for more details.
4531+ *
4532+ * You should have received a copy of the GNU Lesser General Public License
4533+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4534+ */
4535+
4536+import QtQuick 2.0
4537+import U1db 1.0 as U1db
4538+import Ubuntu.Components 0.1
4539+
4540+
4541+
4542+/*!
4543+
4544+This example and tutorial is designed to show a wide variety of U1Db-Qt functionality and usage. The example demonstrates:
4545+
4546+\list 1
4547+ \li Combining U1Db-Qt with elements and components that do not utilize models
4548+ \li Blending the U1Db-Qt plugin with QML and Javascript
4549+\endlist
4550+
4551+ */
4552+
4553+Item {
4554+
4555+ width: units.gu(45)
4556+ height: units.gu(80)
4557+
4558+ /*!
4559+
4560+ 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.
4561+
4562+ U1db.Database {
4563+ id: aDatabase
4564+ path: "aDatabase4"
4565+ }
4566+
4567+ */
4568+
4569+ U1db.Database {
4570+ id: aDatabase
4571+ path: "aDatabase4"
4572+ }
4573+
4574+ /*!
4575+
4576+ 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.
4577+
4578+ 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.
4579+
4580+ U1db.Document {
4581+ id: aDocument
4582+ database: aDatabase
4583+ docId: 'helloworld'
4584+ create: true
4585+ defaults: { "helloworld":"Hello World" }
4586+
4587+ Component.onCompleted: {
4588+ documentContent.text = aDocument.contents.helloworld
4589+ }
4590+
4591+ }
4592+
4593+ */
4594+
4595+
4596+ U1db.Document {
4597+ id: aDocument
4598+ database: aDatabase
4599+ docId: 'helloworld'
4600+ create: true
4601+ defaults: { "helloworld":"Hello World" }
4602+
4603+ Component.onCompleted: {
4604+ documentContent.text = aDocument.contents.helloworld
4605+ }
4606+
4607+ }
4608+
4609+ /*!
4610+
4611+ 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.
4612+
4613+ U1db.Document {
4614+ id: aBookmarkDocument
4615+ docId: 'bookmarks'
4616+ create: true
4617+ defaults: { "bookmarks": [{}] }
4618+ }
4619+
4620+
4621+ */
4622+
4623+
4624+ U1db.Document {
4625+ id: aBookmarkDocument
4626+ docId: 'bookmarks'
4627+ create: true
4628+ defaults: { "bookmarks": [{}] }
4629+ }
4630+
4631+
4632+ function switchToPreviousDocument(documentObject){
4633+
4634+ aDocument.docId = getPreviousDocumentId(documentObject)
4635+
4636+ }
4637+
4638+ function switchToNextDocument(){
4639+
4640+ aDocument.docId = getNextDocumentId(aDocument)
4641+
4642+ }
4643+
4644+ function getPreviousDocumentId(documentObject){
4645+
4646+ if(typeof documentObject!='undefined'){
4647+
4648+ /*!
4649+
4650+ 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.
4651+
4652+ var documentIds = {}
4653+
4654+ documentIds = documentObject.database.listDocs()
4655+
4656+ for(var i = 0; i < documentIds.length; i++){
4657+
4658+ if(documentIds[i]===documentObject.docId && i > 0){
4659+ return documentIds[i-1]
4660+ }
4661+ else if(documentIds[i]===documentObject.docId && i==0){
4662+ return documentIds[documentIds.length-1]
4663+ }
4664+
4665+ }
4666+
4667+ */
4668+
4669+ var documentIds = {}
4670+
4671+ documentIds = documentObject.database.listDocs()
4672+
4673+ for(var i = 0; i < documentIds.length; i++){
4674+
4675+ if(documentIds[i]===documentObject.docId && i > 0){
4676+ return documentIds[i-1]
4677+ }
4678+ else if(documentIds[i]===documentObject.docId && i==0){
4679+ return documentIds[documentIds.length-1]
4680+ }
4681+
4682+ }
4683+
4684+ return documentIds[0]
4685+
4686+ }
4687+
4688+ else{
4689+
4690+ print("Error!")
4691+
4692+ return ''
4693+ }
4694+
4695+ }
4696+
4697+ function getNextDocumentId(documentObject){
4698+
4699+ if(typeof documentObject!='undefined'){
4700+
4701+ var documentIds = documentObject.database.listDocs()
4702+
4703+ for(var i = 0; i < documentIds.length; i++){
4704+
4705+ if(documentIds[i]===documentObject.docId && i < (documentIds.length-1)){
4706+ return documentIds[i+1]
4707+ }
4708+ else if(documentIds[i]===documentObject.docId && i==(documentIds.length-1)){
4709+ return documentIds[0]
4710+ }
4711+
4712+ }
4713+
4714+ return documentIds[0]
4715+
4716+ }
4717+
4718+ else{
4719+
4720+ print("Error!")
4721+
4722+ return ''
4723+ }
4724+
4725+ }
4726+
4727+ function getCurrentDocumentKey(contentsObject){
4728+
4729+ if(typeof contentsObject!='undefined'){
4730+
4731+ var keys = Object.keys(contentsObject);
4732+
4733+ return keys[0]
4734+
4735+ }
4736+
4737+ else{
4738+
4739+ return ''
4740+ }
4741+
4742+ }
4743+
4744+ function updateContentWindow(documentText, addressBarText) {
4745+
4746+ // Somewhere below need to check for things like invalid docId
4747+
4748+ if(documentText!==addressBarText) {
4749+
4750+ /*!
4751+
4752+ 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.
4753+
4754+ var tempDocument = {}
4755+ var tempFieldName = addressBarText;
4756+ var tempContents = {};
4757+
4758+ tempDocument = aDocument
4759+ tempDocument.docId = addressBarText;
4760+
4761+ tempContents = tempDocument.contents
4762+
4763+ 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.
4764+
4765+ */
4766+
4767+ var tempDocument = {}
4768+ var tempFieldName = addressBarText;
4769+ var tempContents = {};
4770+
4771+ tempDocument = aDocument
4772+ tempDocument.docId = addressBarText;
4773+
4774+ tempContents = tempDocument.contents
4775+
4776+ if(typeof tempContents !='undefined' && typeof tempContents[tempFieldName]!='undefined') {
4777+
4778+ aDocument = tempDocument
4779+ documentContent.text = tempContents[tempFieldName]
4780+
4781+ }
4782+ else {
4783+
4784+ /*!
4785+
4786+ Here the contents of the temporary document are modified, which then replaces the global document.
4787+
4788+ documentContent.text = 'More Hello World...';
4789+
4790+ tempContents = {}
4791+ tempContents[tempFieldName] = documentContent.text
4792+ tempDocument.contents = tempContents
4793+ aDocument = tempDocument
4794+
4795+ */
4796+
4797+ documentContent.text = 'More Hello World...';
4798+
4799+ tempContents = {}
4800+ tempContents[tempFieldName] = documentContent.text
4801+ tempDocument.contents = tempContents
4802+ aDocument = tempDocument
4803+
4804+ }
4805+
4806+ }
4807+ else {
4808+
4809+ /*!
4810+
4811+ 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.
4812+
4813+ tempContents = {}
4814+ tempFieldName = getCurrentDocumentKey(aDocument.contents)
4815+ tempContents[tempFieldName] = documentContent.text
4816+ aDocument.contents = tempContents
4817+
4818+ */
4819+
4820+ tempContents = {}
4821+ tempFieldName = getCurrentDocumentKey(aDocument.contents)
4822+ tempContents[tempFieldName] = documentContent.text
4823+ aDocument.contents = tempContents
4824+
4825+ }
4826+
4827+ }
4828+
4829+ MainView {
4830+
4831+ id: u1dbView
4832+ width: units.gu(45)
4833+ height: units.gu(80)
4834+ anchors.top: parent.top;
4835+
4836+ Tabs {
4837+ id: tabs
4838+ anchors.fill: parent
4839+
4840+ Tab {
4841+ objectName: "Tab1"
4842+
4843+ title: i18n.tr("Hello U1Db!")
4844+
4845+ page: Page {
4846+
4847+ id: helloPage
4848+
4849+ /*! Here a rectangle is defined that represents the lower portion of our application. It will contain all the main parts of the application.
4850+
4851+ Rectangle {
4852+
4853+ width: units.gu(45)
4854+ height: units.gu(70)
4855+ anchors.bottom: parent.bottom
4856+
4857+ color: "#00FFFFFF"
4858+
4859+ // The remainder of the main part of the application goes here ...
4860+
4861+ }
4862+
4863+ */
4864+
4865+ Rectangle {
4866+
4867+ width: units.gu(45)
4868+ height: units.gu(70)
4869+ anchors.bottom: parent.bottom
4870+
4871+ color: "#00FFFFFF"
4872+
4873+ Rectangle {
4874+
4875+ width: units.gu(45)
4876+ height: units.gu(60)
4877+ anchors.bottom: parent.bottom
4878+
4879+ /*!
4880+
4881+ 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.
4882+
4883+ TextArea{
4884+
4885+ id: documentContent
4886+
4887+ selectByMouse : false
4888+
4889+ x: units.gu(1)
4890+ y: units.gu(1)
4891+ width: units.gu(43)
4892+ height: units.gu(58)
4893+ color: "#000000"
4894+
4895+ }
4896+
4897+ */
4898+
4899+ TextArea {
4900+
4901+ id: documentContent
4902+
4903+ selectByMouse : false
4904+
4905+ x: units.gu(1)
4906+ y: units.gu(1)
4907+ width: units.gu(43)
4908+ height: units.gu(58)
4909+ color: "#000000"
4910+
4911+ }
4912+
4913+ }
4914+
4915+ // This rectangle contains the navigation controls
4916+
4917+ Rectangle {
4918+
4919+ width: units.gu(43)
4920+ height: units.gu(5)
4921+ anchors.top: addressBarArea.bottom
4922+ x: units.gu(1.5)
4923+ color: "#00FFFFFF"
4924+
4925+ Row {
4926+
4927+ width: units.gu(43)
4928+ height: units.gu(5)
4929+ anchors.verticalCenter: parent.verticalCenter
4930+ spacing: units.gu(2)
4931+
4932+ Button {
4933+ text: "<"
4934+ onClicked: updateContentWindow(switchToPreviousDocument(aDocument), addressBar.text)
4935+ }
4936+ Button {
4937+ text: "Home"
4938+ onClicked: updateContentWindow(getCurrentDocumentKey(aDocument.contents),'helloworld')
4939+ }
4940+ Button {
4941+ text: "Save"
4942+ onClicked: updateContentWindow(getCurrentDocumentKey(aDocument.contents),addressBar.text)
4943+ }
4944+ Button {
4945+ text: ">"
4946+ onClicked: updateContentWindow(switchToNextDocument(aDocument), addressBar.text)
4947+ }
4948+
4949+ }
4950+
4951+ }
4952+
4953+ Rectangle {
4954+
4955+ id: addressBarArea
4956+
4957+ width: units.gu(45)
4958+ height: units.gu(5)
4959+ anchors.top: parent.top
4960+
4961+ TextField {
4962+
4963+ id: addressBar
4964+
4965+ width: units.gu(43)
4966+ anchors.verticalCenter: parent.verticalCenter
4967+ x: units.gu(1)
4968+
4969+ hasClearButton: false
4970+
4971+ /*!
4972+
4973+ 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:
4974+
4975+ text: displayKey(aDocument.contents)
4976+
4977+ function displayKey(documentObject){
4978+
4979+ var keys = Object.keys(documentObject);
4980+
4981+ return keys[0]
4982+
4983+ }
4984+
4985+ */
4986+
4987+ text: getCurrentDocumentKey(aDocument.contents)
4988+
4989+
4990+ onAccepted: {
4991+
4992+ onClicked: updateContentWindow(getCurrentDocumentKey(aDocument.contents),addressBar.text)
4993+
4994+ }
4995+
4996+
4997+ }
4998+
4999+
5000+ }
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: