diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-10-06 02:17:37 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-10-06 02:17:37 (GMT) |
commit | e559d97aa8e37c63b9e0090fe5dfa4b9bdeb079e (patch) | |
tree | 1a156cad6d7fcac237a06940285bcdcd7df92ada | |
parent | 47db21ecd772a980e0a4a5f91c63cdffafdff8c0 (diff) | |
parent | 3710e8ca85c7f1dddb9dc752a6120523ce6bf781 (diff) | |
download | Qt-e559d97aa8e37c63b9e0090fe5dfa4b9bdeb079e.zip Qt-e559d97aa8e37c63b9e0090fe5dfa4b9bdeb079e.tar.gz Qt-e559d97aa8e37c63b9e0090fe5dfa4b9bdeb079e.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
17 files changed, 46 insertions, 39 deletions
diff --git a/demos/declarative/contacts/Contact.qml b/demos/declarative/contacts/Contact.qml index 91510c7..e12cd3b 100644 --- a/demos/declarative/contacts/Contact.qml +++ b/demos/declarative/contacts/Contact.qml @@ -82,8 +82,8 @@ Item { } Column { id: layout - width: contents.width - height:contents.height + width: childrenRect.width + height: childrenRect.height anchors.centerIn: parent spacing: 5 ContactField { diff --git a/demos/declarative/flickr/flickr-desktop.qml b/demos/declarative/flickr/flickr-desktop.qml index 6a4efd9..f8cf048 100644 --- a/demos/declarative/flickr/flickr-desktop.qml +++ b/demos/declarative/flickr/flickr-desktop.qml @@ -70,8 +70,8 @@ Item { PropertyChanges { target: ItemRotation; angle: 0 } PropertyChanges { target: Shadows; opacity: 0 } PropertyChanges { target: ImageDetails; y: 20 } - PropertyChanges { target: PhotoGridView; y: "-480" } - PropertyChanges { target: PhotoPathView; y: "-480" } + PropertyChanges { target: PhotoGridView; y: -480 } + PropertyChanges { target: PhotoPathView; y: -480 } PropertyChanges { target: ViewModeButton; opacity: 0 } PropertyChanges { target: TagsEdit; opacity: 0 } PropertyChanges { target: FetchButton; opacity: 0 } @@ -82,8 +82,10 @@ Item { transitions: [ Transition { from: "*"; to: "Details" - ParentAction { } - NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" } + SequentialAnimation { + ParentAction { } + NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" } + } }, Transition { from: "Details"; to: "*" diff --git a/doc/src/declarative/pics/rect-smooth.png b/doc/src/declarative/pics/rect-smooth.png Binary files differnew file mode 100644 index 0000000..abbb0a9 --- /dev/null +++ b/doc/src/declarative/pics/rect-smooth.png diff --git a/doc/src/declarative/qmlintro.qdoc b/doc/src/declarative/qmlintro.qdoc index 3d167ac..e87b7a8 100644 --- a/doc/src/declarative/qmlintro.qdoc +++ b/doc/src/declarative/qmlintro.qdoc @@ -40,8 +40,8 @@ two objects, a \l Rectangle, and an \l Image. Between the braces, we can specify information about the object, such as its properties. Properties are specified as \c {property: value} (much like CSS). In the above -example, we can see the Image has a property named \e source, which has been -assigned the value \e "pics/logo.png". The property and its value are +example, we can see the Image has a property named \c source, which has been +assigned the value \c "pics/logo.png". The property and its value are separated by a colon. Properties can be specified one-per-line: @@ -68,7 +68,9 @@ In addition to assigning values to properties, you can also assign expressions written in JavaScript. \code -Rotation { angle: 360*3 } +Rotation { + angle: 360 * 3 +} \endcode These expressions can include references to other objects and properties, in which case diff --git a/doc/src/declarative/qmlreference.qdoc b/doc/src/declarative/qmlreference.qdoc index 8a50547..bb0d61a 100644 --- a/doc/src/declarative/qmlreference.qdoc +++ b/doc/src/declarative/qmlreference.qdoc @@ -7,8 +7,7 @@ QML is a language for building highly dynamic and fluid applications. It is targetted at the sorts of user interface (and the sorts of hardware) in embedded devices such as phones, media players, and set-top boxes. It is also appropriate for highly custom desktop - user-interfaces, or special elements in more traditional desktop - user-interfaces. + user interfaces, or special elements in more traditional desktop user interfaces. Building fluid applications is done declaratively, rather than procedurally. That is, you specify \e what the UI should look like and how it should behave @@ -18,10 +17,10 @@ Getting Started: \list - \o \l {qmlexamples}{Examples} + \o \l {Introduction to the QML language} (in progress) \o \l {tutorial}{Tutorial: 'Hello World'} \o \l {tutorials-declarative-contacts.html}{Tutorial: 'Introduction to QML'} - \o \l {Introduction to the QML language} (in progress) + \o \l {qmlexamples}{Examples} \endlist Core Features: diff --git a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/1/Removebutton.qml b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/1/RemoveButton.qml index a8ac7fe..a8ac7fe 100644 --- a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/1/Removebutton.qml +++ b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/1/RemoveButton.qml diff --git a/examples/declarative/tutorials/contacts/2_Reuse/1/ContactField.qml b/examples/declarative/tutorials/contacts/2_Reuse/1/ContactField.qml index 162452f..9508018 100644 --- a/examples/declarative/tutorials/contacts/2_Reuse/1/ContactField.qml +++ b/examples/declarative/tutorials/contacts/2_Reuse/1/ContactField.qml @@ -21,7 +21,7 @@ Item { anchors.verticalCenter: parent.verticalCenter font.bold: true color: "black" - text: 123123 + text: "123123" } Image { source: "../../shared/pics/phone.png" diff --git a/examples/declarative/tutorials/contacts/2_Reuse/1a/ContactField.qml b/examples/declarative/tutorials/contacts/2_Reuse/1a/ContactField.qml index cf50fb0..e50dcc5 100644 --- a/examples/declarative/tutorials/contacts/2_Reuse/1a/ContactField.qml +++ b/examples/declarative/tutorials/contacts/2_Reuse/1a/ContactField.qml @@ -24,7 +24,7 @@ Item { anchors.verticalCenter: parent.verticalCenter font.bold: true color: "black" - text: 123123 + text: "123123" } Image { source: "../../shared/pics/phone.png" diff --git a/examples/declarative/tutorials/contacts/2_Reuse/2/ContactField.qml b/examples/declarative/tutorials/contacts/2_Reuse/2/ContactField.qml index 2e1a488..ce6a289 100644 --- a/examples/declarative/tutorials/contacts/2_Reuse/2/ContactField.qml +++ b/examples/declarative/tutorials/contacts/2_Reuse/2/ContactField.qml @@ -23,7 +23,7 @@ Item { anchors.verticalCenter: parent.verticalCenter font.bold: true color: "black" - text: 123123 + text: "123123" } Image { source: "../../shared/pics/phone.png" diff --git a/examples/declarative/tutorials/contacts/2_Reuse/3/Contact.qml b/examples/declarative/tutorials/contacts/2_Reuse/3/Contact.qml index 3516cee..f253763 100644 --- a/examples/declarative/tutorials/contacts/2_Reuse/3/Contact.qml +++ b/examples/declarative/tutorials/contacts/2_Reuse/3/Contact.qml @@ -16,9 +16,10 @@ Item { Column { id: layout - anchors.fill: parent + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right spacing: 5 - margin: 5 ContactField { id: labelField anchors.left: layout.left diff --git a/examples/declarative/tutorials/contacts/2_Reuse/4/Contact.qml b/examples/declarative/tutorials/contacts/2_Reuse/4/Contact.qml index 83988ab..db85d2a 100644 --- a/examples/declarative/tutorials/contacts/2_Reuse/4/Contact.qml +++ b/examples/declarative/tutorials/contacts/2_Reuse/4/Contact.qml @@ -19,9 +19,10 @@ Item { Column { id: layout - anchors.fill: parent + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right spacing: 5 - margin: 5 ContactField { id: labelField anchors.left: layout.left diff --git a/examples/declarative/tutorials/contacts/3_Collections/3_Collections.qml b/examples/declarative/tutorials/contacts/3_Collections/3_Collections.qml index a7764ed..cd14a08 100644 --- a/examples/declarative/tutorials/contacts/3_Collections/3_Collections.qml +++ b/examples/declarative/tutorials/contacts/3_Collections/3_Collections.qml @@ -5,7 +5,7 @@ Rectangle { width: layout.width height: layout.height color: "white" - Bind { + Binding { id: currentItem value: true } diff --git a/examples/declarative/tutorials/contacts/3_Collections/lib/Contact.qml b/examples/declarative/tutorials/contacts/3_Collections/lib/Contact.qml index d00bf05..58a542b 100644 --- a/examples/declarative/tutorials/contacts/3_Collections/lib/Contact.qml +++ b/examples/declarative/tutorials/contacts/3_Collections/lib/Contact.qml @@ -17,7 +17,6 @@ Item { id: layout anchors.fill: parent spacing: 5 - margin: 5 ContactField { id: labelField anchors.left: layout.left diff --git a/examples/declarative/velocity/Day.qml b/examples/declarative/velocity/Day.qml index 4001a3e..052f690 100644 --- a/examples/declarative/velocity/Day.qml +++ b/examples/declarative/velocity/Day.qml @@ -22,7 +22,7 @@ Rectangle { font.bold: true width: 370 text: day - style: Outline + style: "Outline" styleColor: "#dedede" } Repeater { diff --git a/src/declarative/fx/qfxborderimage.cpp b/src/declarative/fx/qfxborderimage.cpp index 3bc76da..6616912 100644 --- a/src/declarative/fx/qfxborderimage.cpp +++ b/src/declarative/fx/qfxborderimage.cpp @@ -124,19 +124,16 @@ QFxBorderImage::~QFxBorderImage() BorderImage can handle any image format supported by Qt, loaded from any URL scheme supported by Qt. It can also handle .sci files, which are a Qml-specific format. A .sci file uses a simple text-based format that specifies - \list - \i the grid lines describing a \l {BorderImage::border.left}{scale grid}. - \i an image file. - \endlist - - The following .sci file sets grid line offsets of 10 on each side for the image \c picture.png: - \code - gridLeft: 10 - gridTop: 10 - gridBottom: 10 - gridRight: 10 - imageFile: picture.png - \endcode + the borders, the image file and the tile rules. + + The following .sci file sets the borders to 10 on each side for the image \c picture.png: + \qml + border.left: 10 + border.top: 10 + border.bottom: 10 + border.right: 10 + source: picture.png + \endqml The URL may be absolute, or relative to the URL of the component. */ diff --git a/src/declarative/fx/qfxrect.cpp b/src/declarative/fx/qfxrect.cpp index 0648ac4..e802c94 100644 --- a/src/declarative/fx/qfxrect.cpp +++ b/src/declarative/fx/qfxrect.cpp @@ -427,14 +427,15 @@ void QFxRect::drawRect(QPainter &p) int offset = 0; const int pw = d->pen && d->pen->isValid() ? (d->pen->width()+1)/2*2 : 0; + const int realpw = d->pen && d->pen->isValid() ? d->pen->width() : 0; if (d->radius > 0) { generateRoundedRect(); //### implicit conversion to int - offset = int(d->radius+1.5+pw); + offset = int(d->radius+realpw+1); } else { generateBorderedRect(); - offset = pw+1; + offset = realpw+1; } //basically same code as QFxImage uses to paint sci images @@ -457,6 +458,8 @@ void QFxRect::drawRect(QPainter &p) ySide = yOffset * 2; } + Q_ASSERT(d->rectImage.width() >= 2*xOffset + 1); + Q_ASSERT(d->rectImage.height() >= 2*yOffset + 1); QMargins margins(xOffset, yOffset, xOffset, yOffset); QTileRules rules(Qt::StretchTile, Qt::StretchTile); qDrawBorderPixmap(&p, QRect(-pw/2, -pw/2, width()+pw, height()+pw), margins, d->rectImage, d->rectImage.rect(), margins, rules); @@ -479,6 +482,8 @@ void QFxRect::drawRect(QPainter &p) \note Generally scaling artifacts are only visible if the item is stationary on the screen. A common pattern when animating an item is to disable smooth filtering at the beginning of the animation and reenable it at the conclusion. + + \image rect-smooth.png */ QRectF QFxRect::boundingRect() const diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index b2884dd..e185536 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -302,7 +302,7 @@ QmlViewer::QmlViewer(QWidget *parent, Qt::WindowFlags flags) setLayout(layout); if (mb) layout->addWidget(mb); - layout->addWidget(canvas); + layout->addWidget(canvas, 0, Qt::AlignLeft); setupProxy(); canvas->engine()->networkAccessManager()->setCookieJar(new PersistentCookieJar(this)); @@ -651,6 +651,7 @@ void QmlViewer::openQml(const QString& fileName) if (!skin) { canvas->updateGeometry(); canvas->resize(canvas->sizeHint()); + canvas->updateGeometry(); resize(sizeHint()); } else { if (scaleSkin) |