summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-05-19 08:48:46 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-05-19 08:48:46 (GMT)
commit0a2258c3e7b49b7383ef9ace11a4d8a448b7def1 (patch)
tree9879b8453d9a711db29045d062bd1607f1667bc6
parent4871ff0563cf8a9691db8b084dce012aeb5abf47 (diff)
parent23c781b67c838b120e7fba42bc9008d38f191330 (diff)
downloadQt-0a2258c3e7b49b7383ef9ace11a4d8a448b7def1.zip
Qt-0a2258c3e7b49b7383ef9ace11a4d8a448b7def1.tar.gz
Qt-0a2258c3e7b49b7383ef9ace11a4d8a448b7def1.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r--demos/declarative/flickr/content/Progress.qml2
-rw-r--r--demos/declarative/flickr/content/Slider.qml12
-rw-r--r--src/declarative/3rdparty/qlistmodelinterface.h6
-rw-r--r--src/declarative/canvas/qsimplecanvas.h2
-rw-r--r--src/declarative/canvas/qsimplecanvasfilter.h6
-rw-r--r--src/declarative/canvas/qsimplecanvasitem.cpp10
-rw-r--r--src/declarative/canvas/qsimplecanvasitem.h3
-rw-r--r--src/declarative/canvas/qsimplecanvasitem_p.h3
-rw-r--r--src/declarative/extra/qfxintegermodel.h6
-rw-r--r--src/declarative/extra/qmlnumberformatter.h4
-rw-r--r--src/declarative/extra/qmlsqlconnection.h4
-rw-r--r--src/declarative/extra/qmlsqlquery.h4
-rw-r--r--src/declarative/extra/qmlxmllistmodel.h4
-rw-r--r--src/declarative/extra/qnumberformat.h6
-rw-r--r--src/declarative/fx/qfxanchors.cpp1
-rw-r--r--src/declarative/fx/qfxanchors.h6
-rw-r--r--src/declarative/fx/qfxanimatedimageitem.h2
-rw-r--r--src/declarative/fx/qfxblendedimage.h2
-rw-r--r--src/declarative/fx/qfxblurfilter.h4
-rw-r--r--src/declarative/fx/qfxcomponentinstance.h2
-rw-r--r--src/declarative/fx/qfxcontentwrapper.h2
-rw-r--r--src/declarative/fx/qfxevents_p.h4
-rw-r--r--src/declarative/fx/qfxflickable.h2
-rw-r--r--src/declarative/fx/qfxflipable.cpp7
-rw-r--r--src/declarative/fx/qfxflipable.h6
-rw-r--r--src/declarative/fx/qfxfocuspanel.h2
-rw-r--r--src/declarative/fx/qfxfocusrealm.h2
-rw-r--r--src/declarative/fx/qfxgridview.h2
-rw-r--r--src/declarative/fx/qfxhighlightfilter.h4
-rw-r--r--src/declarative/fx/qfximage.h2
-rw-r--r--src/declarative/fx/qfxitem.h4
-rw-r--r--src/declarative/fx/qfxitem_p.h6
-rw-r--r--src/declarative/fx/qfxkeyactions.h8
-rw-r--r--src/declarative/fx/qfxkeyproxy.h2
-rw-r--r--src/declarative/fx/qfxlayouts.h8
-rw-r--r--src/declarative/fx/qfxlayouts_p.h10
-rw-r--r--src/declarative/fx/qfxlistview.h2
-rw-r--r--src/declarative/fx/qfxmouseregion.h2
-rw-r--r--src/declarative/fx/qfxpainteditem.h4
-rw-r--r--src/declarative/fx/qfxpainteditem_p.h4
-rw-r--r--src/declarative/fx/qfxparticles.h2
-rw-r--r--src/declarative/fx/qfxpath.h8
-rw-r--r--src/declarative/fx/qfxpathview.h4
-rw-r--r--src/declarative/fx/qfxpixmap.h8
-rw-r--r--src/declarative/fx/qfxrect.cpp276
-rw-r--r--src/declarative/fx/qfxrect.h6
-rw-r--r--src/declarative/fx/qfxreflectionfilter.h4
-rw-r--r--src/declarative/fx/qfxrepeater.h2
-rw-r--r--src/declarative/fx/qfxscalegrid.h14
-rw-r--r--src/declarative/fx/qfxshadowfilter.h4
-rw-r--r--src/declarative/fx/qfxtext.h4
-rw-r--r--src/declarative/fx/qfxtextedit.h4
-rw-r--r--src/declarative/fx/qfxtransform.h6
-rw-r--r--src/declarative/fx/qfxvisualitemmodel.h2
-rw-r--r--src/declarative/fx/qfxwebview.h10
-rw-r--r--src/declarative/fx/qfxwidgetcontainer.h2
-rw-r--r--src/declarative/opengl/glheaders.h2
-rw-r--r--src/declarative/opengl/glsave.h6
-rw-r--r--src/declarative/opengl/gltexture.h6
-rw-r--r--src/declarative/qml/qmlbindablevalue.h8
-rw-r--r--src/declarative/qml/qmlbindablevalue_p.h4
-rw-r--r--src/declarative/qml/qmlboundsignal_p.h2
-rw-r--r--src/declarative/qml/qmlcompiledcomponent_p.h2
-rw-r--r--src/declarative/qml/qmlcompiler_p.h4
-rw-r--r--src/declarative/qml/qmlcomponent_p.h24
-rw-r--r--src/declarative/qml/qmlcompositetypemanager_p.h4
-rw-r--r--src/declarative/qml/qmlcontext_p.h6
-rw-r--r--src/declarative/qml/qmlengine.cpp29
-rw-r--r--src/declarative/qml/qmlengine.h2
-rw-r--r--src/declarative/qml/qmlengine_p.h16
-rw-r--r--src/declarative/qml/qmlinstruction_p.h2
-rw-r--r--src/declarative/qml/qmlmetaproperty.h2
-rw-r--r--src/declarative/qml/qmlparser_p.h6
-rw-r--r--src/declarative/qml/qmlpropertyvaluesource.h6
-rw-r--r--src/declarative/qml/qmlproxymetaobject_p.h6
-rw-r--r--src/declarative/qml/qmlrefcount_p.h2
-rw-r--r--src/declarative/qml/qmlvme_p.h8
-rw-r--r--src/declarative/qml/qmlvmemetaobject_p.h6
-rw-r--r--src/declarative/qml/script/lexer.h2
-rw-r--r--src/declarative/qml/script/qmlbasicscript.h6
-rw-r--r--src/declarative/test/qfxtestengine.h4
-rw-r--r--src/declarative/test/qfxtestobjects.h8
-rw-r--r--src/declarative/test/qfxtestview.h2
-rw-r--r--src/declarative/timeline/qmltimeline.h6
-rw-r--r--src/declarative/timeline/qmltimelinevalueproxy.h2
-rw-r--r--src/declarative/util/qbindablemap.h10
-rw-r--r--src/declarative/util/qfxglobal.h4
-rw-r--r--src/declarative/util/qfxview.h4
-rw-r--r--src/declarative/util/qmlanimation.h10
-rw-r--r--src/declarative/util/qmlanimation_p.h16
-rw-r--r--src/declarative/util/qmlbehaviour.h6
-rw-r--r--src/declarative/util/qmlbind.h4
-rw-r--r--src/declarative/util/qmlfollow.h4
-rw-r--r--src/declarative/util/qmlfont.h2
-rw-r--r--src/declarative/util/qmllistaccessor.h2
-rw-r--r--src/declarative/util/qmllistmodel.h16
-rw-r--r--src/declarative/util/qmlopenmetaobject.h4
-rw-r--r--src/declarative/util/qmlpackage.h2
-rw-r--r--src/declarative/util/qmlscript.h4
-rw-r--r--src/declarative/util/qmlsetproperties.h2
-rw-r--r--src/declarative/util/qmlstate.h6
-rw-r--r--src/declarative/util/qmlstate_p.h6
-rw-r--r--src/declarative/util/qmlstategroup.h2
-rw-r--r--src/declarative/util/qmlstateoperations.h2
-rw-r--r--src/declarative/util/qmltransition.h6
-rw-r--r--src/declarative/widgets/graphicslayouts.h6
-rw-r--r--src/declarative/widgets/graphicswidgets.h10
-rw-r--r--tests/auto/declarative/declarative.pro3
-rw-r--r--tests/auto/declarative/qmlengine/qmlengine.pro5
-rw-r--r--tests/auto/declarative/qmlengine/tst_qmlengine.cpp43
110 files changed, 522 insertions, 368 deletions
diff --git a/demos/declarative/flickr/content/Progress.qml b/demos/declarative/flickr/content/Progress.qml
index 92a232e..aa2a2e6 100644
--- a/demos/declarative/flickr/content/Progress.qml
+++ b/demos/declarative/flickr/content/Progress.qml
@@ -5,7 +5,7 @@ Item {
Rect {
id: Container; anchors.fill: parent; gradientColor: "#66000000";
- pen.color: "white"; pen.width: 1; color: "#66343434"; radius: height/2 - 2
+ pen.color: "white"; pen.width: 0; color: "#66343434"; radius: height/2 - 2
}
Rect {
diff --git a/demos/declarative/flickr/content/Slider.qml b/demos/declarative/flickr/content/Slider.qml
index 92f4993..aae4631 100644
--- a/demos/declarative/flickr/content/Slider.qml
+++ b/demos/declarative/flickr/content/Slider.qml
@@ -3,25 +3,25 @@ Item {
// value is read/write.
property real value
- onValueChanged: { Handle.x = (value - minimum) * Slider.xMax / (maximum - minimum); }
+ onValueChanged: { Handle.x = 2 + (value - minimum) * Slider.xMax / (maximum - minimum); }
property real maximum: 1
property real minimum: 1
- property int xMax: Slider.width - Handle.width - 2
+ property int xMax: Slider.width - Handle.width - 4
Rect {
id: Container; anchors.fill: parent; gradientColor: "#66000000";
- pen.color: "white"; pen.width: 1; color: "#66343434"; radius: 8
+ pen.color: "white"; pen.width: 0; color: "#66343434"; radius: 8
}
Rect {
id: Handle
- x: Slider.width / 2 - Handle.width / 2; y: 2; width: 30; height: 12
+ x: Slider.width / 2 - Handle.width / 2; y: 2; width: 30; height: Slider.height-4
color: "lightgray"; gradientColor: "gray"; radius: 6
MouseRegion {
anchors.fill: parent; drag.target: parent
- drag.axis: "x"; drag.xmin: 2; drag.xmax: Slider.xMax
- onPositionChanged: { value = (maximum - minimum) * Handle.x / Slider.xMax + minimum; }
+ drag.axis: "x"; drag.xmin: 2; drag.xmax: Slider.xMax+2
+ onPositionChanged: { value = (maximum - minimum) * (Handle.x-2) / Slider.xMax + minimum; }
}
}
}
diff --git a/src/declarative/3rdparty/qlistmodelinterface.h b/src/declarative/3rdparty/qlistmodelinterface.h
index 19284ca..44c4a24 100644
--- a/src/declarative/3rdparty/qlistmodelinterface.h
+++ b/src/declarative/3rdparty/qlistmodelinterface.h
@@ -42,9 +42,9 @@
#ifndef QLISTMODELINTERFACE_H
#define QLISTMODELINTERFACE_H
-#include <QHash>
-#include <QVariant>
-#include <qfxglobal.h>
+#include <QtCore/QHash>
+#include <QtCore/QVariant>
+#include <QtDeclarative/qfxglobal.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/canvas/qsimplecanvas.h b/src/declarative/canvas/qsimplecanvas.h
index d57ada4..880fae0 100644
--- a/src/declarative/canvas/qsimplecanvas.h
+++ b/src/declarative/canvas/qsimplecanvas.h
@@ -42,7 +42,7 @@
#ifndef QSIMPLECANVAS_H
#define QSIMPLECANVAS_H
-#include <qfxglobal.h>
+#include <QtDeclarative/qfxglobal.h>
#ifdef QFX_RENDER_OPENGL
#include <QtGui/qmatrix4x4.h>
diff --git a/src/declarative/canvas/qsimplecanvasfilter.h b/src/declarative/canvas/qsimplecanvasfilter.h
index cb75ddf..d05dc7e 100644
--- a/src/declarative/canvas/qsimplecanvasfilter.h
+++ b/src/declarative/canvas/qsimplecanvasfilter.h
@@ -43,9 +43,9 @@
#define QSIMPLECANVASFILTER_H
#include <QtCore/qobject.h>
-#include <qfxglobal.h>
-#include <qsimplecanvasitem.h>
-#include <qsimplecanvas.h>
+#include <QtDeclarative/qfxglobal.h>
+#include <QtDeclarative/qsimplecanvasitem.h>
+#include <QtDeclarative/qsimplecanvas.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/canvas/qsimplecanvasitem.cpp b/src/declarative/canvas/qsimplecanvasitem.cpp
index dfe02c0..fb20e95 100644
--- a/src/declarative/canvas/qsimplecanvasitem.cpp
+++ b/src/declarative/canvas/qsimplecanvasitem.cpp
@@ -181,10 +181,18 @@ void QSimpleCanvasItem::childrenChanged()
{
}
+int QSimpleCanvasItem::setPaintMargin(qreal margin)
+{
+ Q_D(QSimpleCanvasItem);
+ if (margin < d->paintmargin)
+ update(); // schedule repaint of old boundingRect
+ d->paintmargin = margin;
+}
+
QRectF QSimpleCanvasItem::boundingRect() const
{
Q_D(const QSimpleCanvasItem);
- return QRectF(0., 0., d->width, d->height);
+ return QRectF(-d->paintmargin, -d->paintmargin, d->width+d->paintmargin*2, d->height+d->paintmargin*2);
}
void QSimpleCanvasItem::paintContents(QPainter &)
diff --git a/src/declarative/canvas/qsimplecanvasitem.h b/src/declarative/canvas/qsimplecanvasitem.h
index cab8492..2d65469 100644
--- a/src/declarative/canvas/qsimplecanvasitem.h
+++ b/src/declarative/canvas/qsimplecanvasitem.h
@@ -47,13 +47,13 @@
#include <QtDeclarative/qsimplecanvas.h>
#include <QtCore/qobject.h>
#include <QtGui/qgraphicsitem.h>
-class QPainter;
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
+class QPainter;
class QRect;
class QSimpleCanvas;
class QMouseEvent;
@@ -183,6 +183,7 @@ public:
};
+ int setPaintMargin(qreal margin);
QRectF boundingRect() const;
virtual void paintContents(QPainter &);
virtual void paintGLContents(GLPainter &);
diff --git a/src/declarative/canvas/qsimplecanvasitem_p.h b/src/declarative/canvas/qsimplecanvasitem_p.h
index 34880f0..f0b44e0 100644
--- a/src/declarative/canvas/qsimplecanvasitem_p.h
+++ b/src/declarative/canvas/qsimplecanvasitem_p.h
@@ -142,7 +142,7 @@ public:
focusable(false), wantsActiveFocusPanelPendingCanvas(false),
hasBeenActiveFocusPanel(false),
hasFocus(false), hasActiveFocus(false), needsZOrder(false),
- widthValid(false), heightValid(false), width(0), height(0), scale(1),
+ widthValid(false), heightValid(false), width(0), height(0), paintmargin(0), scale(1),
graphicsItem(0), data_ptr(0)
{
}
@@ -176,6 +176,7 @@ public:
qreal width;
qreal height;
+ qreal paintmargin;
qreal scale;
QSimpleGraphicsItem *graphicsItem;
diff --git a/src/declarative/extra/qfxintegermodel.h b/src/declarative/extra/qfxintegermodel.h
index 3a48a56..2f5c756 100644
--- a/src/declarative/extra/qfxintegermodel.h
+++ b/src/declarative/extra/qfxintegermodel.h
@@ -42,9 +42,9 @@
#ifndef QFXINTMODEL_H
#define QFXINTMODEL_H
-#include <QObject>
-#include "qml.h"
-#include <qlistmodelinterface.h>
+#include <QtCore/QObject>
+#include <QtDeclarative/qml.h>
+#include <QtDeclarative/qlistmodelinterface.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/extra/qmlnumberformatter.h b/src/declarative/extra/qmlnumberformatter.h
index e053be5..cdd6b58 100644
--- a/src/declarative/extra/qmlnumberformatter.h
+++ b/src/declarative/extra/qmlnumberformatter.h
@@ -42,8 +42,8 @@
#ifndef QMLNUMBERFORMATTER_H
#define QMLNUMBERFORMATTER_H
-#include <qml.h>
-#include "qnumberformat.h"
+#include <QtDeclarative/qml.h>
+#include <QtDeclarative/qnumberformat.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/extra/qmlsqlconnection.h b/src/declarative/extra/qmlsqlconnection.h
index 2cc5774..0fff1b0 100644
--- a/src/declarative/extra/qmlsqlconnection.h
+++ b/src/declarative/extra/qmlsqlconnection.h
@@ -42,8 +42,8 @@
#ifndef QMLSQLCONNECTION_H
#define QMLSQLCONNECTION_H
-#include <qml.h>
-#include <QSqlDatabase>
+#include <QtDeclarative/qml.h>
+#include <QtSql/QSqlDatabase>
QT_BEGIN_HEADER
diff --git a/src/declarative/extra/qmlsqlquery.h b/src/declarative/extra/qmlsqlquery.h
index 984483c..3fff127 100644
--- a/src/declarative/extra/qmlsqlquery.h
+++ b/src/declarative/extra/qmlsqlquery.h
@@ -42,8 +42,8 @@
#ifndef QMLSQLQUERYMODEL_H
#define QMLSQLQUERYMODEL_H
-#include <qml.h>
-#include <QListModelInterface>
+#include <QtDeclarative/qml.h>
+#include <QtDeclarative/QListModelInterface>
QT_BEGIN_HEADER
diff --git a/src/declarative/extra/qmlxmllistmodel.h b/src/declarative/extra/qmlxmllistmodel.h
index 2e932cb..9371448 100644
--- a/src/declarative/extra/qmlxmllistmodel.h
+++ b/src/declarative/extra/qmlxmllistmodel.h
@@ -42,8 +42,8 @@
#ifndef QMLXMLLISTMODEL_H
#define QMLXMLLISTMODEL_H
-#include <qml.h>
-#include <QListModelInterface>
+#include <QtDeclarative/qml.h>
+#include <QtDeclarative/QListModelInterface>
QT_BEGIN_HEADER
diff --git a/src/declarative/extra/qnumberformat.h b/src/declarative/extra/qnumberformat.h
index 6ee333c..75224ec 100644
--- a/src/declarative/extra/qnumberformat.h
+++ b/src/declarative/extra/qnumberformat.h
@@ -42,9 +42,9 @@
#ifndef NUMBERFORMAT_H
#define NUMBERFORMAT_H
-#include "qml.h"
-#include <QtGui>
-
+#include <QtDeclarative/qml.h>
+#include <QtCore/QLocale>
+#include <QtCore/QTime>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxanchors.cpp b/src/declarative/fx/qfxanchors.cpp
index 3eaf47a..235511f 100644
--- a/src/declarative/fx/qfxanchors.cpp
+++ b/src/declarative/fx/qfxanchors.cpp
@@ -234,7 +234,6 @@ void QFxAnchorsPrivate::remDepend(QFxItem *item)
bool QFxAnchorsPrivate::isItemComplete() const
{
- return true;
return item->isComponentComplete();
}
diff --git a/src/declarative/fx/qfxanchors.h b/src/declarative/fx/qfxanchors.h
index 2c59266..9d776ab 100644
--- a/src/declarative/fx/qfxanchors.h
+++ b/src/declarative/fx/qfxanchors.h
@@ -42,9 +42,9 @@
#ifndef QFXANCHORS_H
#define QFXANCHORS_H
-#include <qfxglobal.h>
-#include <QObject>
-#include <qml.h>
+#include <QtCore/QObject>
+#include <QtDeclarative/qfxglobal.h>
+#include <QtDeclarative/qml.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxanimatedimageitem.h b/src/declarative/fx/qfxanimatedimageitem.h
index 121fe62..a332c8b 100644
--- a/src/declarative/fx/qfxanimatedimageitem.h
+++ b/src/declarative/fx/qfxanimatedimageitem.h
@@ -42,7 +42,7 @@
#ifndef QFXANIMATEDIMAGEITEM_H
#define QFXANIMATEDIMAGEITEM_H
-#include <qfximage.h>
+#include <QtDeclarative/qfximage.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxblendedimage.h b/src/declarative/fx/qfxblendedimage.h
index 1cf4dc8..2fdf15b 100644
--- a/src/declarative/fx/qfxblendedimage.h
+++ b/src/declarative/fx/qfxblendedimage.h
@@ -42,7 +42,7 @@
#ifndef QFXBLENDEDIMAGE_H
#define QFXBLENDEDIMAGE_H
-#include <qfxitem.h>
+#include <QtDeclarative/qfxitem.h>
#if defined(QFX_RENDER_OPENGL2)
#include <gltexture.h>
#endif
diff --git a/src/declarative/fx/qfxblurfilter.h b/src/declarative/fx/qfxblurfilter.h
index 7a2b5b9..576debf 100644
--- a/src/declarative/fx/qfxblurfilter.h
+++ b/src/declarative/fx/qfxblurfilter.h
@@ -42,8 +42,8 @@
#ifndef QFXBLURFILTER_H
#define QFXBLURFILTER_H
-#include <qsimplecanvasfilter.h>
-#include <qml.h>
+#include <QtDeclarative/qsimplecanvasfilter.h>
+#include <QtDeclarative/qml.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxcomponentinstance.h b/src/declarative/fx/qfxcomponentinstance.h
index 64af355..9f84043 100644
--- a/src/declarative/fx/qfxcomponentinstance.h
+++ b/src/declarative/fx/qfxcomponentinstance.h
@@ -42,7 +42,7 @@
#ifndef QFXCOMPONENTINSTANCE_H
#define QFXCOMPONENTINSTANCE_H
-#include <qfxitem.h>
+#include <QtDeclarative/qfxitem.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxcontentwrapper.h b/src/declarative/fx/qfxcontentwrapper.h
index 5d5a7e1..0b7253e 100644
--- a/src/declarative/fx/qfxcontentwrapper.h
+++ b/src/declarative/fx/qfxcontentwrapper.h
@@ -42,7 +42,7 @@
#ifndef QFXCONTENTWRAPPER_H
#define QFXCONTENTWRAPPER_H
-#include <qfxitem.h>
+#include <QtDeclarative/qfxitem.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxevents_p.h b/src/declarative/fx/qfxevents_p.h
index 30717ef..bcd9f2d 100644
--- a/src/declarative/fx/qfxevents_p.h
+++ b/src/declarative/fx/qfxevents_p.h
@@ -42,8 +42,8 @@
#ifndef QFXEVENTS_P_H
#define QFXEVENTS_P_H
-#include <qfxglobal.h>
-#include <qml.h>
+#include <QtDeclarative/qfxglobal.h>
+#include <QtDeclarative/qml.h>
#include <QtCore/qobject.h>
#include <QtGui/qevent.h>
diff --git a/src/declarative/fx/qfxflickable.h b/src/declarative/fx/qfxflickable.h
index c5a0593..3857017 100644
--- a/src/declarative/fx/qfxflickable.h
+++ b/src/declarative/fx/qfxflickable.h
@@ -42,7 +42,7 @@
#ifndef QFXFLICKABLE_H
#define QFXFLICKABLE_H
-#include <qfxitem.h>
+#include <QtDeclarative/qfxitem.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxflipable.cpp b/src/declarative/fx/qfxflipable.cpp
index 24ae428..edcc7cb 100644
--- a/src/declarative/fx/qfxflipable.cpp
+++ b/src/declarative/fx/qfxflipable.cpp
@@ -169,7 +169,6 @@ void QFxFlipable::setBack(QFxItem *back)
children()->append(d->back);
if (Front == d->current)
d->back->setOpacity(0.);
- d->setBackTransform();
}
/*!
@@ -203,8 +202,6 @@ void QFxFlipablePrivate::_q_updateAxis()
axisRotation.axis()->setEndX(axis->endX());
axisRotation.axis()->setEndY(axis->endY());
axisRotation.axis()->setEndZ(axis->endZ());
-
- setBackTransform();
}
void QFxFlipablePrivate::setBackTransform()
@@ -273,8 +270,10 @@ void QFxFlipable::setRotation(qreal angle)
d->current = newSide;
if (d->front)
d->front->setOpacity((d->current==Front)?1.:0.);
- if (d->back)
+ if (d->back) {
+ d->setBackTransform();
d->back->setOpacity((d->current==Back)?1.:0.);
+ }
emit sideChanged();
}
}
diff --git a/src/declarative/fx/qfxflipable.h b/src/declarative/fx/qfxflipable.h
index ef1832e..62b62a5 100644
--- a/src/declarative/fx/qfxflipable.h
+++ b/src/declarative/fx/qfxflipable.h
@@ -42,12 +42,12 @@
#ifndef QFXFLIPABLE_H
#define QFXFLIPABLE_H
-#include <QObject>
-#include <QTransform>
+#include <QtCore/QObject>
+#include <QtGui/QTransform>
#if defined(QFX_RENDER_OPENGL)
#include <QtGui/qmatrix4x4.h>
#endif
-#include <qfxitem.h>
+#include <QtDeclarative/qfxitem.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxfocuspanel.h b/src/declarative/fx/qfxfocuspanel.h
index 38f7a15..cec12a1 100644
--- a/src/declarative/fx/qfxfocuspanel.h
+++ b/src/declarative/fx/qfxfocuspanel.h
@@ -42,7 +42,7 @@
#ifndef QFXFOCUSPANEL_H
#define QFXFOCUSPANEL_H
-#include <qfxitem.h>
+#include <QtDeclarative/qfxitem.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxfocusrealm.h b/src/declarative/fx/qfxfocusrealm.h
index 6c35405..fdf1525 100644
--- a/src/declarative/fx/qfxfocusrealm.h
+++ b/src/declarative/fx/qfxfocusrealm.h
@@ -42,7 +42,7 @@
#ifndef QFXFOCUSREALM_H
#define QFXFOCUSREALM_H
-#include <qfxitem.h>
+#include <QtDeclarative/qfxitem.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxgridview.h b/src/declarative/fx/qfxgridview.h
index 2bbfc40..ff08831 100644
--- a/src/declarative/fx/qfxgridview.h
+++ b/src/declarative/fx/qfxgridview.h
@@ -42,7 +42,7 @@
#ifndef QFXGRIDVIEW_H
#define QFXGRIDVIEW_H
-#include <qfxflickable.h>
+#include <QtDeclarative/qfxflickable.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxhighlightfilter.h b/src/declarative/fx/qfxhighlightfilter.h
index 218f4e1..92a3dc7 100644
--- a/src/declarative/fx/qfxhighlightfilter.h
+++ b/src/declarative/fx/qfxhighlightfilter.h
@@ -42,8 +42,8 @@
#ifndef QFXHIGHLIGHTFILTER_H
#define QFXHIGHLIGHTFILTER_H
-#include <qsimplecanvasfilter.h>
-#include <qml.h>
+#include <QtDeclarative/qsimplecanvasfilter.h>
+#include <QtDeclarative/qml.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfximage.h b/src/declarative/fx/qfximage.h
index dc13a97..1436551 100644
--- a/src/declarative/fx/qfximage.h
+++ b/src/declarative/fx/qfximage.h
@@ -42,7 +42,7 @@
#ifndef QFXIMAGE_H
#define QFXIMAGE_H
-#include <qfxitem.h>
+#include <QtDeclarative/qfxitem.h>
#include <QtNetwork/qnetworkreply.h>
diff --git a/src/declarative/fx/qfxitem.h b/src/declarative/fx/qfxitem.h
index 437709f..d34a9fb 100644
--- a/src/declarative/fx/qfxitem.h
+++ b/src/declarative/fx/qfxitem.h
@@ -42,9 +42,9 @@
#ifndef QFXITEM_H
#define QFXITEM_H
-#include <QObject>
+#include <QtCore/QObject>
#include <QtScript/qscriptvalue.h>
-#include <QList>
+#include <QtCore/QList>
#include <QtDeclarative/qfxanchors.h>
#include <QtDeclarative/qfxglobal.h>
#include <QtDeclarative/qml.h>
diff --git a/src/declarative/fx/qfxitem_p.h b/src/declarative/fx/qfxitem_p.h
index 8ca7fda..85ce171 100644
--- a/src/declarative/fx/qfxitem_p.h
+++ b/src/declarative/fx/qfxitem_p.h
@@ -53,11 +53,11 @@
// We mean it.
//
-#include "qfxitem.h"
+#include <QtDeclarative/qfxitem.h>
#include <private/qsimplecanvasitem_p.h>
#include <private/qmlnullablevalue_p.h>
-#include <qml.h>
-#include <qmlcontext.h>
+#include <QtDeclarative/qml.h>
+#include <QtDeclarative/qmlcontext.h>
#include <QtCore/qlist.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/fx/qfxkeyactions.h b/src/declarative/fx/qfxkeyactions.h
index 7ad323a..a5aec2e 100644
--- a/src/declarative/fx/qfxkeyactions.h
+++ b/src/declarative/fx/qfxkeyactions.h
@@ -42,10 +42,10 @@
#ifndef QFXKEYACTIONS_H
#define QFXKEYACTIONS_H
-#include <qfxglobal.h>
-#include <QObject>
-#include <qml.h>
-#include <qfxitem.h>
+#include <QtCore/QObject>
+#include <QtDeclarative/qfxglobal.h>
+#include <QtDeclarative/qml.h>
+#include <QtDeclarative/qfxitem.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxkeyproxy.h b/src/declarative/fx/qfxkeyproxy.h
index ae5fce4..6cf0c0d 100644
--- a/src/declarative/fx/qfxkeyproxy.h
+++ b/src/declarative/fx/qfxkeyproxy.h
@@ -42,7 +42,7 @@
#ifndef QFXKEYPROXY_H
#define QFXKEYPROXY_H
-#include <qfxitem.h>
+#include <QtDeclarative/qfxitem.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxlayouts.h b/src/declarative/fx/qfxlayouts.h
index acfc0c4..35e41d8 100644
--- a/src/declarative/fx/qfxlayouts.h
+++ b/src/declarative/fx/qfxlayouts.h
@@ -42,10 +42,10 @@
#ifndef QFXLAYOUTS_H
#define QFXLAYOUTS_H
-#include <qfxitem.h>
-#include <QObject>
-#include <QString>
-#include <qmlstate.h>
+#include <QtCore/QObject>
+#include <QtCore/QString>
+#include <QtDeclarative/qfxitem.h>
+#include <QtDeclarative/qmlstate.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxlayouts_p.h b/src/declarative/fx/qfxlayouts_p.h
index 859482f..77b0ea1 100644
--- a/src/declarative/fx/qfxlayouts_p.h
+++ b/src/declarative/fx/qfxlayouts_p.h
@@ -53,11 +53,11 @@
// We mean it.
//
-#include "qfxlayouts.h"
-#include "qfxitem_p.h"
-#include <QObject>
-#include <QString>
-#include <qmlstate.h>
+#include <private/qfxitem_p.h>
+#include <QtCore/QObject>
+#include <QtCore/QString>
+#include <QtDeclarative/qfxlayouts.h>
+#include <QtDeclarative/qmlstate.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/fx/qfxlistview.h b/src/declarative/fx/qfxlistview.h
index 40c2496..6bf2b54 100644
--- a/src/declarative/fx/qfxlistview.h
+++ b/src/declarative/fx/qfxlistview.h
@@ -42,7 +42,7 @@
#ifndef QFXLISTVIEW_H
#define QFXLISTVIEW_H
-#include <qfxflickable.h>
+#include <QtDeclarative/qfxflickable.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxmouseregion.h b/src/declarative/fx/qfxmouseregion.h
index 2ba4a50..1d1ec93 100644
--- a/src/declarative/fx/qfxmouseregion.h
+++ b/src/declarative/fx/qfxmouseregion.h
@@ -42,7 +42,7 @@
#ifndef QFXMOUSEREGION_H
#define QFXMOUSEREGION_H
-#include <qfxitem.h>
+#include <QtDeclarative/qfxitem.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxpainteditem.h b/src/declarative/fx/qfxpainteditem.h
index 015a035..6cd21e6 100644
--- a/src/declarative/fx/qfxpainteditem.h
+++ b/src/declarative/fx/qfxpainteditem.h
@@ -42,8 +42,8 @@
#ifndef QFXIMAGEITEM_H
#define QFXIMAGEITEM_H
-#include <qfxglobal.h>
-#include <qfxitem.h>
+#include <QtDeclarative/qfxglobal.h>
+#include <QtDeclarative/qfxitem.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxpainteditem_p.h b/src/declarative/fx/qfxpainteditem_p.h
index b0432ac..5d5da6b 100644
--- a/src/declarative/fx/qfxpainteditem_p.h
+++ b/src/declarative/fx/qfxpainteditem_p.h
@@ -53,8 +53,8 @@
// We mean it.
//
-#include "qfxitem_p.h"
-#include <qsimplecanvas.h>
+#include <private/qfxitem_p.h>
+#include <QtDeclarative/qsimplecanvas.h>
#if defined(QFX_RENDER_OPENGL)
#include "gltexture.h"
diff --git a/src/declarative/fx/qfxparticles.h b/src/declarative/fx/qfxparticles.h
index a879b2d..31a00fb 100644
--- a/src/declarative/fx/qfxparticles.h
+++ b/src/declarative/fx/qfxparticles.h
@@ -42,7 +42,7 @@
#ifndef QFXPARTICLES_H
#define QFXPARTICLES_H
-#include <qfxitem.h>
+#include <QtDeclarative/qfxitem.h>
#if defined(QFX_RENDER_OPENGL)
#include "gltexture.h"
diff --git a/src/declarative/fx/qfxpath.h b/src/declarative/fx/qfxpath.h
index c594793..10cf252 100644
--- a/src/declarative/fx/qfxpath.h
+++ b/src/declarative/fx/qfxpath.h
@@ -42,10 +42,10 @@
#ifndef QFXPATH_H
#define QFXPATH_H
-#include <QObject>
-#include <QPainterPath>
-#include <qml.h>
-#include <qfxitem.h>
+#include <QtCore/QObject>
+#include <QtGui/QPainterPath>
+#include <QtDeclarative/qml.h>
+#include <QtDeclarative/qfxitem.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxpathview.h b/src/declarative/fx/qfxpathview.h
index 2ecd04e..32e03b8 100644
--- a/src/declarative/fx/qfxpathview.h
+++ b/src/declarative/fx/qfxpathview.h
@@ -42,8 +42,8 @@
#ifndef QFXPATHVIEW_H
#define QFXPATHVIEW_H
-#include <qfxitem.h>
-#include <qfxpath.h>
+#include <QtDeclarative/qfxitem.h>
+#include <QtDeclarative/qfxpath.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxpixmap.h b/src/declarative/fx/qfxpixmap.h
index 297dba7..fd56ee4 100644
--- a/src/declarative/fx/qfxpixmap.h
+++ b/src/declarative/fx/qfxpixmap.h
@@ -42,10 +42,10 @@
#ifndef QFXPIXMAP_H
#define QFXPIXMAP_H
-#include <QString>
-#include <qsimplecanvas.h>
-#include <qfxglobal.h>
-#include <QPixmap>
+#include <QtCore/QString>
+#include <QtGui/QPixmap>
+#include <QtDeclarative/qsimplecanvas.h>
+#include <QtDeclarative/qfxglobal.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxrect.cpp b/src/declarative/fx/qfxrect.cpp
index d75a45a..b61baec 100644
--- a/src/declarative/fx/qfxrect.cpp
+++ b/src/declarative/fx/qfxrect.cpp
@@ -52,6 +52,11 @@ QML_DEFINE_TYPE(QFxPen,Pen);
\ingroup group_utility
\brief The QFxPen class provides a pen used for drawing rect borders on a QFxView.
+ By default, the pen is invalid and nothing is drawn. You must either set a color (then the default
+ width is 0) or a width (then the default color is black).
+
+ A width of 0 is a single-pixel line on the border of the item being painted.
+
Example:
\qml
Rect { pen.width: 2; pen.color: "red" ... }
@@ -61,8 +66,9 @@ QML_DEFINE_TYPE(QFxPen,Pen);
/*! \property QFxPen::width
\brief the width of the pen.
- The default width is 1. If the width is less than 1 the pen is considered invalid
- and won't be used.
+ A width of 0 is a single-pixel line on the border of the item being painted.
+
+ If the width is less than 0 the pen is considered invalid and won't be used.
*/
/*!
@@ -86,8 +92,28 @@ QML_DEFINE_TYPE(QFxPen,Pen);
void QFxPen::setColor(const QColor &c)
{
_color = c;
- emit updated();
_valid = _color.alpha() ? true : false;
+ emit updated();
+}
+
+/*!
+ \property QFxPen::width
+ \brief the width of the pen.
+
+ \qml
+ // rect with green border using hexidecimal notation
+ Rect { pen.width: 4 }
+ \endqml
+
+ A width of 0 creates a thin line. For no line, use a negative width or a transparent color.
+
+ Odd pen widths generally lead to half-pixel painting.
+*/
+void QFxPen::setWidth(int w)
+{
+ _width = w;
+ _valid = (_width < 0) ? false : true;
+ emit updated();
}
@@ -167,6 +193,8 @@ void QFxRect::doUpdate()
Q_D(QFxRect);
d->_rectTexture.clear();
#endif
+ const int pw = d->_pen && d->_pen->isValid() ? d->_pen->width() : 0;
+ setPaintMargin((pw+1)/2);
update();
}
@@ -372,14 +400,19 @@ void QFxRect::generateRoundedRect()
{
Q_D(QFxRect);
if (d->_rectImage.isNull()) {
- d->_rectImage = QImage(d->_radius*2 + 1, d->_radius*2 + 1, QImage::Format_ARGB32_Premultiplied);
+ const int pw = d->_pen && d->_pen->isValid() ? d->_pen->width() : 0;
+ d->_rectImage = QImage(d->_radius*2 + 1 + pw*2, d->_radius*2 + 1 + pw*2, QImage::Format_ARGB32_Premultiplied);
d->_rectImage.fill(0);
QPainter p(&(d->_rectImage));
- QPen pn(QColor(pen()->color()), pen()->width());
p.setRenderHint(QPainter::Antialiasing);
- p.setPen(pn);
+ if (d->_pen && d->_pen->isValid()) {
+ QPen pn(QColor(pen()->color()), pen()->width());
+ p.setPen(pn);
+ } else {
+ p.setPen(Qt::NoPen);
+ }
p.setBrush(d->_color);
- p.drawRoundedRect(0, 0, d->_rectImage.width(), d->_rectImage.height(), d->_radius, d->_radius);
+ p.drawRoundedRect((pw+1)/2, (pw+1)/2, d->_rectImage.width()-(pw+1)/2*2, d->_rectImage.height()-(pw+1)/2*2, d->_radius, d->_radius);
}
}
@@ -387,14 +420,19 @@ void QFxRect::generateBorderedRect()
{
Q_D(QFxRect);
if (d->_rectImage.isNull()) {
- d->_rectImage = QImage(d->pen()->width()*2 + 1, d->pen()->width()*2 + 1, QImage::Format_ARGB32_Premultiplied);
+ const int pw = d->_pen && d->_pen->isValid() ? d->_pen->width() : 0;
+ d->_rectImage = QImage(d->pen()->width()*2 + 1 + pw*2, d->pen()->width()*2 + 1 + pw*2, QImage::Format_ARGB32_Premultiplied);
d->_rectImage.fill(0);
QPainter p(&(d->_rectImage));
- QPen pn(QColor(pen()->color()), pen()->width());
p.setRenderHint(QPainter::Antialiasing);
- p.setPen(pn);
+ if (d->_pen && d->_pen->isValid()) {
+ QPen pn(QColor(pen()->color()), pen()->width());
+ p.setPen(pn);
+ } else {
+ p.setPen(Qt::NoPen);
+ }
p.setBrush(d->_color);
- p.drawRect(0, 0, d->_rectImage.width(), d->_rectImage.height());
+ p.drawRect(qreal(pw+1)/2, qreal(pw+1)/2, d->_rectImage.width()-(pw+1)/2*2, d->_rectImage.height()-(pw+1)/2*2);
}
}
#elif defined(QFX_RENDER_OPENGL)
@@ -402,14 +440,19 @@ void QFxRect::generateRoundedRect()
{
Q_D(QFxRect);
if (d->_rectTexture.isNull()) {
- QImage roundRect(int(d->_radius*2 + 1), int(d->_radius*2 + 1), QImage::Format_ARGB32);
+ const int pw = d->_pen && d->_pen->isValid() ? d->_pen->width() : 0;
+ QImage roundRect(d->_radius*2 + 4 + pw*2, d->_radius*2 + 4 + pw*2, QImage::Format_ARGB32_Premultiplied);
roundRect.fill(0);
QPainter p(&roundRect);
- QPen pn(QColor(pen()->color()), pen()->width());
p.setRenderHint(QPainter::Antialiasing);
- p.setPen(pn);
+ if (d->_pen && d->_pen->isValid()) {
+ QPen pn(QColor(pen()->color()), pen()->width());
+ p.setPen(pn);
+ } else {
+ p.setPen(Qt::NoPen);
+ }
p.setBrush(d->_color);
- p.drawRoundedRect(0, 0, roundRect.width(), roundRect.height(), d->_radius, d->_radius);
+ p.drawRoundedRect((pw+1)/2, (pw+1)/2, roundRect.width()-(pw+1)/2*2, roundRect.height()-(pw+1)/2*2, d->_radius, d->_radius);
d->_rectTexture.setImage(roundRect);
}
}
@@ -418,14 +461,19 @@ void QFxRect::generateBorderedRect()
{
Q_D(QFxRect);
if (d->_rectTexture.isNull()) {
- QImage borderedRect(d->pen()->width()*2 + 1, d->pen()->width()*2 + 1, QImage::Format_ARGB32_Premultiplied);
+ const int pw = d->_pen && d->_pen->isValid() ? d->_pen->width() : 0;
+ QImage borderedRect(pw*2 + 4, pw*2 + 4, QImage::Format_ARGB32_Premultiplied);
borderedRect.fill(0);
QPainter p(&(borderedRect));
- QPen pn(QColor(pen()->color()), pen()->width());
p.setRenderHint(QPainter::Antialiasing);
- p.setPen(pn);
+ if (d->_pen && d->_pen->isValid()) {
+ QPen pn(QColor(pen()->color()), pen()->width());
+ p.setPen(pn);
+ } else {
+ p.setPen(Qt::NoPen);
+ }
p.setBrush(d->_color);
- p.drawRect(0, 0, borderedRect.width(), borderedRect.height());
+ p.drawRect(qreal(pw+1)/2, qreal(pw+1)/2, borderedRect.width()-(pw+1)/2*2, borderedRect.height()-(pw+1)/2*2);
d->_rectTexture.setImage(borderedRect);
}
}
@@ -458,9 +506,13 @@ void QFxRect::drawRect(QPainter &p)
// XXX This path is still slower than the image path
// Image path won't work for gradients though
p.save();
- QPen pn(QColor(pen()->color()), pen()->width());
p.setRenderHint(QPainter::Antialiasing);
- p.setPen(pn);
+ if (d->_pen && d->_pen->isValid()) {
+ QPen pn(QColor(pen()->color()), pen()->width());
+ p.setPen(pn);
+ } else {
+ p.setPen(Qt::NoPen);
+ }
if (d->_gradcolor.isValid()){
QLinearGradient grad(0, 0, 0, height());
grad.setColorAt(0, d->_color);
@@ -476,67 +528,72 @@ void QFxRect::drawRect(QPainter &p)
p.restore();
} else {
int offset = 0;
+ const int pw = d->_pen && d->_pen->isValid() ? (d->_pen->width()+1)/2*2 : 0;
+
if (d->_radius > 0) {
generateRoundedRect();
//### implicit conversion to int
- offset = d->_radius;
+ offset = int(d->_radius+0.5+pw);
} else {
generateBorderedRect();
- offset = d->pen()->width();
+ offset = pw;
}
//basically same code as QFxImage uses to paint sci images
- int w = width();
- int h = height();
+ int w = width()+pw;
+ int h = height()+pw;
int xOffset = offset;
int xSide = xOffset * 2;
+ bool xMiddles=true;
if (xSide > w) {
- xOffset = w/2;
+ xMiddles=false;
+ xOffset = w/2 + 1;
xSide = xOffset * 2;
}
int yOffset = offset;
int ySide = yOffset * 2;
+ bool yMiddles=true;
if (ySide > h) {
- yOffset = h/2;
+ yMiddles = false;
+ yOffset = h/2 + 1;
ySide = yOffset * 2;
}
// Upper left
- p.drawImage(QRect(0, 0, xOffset, yOffset), d->_rectImage, QRect(0, 0, xOffset, yOffset));
+ p.drawImage(QRect(-pw/2, -pw/2, xOffset, yOffset), d->_rectImage, QRect(0, 0, xOffset, yOffset));
// Upper middle
- if (d->_rectImage.width() - xSide)
- p.drawImage(QRect(xOffset, 0, w - xSide, yOffset), d->_rectImage,
- QRect(xOffset, 0, d->_rectImage.width() - xSide, yOffset));
+ if (xMiddles)
+ p.drawImage(QRect(xOffset-pw/2, -pw/2, width() - xSide + pw, yOffset), d->_rectImage,
+ QRect(d->_rectImage.width()/2, 0, 1, yOffset));
// Upper right
- if (d->_rectImage.width() - xOffset) {
- p.drawImage(QPoint(w-xOffset, 0), d->_rectImage,
- QRect(d->_rectImage.width()-xOffset, 0, xOffset, yOffset));
- }
+ p.drawImage(QPoint(width()-xOffset+pw/2, -pw/2), d->_rectImage,
+ QRect(d->_rectImage.width()-xOffset, 0, xOffset, yOffset));
// Middle left
- if (d->_rectImage.height() - ySide)
- p.drawImage(QRect(0, yOffset, xOffset, height() - ySide), d->_rectImage,
- QRect(0, yOffset, xOffset, d->_rectImage.height() - ySide));
+ if (yMiddles)
+ p.drawImage(QRect(-pw/2, yOffset-pw/2, xOffset, height() - ySide + pw), d->_rectImage,
+ QRect(0, d->_rectImage.height()/2, xOffset, 1));
// Middle
- if (d->_rectImage.width() - xSide && d->_rectImage.height() - ySide)
- p.drawImage(QRect(xOffset, yOffset, w - xSide, height() - ySide), d->_rectImage,
- QRect(xOffset, yOffset, d->_rectImage.width() - xSide, d->_rectImage.height() - ySide));
- // Midlle right
- if (d->_rectImage.height() - ySide)
- p.drawImage(QRect(w-xOffset, yOffset, xOffset, height() - ySide), d->_rectImage,
- QRect(d->_rectImage.width()-xOffset, yOffset, xOffset, d->_rectImage.height() - ySide));
+ if (xMiddles && yMiddles)
+ // XXX paint errors in animation example
+ //p.fillRect(xOffset-pw/2, yOffset-pw/2, width() - xSide + pw, height() - ySide + pw, d->getColor());
+ p.drawImage(QRect(xOffset-pw/2, yOffset-pw/2, width() - xSide + pw, height() - ySide + pw), d->_rectImage,
+ QRect(d->_rectImage.width()/2, d->_rectImage.height()/2, 1, 1));
+ // Middle right
+ if (yMiddles)
+ p.drawImage(QRect(width()-xOffset+pw/2, yOffset-pw/2, xOffset, height() - ySide + pw), d->_rectImage,
+ QRect(d->_rectImage.width()-xOffset, d->_rectImage.height()/2, xOffset, 1));
// Lower left
- p.drawImage(QPoint(0, height() - yOffset), d->_rectImage, QRect(0, d->_rectImage.height() - yOffset, xOffset, yOffset));
+ p.drawImage(QPoint(-pw/2, height() - yOffset + pw/2), d->_rectImage, QRect(0, d->_rectImage.height() - yOffset, xOffset, yOffset));
// Lower Middle
- if (d->_rectImage.width() - xSide)
- p.drawImage(QRect(xOffset, height() - yOffset, w - xSide, yOffset), d->_rectImage,
- QRect(xOffset, d->_rectImage.height() - yOffset, d->_rectImage.width() - xSide, yOffset));
+ if (xMiddles)
+ p.drawImage(QRect(xOffset-pw/2, height() - yOffset +pw/2, width() - xSide + pw, yOffset), d->_rectImage,
+ QRect(d->_rectImage.width()/2, d->_rectImage.height() - yOffset, 1, yOffset));
// Lower Right
- if (d->_rectImage.width() - xOffset)
- p.drawImage(QPoint(w-xOffset, height() - yOffset), d->_rectImage,
- QRect(d->_rectImage.width()-xOffset, d->_rectImage.height() - yOffset, xOffset, yOffset));
+ p.drawImage(QPoint(width()-xOffset+pw/2, height() - yOffset+pw/2), d->_rectImage,
+ QRect(d->_rectImage.width()-xOffset, d->_rectImage.height() - yOffset, xOffset, yOffset));
}
}
#endif
@@ -598,53 +655,60 @@ void QFxRect::paintGLContents(GLPainter &p)
}
} else {
qreal offset = 0;
+ qreal pw = d->_pen && d->_pen->isValid() ? d->_pen->width() : 0.0;
+
if (d->_radius > 0) {
generateRoundedRect();
- offset = d->_radius;
+ offset = d->_radius + pw+1.5;
} else {
generateBorderedRect();
- offset = d->pen()->width();
+ offset = pw+1.5;
}
QGLShaderProgram *shader = p.useTextureShader();
- float imgWidth = d->_rectTexture.width();
- float imgHeight = d->_rectTexture.height();
- if (!imgWidth || !imgHeight)
+ float texWidth = d->_rectTexture.width();
+ float texHeight = d->_rectTexture.height();
+ if (!texWidth || !texHeight)
return;
- float widthV = width();
- float heightV = height();
+ float widthV = qreal(width())+pw/2;
+ float heightV = qreal(height())+pw/2;
- float texleft = 0;
- float texright = 1;
- float textop = 1;
- float texbottom = 0;
- float imgleft = 0;
- float imgright = widthV;
- float imgtop = 0;
- float imgbottom = heightV;
+ float xOffset = offset;
+ bool xMiddles = true;
+ if (xOffset*2 > width()+pw) {
+ xMiddles = false;
+ xOffset = (width()+pw)/2;
+ }
+ float yOffset = offset;
+ bool yMiddles = true;
+ if (yOffset*2 > height()+pw) {
+ yMiddles = false;
+ yOffset = (height()+pw)/2;
+ }
- texleft = float(offset) / imgWidth;
- imgleft = offset;
- texright = 1. - float(offset) / imgWidth;
- imgright = widthV - offset;
- textop = 1. - float(offset) / imgHeight;
- imgtop = offset;
- texbottom = float(offset) / imgHeight;
- imgbottom = heightV - offset;
+ float texleft = xOffset / texWidth;
+ float imgleft = xOffset-pw/2;
+ float texright = (texWidth-xOffset) / texWidth;
+ float imgright = widthV - xOffset;
+
+ float textop = yOffset / texHeight;
+ float imgtop = yOffset-pw/2;
+ float texbottom = (texHeight-yOffset) / texHeight;
+ float imgbottom = heightV - yOffset;
//Bug 231768: Inappropriate interpolation was occuring on 3x3 textures
if (offset==1)
texleft=texright=textop=texbottom=0.5;
- float vert1[] = { 0, 0,
- 0, imgtop,
- imgleft, 0,
+ float vert1[] = { -pw/2, -pw/2,
+ -pw/2, imgtop,
+ imgleft, -pw/2,
imgleft, imgtop,
- imgright, 0,
+ imgright, -pw/2,
imgright, imgtop,
- widthV, 0,
+ widthV, -pw/2,
widthV, imgtop };
float tex1[] = { 0, 0,
0, textop,
@@ -654,8 +718,8 @@ void QFxRect::paintGLContents(GLPainter &p)
texright, textop,
1, 0,
1, textop };
- float vert2[] = { 0, imgtop,
- 0, imgbottom,
+ float vert2[] = { -pw/2, imgtop,
+ -pw/2, imgbottom,
imgleft, imgtop,
imgleft, imgbottom,
imgright, imgtop,
@@ -670,31 +734,31 @@ void QFxRect::paintGLContents(GLPainter &p)
texright, texbottom,
1, textop,
1, texbottom };
- float vert3[] = { 0, imgbottom,
- 0, heightV,
- imgleft, imgbottom,
+ float vert3[] = { -pw/2, heightV,
+ -pw/2, imgbottom,
imgleft, heightV,
- imgright, imgbottom,
+ imgleft, imgbottom,
imgright, heightV,
- widthV, imgbottom,
- widthV, heightV };
- float tex3[] = { 0, texbottom,
- 0, 0,
+ imgright, imgbottom,
+ widthV, heightV,
+ widthV, imgbottom };
+ float tex3[] = { 0, 1,
+ 0, texbottom,
+ texleft, 1,
texleft, texbottom,
- texleft, 0,
+ texright, 1,
texright, texbottom,
- texright, 0,
- 1, texbottom,
- 1, 0 };
-
- glBindTexture(GL_TEXTURE_2D, d->_rectTexture.texture());
+ 1, 1,
+ 1, texbottom };
shader->setAttributeArray(SingleTextureShader::Vertices, vert1, 2);
shader->setAttributeArray(SingleTextureShader::TextureCoords, tex1, 2);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);
- shader->setAttributeArray(SingleTextureShader::Vertices, vert2, 2);
- shader->setAttributeArray(SingleTextureShader::TextureCoords, tex2, 2);
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);
+ if (yMiddles) {
+ shader->setAttributeArray(SingleTextureShader::Vertices, vert2, 2);
+ shader->setAttributeArray(SingleTextureShader::TextureCoords, tex2, 2);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);
+ }
shader->setAttributeArray(SingleTextureShader::Vertices, vert3, 2);
shader->setAttributeArray(SingleTextureShader::TextureCoords, tex3, 2);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);
@@ -773,9 +837,9 @@ void QFxRect::paintGLContents(GLPainter &p)
glColor4f(1, 1, 1, p.activeOpacity);
}
- float imgWidth = d->_rectTexture.width();
- float imgHeight = d->_rectTexture.height();
- if (!imgWidth || !imgHeight)
+ float texWidth = d->_rectTexture.width();
+ float texHeight = d->_rectTexture.height();
+ if (!texWidth || !texHeight)
return;
float widthV = width();
@@ -790,13 +854,13 @@ void QFxRect::paintGLContents(GLPainter &p)
float imgtop = 0;
float imgbottom = heightV;
- texleft = float(offset) / imgWidth;
+ texleft = float(offset) / texWidth;
imgleft = offset;
- texright = 1. - float(offset) / imgWidth;
+ texright = 1. - float(offset) / texWidth;
imgright = widthV - offset;
- textop = 1. - float(offset) / imgHeight;
+ textop = 1. - float(offset) / texHeight;
imgtop = offset;
- texbottom = float(offset) / imgHeight;
+ texbottom = float(offset) / texHeight;
imgbottom = heightV - offset;
float vert1[] = { 0, 0,
diff --git a/src/declarative/fx/qfxrect.h b/src/declarative/fx/qfxrect.h
index 42e7b2f..420ec44 100644
--- a/src/declarative/fx/qfxrect.h
+++ b/src/declarative/fx/qfxrect.h
@@ -42,7 +42,7 @@
#ifndef QFXRECT_H
#define QFXRECT_H
-#include <qfxitem.h>
+#include <QtDeclarative/qfxitem.h>
QT_BEGIN_HEADER
@@ -58,11 +58,11 @@ class Q_DECLARATIVE_EXPORT QFxPen : public QObject
Q_PROPERTY(QColor color READ color WRITE setColor)
public:
QFxPen(QObject *parent=0)
- : QObject(parent), _width(1), _color("#000000"), _valid(false)
+ : QObject(parent), _width(0), _color("#000000"), _valid(false)
{}
int width() const { return _width; }
- void setWidth(int w) { _width = w; emit updated(); _valid = (_width < 1) ? false : true; }
+ void setWidth(int w);
QColor color() const { return _color; }
void setColor(const QColor &c);
diff --git a/src/declarative/fx/qfxreflectionfilter.h b/src/declarative/fx/qfxreflectionfilter.h
index b0cc7b2..383e12f 100644
--- a/src/declarative/fx/qfxreflectionfilter.h
+++ b/src/declarative/fx/qfxreflectionfilter.h
@@ -42,8 +42,8 @@
#ifndef QFXREFLECTIONFILTER_H
#define QFXREFLECTIONFILTER_H
-#include <qsimplecanvasfilter.h>
-#include <qml.h>
+#include <QtDeclarative/qsimplecanvasfilter.h>
+#include <QtDeclarative/qml.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxrepeater.h b/src/declarative/fx/qfxrepeater.h
index 8efd281..362242b 100644
--- a/src/declarative/fx/qfxrepeater.h
+++ b/src/declarative/fx/qfxrepeater.h
@@ -42,7 +42,7 @@
#ifndef QFXREPEATER_H
#define QFXREPEATER_H
-#include <qfxitem.h>
+#include <QtDeclarative/qfxitem.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxscalegrid.h b/src/declarative/fx/qfxscalegrid.h
index 9010ce7..d0f735f 100644
--- a/src/declarative/fx/qfxscalegrid.h
+++ b/src/declarative/fx/qfxscalegrid.h
@@ -42,13 +42,13 @@
#ifndef QFXSCALEGRID_H
#define QFXSCALEGRID_H
-#include <qfxglobal.h>
-#include <QImage>
-#include <QString>
-#include <QObject>
-#include <qsimplecanvas.h>
-#include <qfxpixmap.h>
-#include <qml.h>
+#include <QtCore/QString>
+#include <QtCore/QObject>
+#include <QtGui/QImage>
+#include <QtDeclarative/qfxglobal.h>
+#include <QtDeclarative/qsimplecanvas.h>
+#include <QtDeclarative/qfxpixmap.h>
+#include <QtDeclarative/qml.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxshadowfilter.h b/src/declarative/fx/qfxshadowfilter.h
index 9ba3b7b..fc54e01 100644
--- a/src/declarative/fx/qfxshadowfilter.h
+++ b/src/declarative/fx/qfxshadowfilter.h
@@ -42,8 +42,8 @@
#ifndef QFXSHADOWFILTER_H
#define QFXSHADOWFILTER_H
-#include <qsimplecanvasfilter.h>
-#include <qml.h>
+#include <QtDeclarative/qsimplecanvasfilter.h>
+#include <QtDeclarative/qml.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxtext.h b/src/declarative/fx/qfxtext.h
index 0de884b..ee9082b 100644
--- a/src/declarative/fx/qfxtext.h
+++ b/src/declarative/fx/qfxtext.h
@@ -42,8 +42,8 @@
#ifndef QFXTEXT_H
#define QFXTEXT_H
-#include <qfxitem.h>
-#include <qmlfont.h>
+#include <QtDeclarative/qfxitem.h>
+#include <QtDeclarative/qmlfont.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxtextedit.h b/src/declarative/fx/qfxtextedit.h
index 0aaa17b..f702101 100644
--- a/src/declarative/fx/qfxtextedit.h
+++ b/src/declarative/fx/qfxtextedit.h
@@ -42,8 +42,8 @@
#ifndef QFXTEXTEDIT_H
#define QFXTEXTEDIT_H
-#include <qfxtext.h>
-#include <qfxpainteditem.h>
+#include <QtDeclarative/qfxtext.h>
+#include <QtDeclarative/qfxpainteditem.h>
#include <QtGui/qtextdocument.h>
#include <QtGui/qtextoption.h>
diff --git a/src/declarative/fx/qfxtransform.h b/src/declarative/fx/qfxtransform.h
index 2e17ed5..31374df 100644
--- a/src/declarative/fx/qfxtransform.h
+++ b/src/declarative/fx/qfxtransform.h
@@ -42,12 +42,12 @@
#ifndef QFXTRANSFORM_H
#define QFXTRANSFORM_H
-#include <QObject>
-#include <QTransform>
+#include <QtCore/QObject>
+#include <QtGui/QTransform>
#if defined(QFX_RENDER_OPENGL)
#include <QtGui/qmatrix4x4.h>
#endif
-#include <qfxitem.h>
+#include <QtDeclarative/qfxitem.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxvisualitemmodel.h b/src/declarative/fx/qfxvisualitemmodel.h
index 5db5209..586d837 100644
--- a/src/declarative/fx/qfxvisualitemmodel.h
+++ b/src/declarative/fx/qfxvisualitemmodel.h
@@ -44,7 +44,7 @@
#include <QtCore/qobject.h>
#include <QtCore/qabstractitemmodel.h>
-#include <qml.h>
+#include <QtDeclarative/qml.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxwebview.h b/src/declarative/fx/qfxwebview.h
index afd5b0f..6a3dad5 100644
--- a/src/declarative/fx/qfxwebview.h
+++ b/src/declarative/fx/qfxwebview.h
@@ -42,12 +42,12 @@
#ifndef QFXWEBVIEW_H
#define QFXWEBVIEW_H
-#include <QAction>
-#include <QUrl>
-#include <qfxglobal.h>
-#include <qfxpainteditem.h>
+#include <QtGui/QAction>
+#include <QtCore/QUrl>
+#include <QtDeclarative/qfxglobal.h>
+#include <QtDeclarative/qfxpainteditem.h>
#include <QtNetwork/qnetworkaccessmanager.h>
-#include <QWebPage>
+#include <QtWebKit/QWebPage>
QT_BEGIN_HEADER
diff --git a/src/declarative/fx/qfxwidgetcontainer.h b/src/declarative/fx/qfxwidgetcontainer.h
index 65e4352..3b1f016 100644
--- a/src/declarative/fx/qfxwidgetcontainer.h
+++ b/src/declarative/fx/qfxwidgetcontainer.h
@@ -48,6 +48,8 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
+QT_MODULE(Declarative)
+
class QGraphicsWidget;
class Q_DECLARATIVE_EXPORT QFxWidgetContainer : public QFxItem
diff --git a/src/declarative/opengl/glheaders.h b/src/declarative/opengl/glheaders.h
index f0f6a55..fd1da18 100644
--- a/src/declarative/opengl/glheaders.h
+++ b/src/declarative/opengl/glheaders.h
@@ -42,7 +42,7 @@
#ifndef _GLHEADERS_H_
#define _GLHEADERS_H_
-#include <qfxglobal.h>
+#include <QtDeclarative/qfxglobal.h>
#define GL_GLEXT_PROTOTYPES 1
#include <QtOpenGL/qgl.h>
diff --git a/src/declarative/opengl/glsave.h b/src/declarative/opengl/glsave.h
index cca3d3c..8256162 100644
--- a/src/declarative/opengl/glsave.h
+++ b/src/declarative/opengl/glsave.h
@@ -42,9 +42,9 @@
#ifndef _GLSAVE_H_
#define _GLSAVE_H_
-#include <qglobal.h>
-#include <qfxglobal.h>
-#include <QRect>
+#include <QtCore/qglobal.h>
+#include <QtDeclarative/qfxglobal.h>
+#include <QtCore/QRect>
#include "glheaders.h"
diff --git a/src/declarative/opengl/gltexture.h b/src/declarative/opengl/gltexture.h
index f920b60..8704498 100644
--- a/src/declarative/opengl/gltexture.h
+++ b/src/declarative/opengl/gltexture.h
@@ -42,10 +42,10 @@
#ifndef _GLTEXTURE_H_
#define _GLTEXTURE_H_
-#include <qfxglobal.h>
+#include <QtDeclarative/qfxglobal.h>
-#include <QRect>
-#include <QPoint>
+#include <QtCore/QRect>
+#include <QtCore/QPoint>
#include "glheaders.h"
diff --git a/src/declarative/qml/qmlbindablevalue.h b/src/declarative/qml/qmlbindablevalue.h
index c4ef64a..7831177 100644
--- a/src/declarative/qml/qmlbindablevalue.h
+++ b/src/declarative/qml/qmlbindablevalue.h
@@ -42,10 +42,10 @@
#ifndef QMLBINDABLEVALUE_H
#define QMLBINDABLEVALUE_H
-#include <QObject>
-#include <qfxglobal.h>
-#include <qml.h>
-#include <qmlpropertyvaluesource.h>
+#include <QtCore/QObject>
+#include <QtDeclarative/qfxglobal.h>
+#include <QtDeclarative/qml.h>
+#include <QtDeclarative/qmlpropertyvaluesource.h>
#include <QtDeclarative/qmlexpression.h>
diff --git a/src/declarative/qml/qmlbindablevalue_p.h b/src/declarative/qml/qmlbindablevalue_p.h
index d9af0ef..9973bdc 100644
--- a/src/declarative/qml/qmlbindablevalue_p.h
+++ b/src/declarative/qml/qmlbindablevalue_p.h
@@ -43,8 +43,8 @@
#define QMLBINDABLEVALUE_P_H
#include <private/qobject_p.h>
-#include <qmlbindablevalue.h>
-#include <qmlmetaproperty.h>
+#include <QtDeclarative/qmlbindablevalue.h>
+#include <QtDeclarative/qmlmetaproperty.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/qml/qmlboundsignal_p.h b/src/declarative/qml/qmlboundsignal_p.h
index e84f0c1..2c05770 100644
--- a/src/declarative/qml/qmlboundsignal_p.h
+++ b/src/declarative/qml/qmlboundsignal_p.h
@@ -42,7 +42,7 @@
#ifndef QMLBOUNDSIGNAL_P_H
#define QMLBOUNDSIGNAL_P_H
-#include <qmlexpression.h>
+#include <QtDeclarative/qmlexpression.h>
#include <private/qobject_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/qml/qmlcompiledcomponent_p.h b/src/declarative/qml/qmlcompiledcomponent_p.h
index c5e1226..2201423 100644
--- a/src/declarative/qml/qmlcompiledcomponent_p.h
+++ b/src/declarative/qml/qmlcompiledcomponent_p.h
@@ -42,7 +42,7 @@
#ifndef QMLCOMPILEDCOMPONENT_P_H
#define QMLCOMPILEDCOMPONENT_P_H
-#include <qml.h>
+#include <QtDeclarative/qml.h>
#include <private/qmlinstruction_p.h>
#include <private/qmlcompiler_p.h>
#include <private/qmlrefcount_p.h>
diff --git a/src/declarative/qml/qmlcompiler_p.h b/src/declarative/qml/qmlcompiler_p.h
index 87c1b82..bc04cfa 100644
--- a/src/declarative/qml/qmlcompiler_p.h
+++ b/src/declarative/qml/qmlcompiler_p.h
@@ -44,8 +44,8 @@
#include <QtCore/qbytearray.h>
#include <QtCore/qset.h>
-#include <qml.h>
-#include <qmlerror.h>
+#include <QtDeclarative/qml.h>
+#include <QtDeclarative/qmlerror.h>
#include <private/qmlinstruction_p.h>
#include <private/qmlcompositetypemanager_p.h>
#include <private/qmlparser_p.h>
diff --git a/src/declarative/qml/qmlcomponent_p.h b/src/declarative/qml/qmlcomponent_p.h
index 4de47c6..254d9ba 100644
--- a/src/declarative/qml/qmlcomponent_p.h
+++ b/src/declarative/qml/qmlcomponent_p.h
@@ -42,21 +42,21 @@
#ifndef QMLCOMPONENT_P_H
#define QMLCOMPONENT_P_H
-#include <QString>
-#include <QStringList>
-#include <QList>
-#include "private/qobject_p.h"
-#include "private/qmlengine_p.h"
-#include "private/qmlcompositetypemanager_p.h"
-#include <qmlerror.h>
-#include "qmlcomponent.h"
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QList>
+#include <private/qobject_p.h>
+#include <private/qmlengine_p.h>
+#include <private/qmlcompositetypemanager_p.h>
+#include <QtDeclarative/qmlerror.h>
+#include <QtDeclarative/qmlcomponent.h>
+#include <QtDeclarative/qml.h>
+
+QT_BEGIN_NAMESPACE
+
class QmlComponent;
class QmlEngine;
class QmlCompiledComponent;
-#include "qml.h"
-
-
-QT_BEGIN_NAMESPACE
class QmlComponentPrivate : public QObjectPrivate
{
diff --git a/src/declarative/qml/qmlcompositetypemanager_p.h b/src/declarative/qml/qmlcompositetypemanager_p.h
index f03b2cb..9312819 100644
--- a/src/declarative/qml/qmlcompositetypemanager_p.h
+++ b/src/declarative/qml/qmlcompositetypemanager_p.h
@@ -42,10 +42,10 @@
#ifndef QMLCOMPOSITETYPEMANAGER_P_H
#define QMLCOMPOSITETYPEMANAGER_P_H
-#include <qglobal.h>
+#include <QtCore/qglobal.h>
#include <private/qmlscriptparser_p.h>
#include <private/qmlrefcount_p.h>
-#include <qmlerror.h>
+#include <QtDeclarative/qmlerror.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/qml/qmlcontext_p.h b/src/declarative/qml/qmlcontext_p.h
index 6f1e486..4d88fc2 100644
--- a/src/declarative/qml/qmlcontext_p.h
+++ b/src/declarative/qml/qmlcontext_p.h
@@ -42,11 +42,11 @@
#ifndef QMLCONTEXT_P_H
#define QMLCONTEXT_P_H
-#include <qmlcontext.h>
+#include <QtDeclarative/qmlcontext.h>
#include <private/qobject_p.h>
#include <private/qmldeclarativedata_p.h>
-#include <qhash.h>
-#include <qscriptvalue.h>
+#include <QtCore/qhash.h>
+#include <QtScript/qscriptvalue.h>
#include <QtCore/qset.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp
index 0209c1d..425cba4 100644
--- a/src/declarative/qml/qmlengine.cpp
+++ b/src/declarative/qml/qmlengine.cpp
@@ -615,6 +615,35 @@ QUrl QmlEngine::componentUrl(const QUrl& src, const QUrl& baseUrl) const
}
/*!
+ Returns the list of base urls the engine browses to find sub-components.
+
+ The search path consists of the base of the \a url, and, in the case of local files,
+ the directories imported using the "import" statement in \a qml.
+ */
+QList<QUrl> QmlEngine::componentSearchPath(const QByteArray &qml, const QUrl &url) const
+{
+ QList<QUrl> searchPath;
+
+ searchPath << url.resolved(QUrl(QLatin1String(".")));
+
+ if (QFileInfo(url.toLocalFile()).exists()) {
+ QmlScriptParser parser;
+ if (parser.parse(qml, url)) {
+ for (int i = 0; i < parser.imports().size(); ++i) {
+ QUrl importUrl = QUrl(parser.imports().at(i).uri);
+ if (importUrl.isRelative()) {
+ searchPath << url.resolved(importUrl);
+ } else {
+ searchPath << importUrl;
+ }
+ }
+ }
+ }
+
+ return searchPath;
+}
+
+/*!
Sets the common QNetworkAccessManager, \a network, used by all QML elements instantiated
by this engine.
diff --git a/src/declarative/qml/qmlengine.h b/src/declarative/qml/qmlengine.h
index fde84d4..9382389 100644
--- a/src/declarative/qml/qmlengine.h
+++ b/src/declarative/qml/qmlengine.h
@@ -78,6 +78,8 @@ public:
QMap<QString,QString> nameSpacePaths() const;
QUrl componentUrl(const QUrl& src, const QUrl& baseUrl) const;
+ QList<QUrl> componentSearchPath(const QByteArray &qml, const QUrl &url) const;
+
void setNetworkAccessManager(QNetworkAccessManager *);
QNetworkAccessManager *networkAccessManager() const;
diff --git a/src/declarative/qml/qmlengine_p.h b/src/declarative/qml/qmlengine_p.h
index 7cafb59..0dc4736 100644
--- a/src/declarative/qml/qmlengine_p.h
+++ b/src/declarative/qml/qmlengine_p.h
@@ -42,9 +42,9 @@
#ifndef QMLENGINE_P_H
#define QMLENGINE_P_H
-#include <QScriptClass>
-#include <QScriptValue>
-#include <QScriptString>
+#include <QtScript/QScriptClass>
+#include <QtScript/QScriptValue>
+#include <QtScript/QScriptString>
#include <QtCore/qstring.h>
#include <QtCore/qlist.h>
#include <QtCore/qpair.h>
@@ -52,11 +52,11 @@
#include <private/qobject_p.h>
#include <private/qmlclassfactory_p.h>
#include <private/qmlcompositetypemanager_p.h>
-#include <qml.h>
-#include <qmlbasicscript.h>
-#include <qmlcontext.h>
-#include <qmlengine.h>
-#include <qmlexpression.h>
+#include <QtDeclarative/qml.h>
+#include <QtDeclarative/qmlbasicscript.h>
+#include <QtDeclarative/qmlcontext.h>
+#include <QtDeclarative/qmlengine.h>
+#include <QtDeclarative/qmlexpression.h>
#include <QtScript/qscriptengine.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/qml/qmlinstruction_p.h b/src/declarative/qml/qmlinstruction_p.h
index 323735b..a21ccee 100644
--- a/src/declarative/qml/qmlinstruction_p.h
+++ b/src/declarative/qml/qmlinstruction_p.h
@@ -42,7 +42,7 @@
#ifndef QMLINSTRUCTION_P_H
#define QMLINSTRUCTION_P_H
-#include <qfxglobal.h>
+#include <QtDeclarative/qfxglobal.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/qml/qmlmetaproperty.h b/src/declarative/qml/qmlmetaproperty.h
index 4e59cf7..9daef59 100644
--- a/src/declarative/qml/qmlmetaproperty.h
+++ b/src/declarative/qml/qmlmetaproperty.h
@@ -43,7 +43,7 @@
#define QMLMETAPROPERTY_H
#include <QtDeclarative/qfxglobal.h>
-#include <QMetaProperty>
+#include <QtCore/QMetaProperty>
QT_BEGIN_HEADER
diff --git a/src/declarative/qml/qmlparser_p.h b/src/declarative/qml/qmlparser_p.h
index 95b21e6..add5773 100644
--- a/src/declarative/qml/qmlparser_p.h
+++ b/src/declarative/qml/qmlparser_p.h
@@ -42,10 +42,10 @@
#ifndef QMLPARSER_P_H
#define QMLPARSER_P_H
-#include <QByteArray>
-#include <QList>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
#include <QtCore/qstring.h>
-#include <qml.h>
+#include <QtDeclarative/qml.h>
#include <private/qmlrefcount_p.h>
#include <private/qobject_p.h>
diff --git a/src/declarative/qml/qmlpropertyvaluesource.h b/src/declarative/qml/qmlpropertyvaluesource.h
index 6ef2e38..736b25f 100644
--- a/src/declarative/qml/qmlpropertyvaluesource.h
+++ b/src/declarative/qml/qmlpropertyvaluesource.h
@@ -42,9 +42,9 @@
#ifndef QMLPROPERTYVALUESOURCE_H
#define QMLPROPERTYVALUESOURCE_H
-#include <qfxglobal.h>
-#include <qml.h>
-#include <QObject>
+#include <QtDeclarative/qfxglobal.h>
+#include <QtDeclarative/qml.h>
+#include <QtCore/QObject>
QT_BEGIN_HEADER
diff --git a/src/declarative/qml/qmlproxymetaobject_p.h b/src/declarative/qml/qmlproxymetaobject_p.h
index 594e7a3..0ffa365 100644
--- a/src/declarative/qml/qmlproxymetaobject_p.h
+++ b/src/declarative/qml/qmlproxymetaobject_p.h
@@ -42,11 +42,11 @@
#ifndef QMLPROXYMETAOBJECT_P_H
#define QMLPROXYMETAOBJECT_P_H
-#include <QMetaObject>
+#include <QtCore/QMetaObject>
+#include <QtCore/QObject>
#include <private/qmetaobjectbuilder_p.h>
#include <private/qobject_p.h>
-#include <QObject>
-#include <qml.h>
+#include <QtDeclarative/qml.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/qml/qmlrefcount_p.h b/src/declarative/qml/qmlrefcount_p.h
index 90b50a8..1355c86 100644
--- a/src/declarative/qml/qmlrefcount_p.h
+++ b/src/declarative/qml/qmlrefcount_p.h
@@ -42,7 +42,7 @@
#ifndef QMLREFCOUNT_P_H
#define QMLREFCOUNT_P_H
-#include <qglobal.h>
+#include <QtCore/qglobal.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/qml/qmlvme_p.h b/src/declarative/qml/qmlvme_p.h
index f7e13d6..4e5c6c1 100644
--- a/src/declarative/qml/qmlvme_p.h
+++ b/src/declarative/qml/qmlvme_p.h
@@ -42,12 +42,12 @@
#ifndef QMLVME_P_H
#define QMLVME_P_H
-#include <QString>
-#include <QStack>
-#include <qmlerror.h>
-class QObject;
+#include <QtCore/QString>
+#include <QtCore/QStack>
+#include <QtDeclarative/qmlerror.h>
QT_BEGIN_NAMESPACE
+class QObject;
class QmlInstruction;
class QmlCompiledComponent;
class QmlCompiledData;
diff --git a/src/declarative/qml/qmlvmemetaobject_p.h b/src/declarative/qml/qmlvmemetaobject_p.h
index d8ed242..6f1e31b 100644
--- a/src/declarative/qml/qmlvmemetaobject_p.h
+++ b/src/declarative/qml/qmlvmemetaobject_p.h
@@ -42,9 +42,9 @@
#ifndef QMLVMEMETAOBJECT_P_H
#define QMLVMEMETAOBJECT_P_H
-#include <qml.h>
-#include <QMetaObject>
-#include <QBitArray>
+#include <QtDeclarative/qml.h>
+#include <QtCore/QMetaObject>
+#include <QtCore/QBitArray>
#include <private/qobject_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/qml/script/lexer.h b/src/declarative/qml/script/lexer.h
index 7781ee8..9de4afd 100644
--- a/src/declarative/qml/script/lexer.h
+++ b/src/declarative/qml/script/lexer.h
@@ -11,7 +11,7 @@
#ifndef LEXER_H
#define LEXER_H
-#include <QList>
+#include <QtCore/QList>
#include "tokens.h"
diff --git a/src/declarative/qml/script/qmlbasicscript.h b/src/declarative/qml/script/qmlbasicscript.h
index d465f04..5ef2148 100644
--- a/src/declarative/qml/script/qmlbasicscript.h
+++ b/src/declarative/qml/script/qmlbasicscript.h
@@ -13,10 +13,10 @@
#define QMLBASICSCRIPT_H
#include "instructions.h"
-#include <QList>
-#include <QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QByteArray>
#include "lexer.h"
-#include <QVariant>
+#include <QtCore/QVariant>
QT_BEGIN_HEADER
diff --git a/src/declarative/test/qfxtestengine.h b/src/declarative/test/qfxtestengine.h
index 6698645..44a140f 100644
--- a/src/declarative/test/qfxtestengine.h
+++ b/src/declarative/test/qfxtestengine.h
@@ -42,8 +42,7 @@
#ifndef _QFXTESTENGINE_H_
#define _QFXTESTENGINE_H_
-#include <QObject>
-class QSimpleCanvas;
+#include <QtCore/QObject>
QT_BEGIN_HEADER
@@ -51,6 +50,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
+class QSimpleCanvas;
class QFxTestEnginePrivate;
class Q_DECLARATIVE_EXPORT QFxTestEngine : public QObject
{
diff --git a/src/declarative/test/qfxtestobjects.h b/src/declarative/test/qfxtestobjects.h
index 4273d4e..653656e 100644
--- a/src/declarative/test/qfxtestobjects.h
+++ b/src/declarative/test/qfxtestobjects.h
@@ -42,10 +42,10 @@
#ifndef _QFXTESTOBJECTS_H_
#define _QFXTESTOBJECTS_H_
-#include <QObject>
-#include <QPoint>
-#include <QList>
-#include <QXmlStreamWriter>
+#include <QtCore/QObject>
+#include <QtCore/QPoint>
+#include <QtCore/QList>
+#include <QtCore/QXmlStreamWriter>
QT_BEGIN_HEADER
diff --git a/src/declarative/test/qfxtestview.h b/src/declarative/test/qfxtestview.h
index 33275b9..a8f78bf 100644
--- a/src/declarative/test/qfxtestview.h
+++ b/src/declarative/test/qfxtestview.h
@@ -42,7 +42,7 @@
#ifndef _QFXTESTVIEW_H_
#define _QFXTESTVIEW_H_
-#include <QFxView>
+#include <QtDeclarative/QFxView>
QT_BEGIN_HEADER
diff --git a/src/declarative/timeline/qmltimeline.h b/src/declarative/timeline/qmltimeline.h
index ce9d1f2..23bdd64 100644
--- a/src/declarative/timeline/qmltimeline.h
+++ b/src/declarative/timeline/qmltimeline.h
@@ -42,9 +42,9 @@
#ifndef QMLTIMELINE_H
#define QMLTIMELINE_H
-#include <QObject>
-#include <qfxglobal.h>
-#include <QAbstractAnimation>
+#include <QtCore/QObject>
+#include <QtCore/QAbstractAnimation>
+#include <QtDeclarative/qfxglobal.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/timeline/qmltimelinevalueproxy.h b/src/declarative/timeline/qmltimelinevalueproxy.h
index 853db4e..9ecdba1 100644
--- a/src/declarative/timeline/qmltimelinevalueproxy.h
+++ b/src/declarative/timeline/qmltimelinevalueproxy.h
@@ -42,7 +42,7 @@
#ifndef QMLTIMELINEVALUEPROXY_H
#define QMLTIMELINEVALUEPROXY_H
-#include "qmltimeline.h"
+#include <QtDeclarative/qmltimeline.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/util/qbindablemap.h b/src/declarative/util/qbindablemap.h
index d617867..c76928d 100644
--- a/src/declarative/util/qbindablemap.h
+++ b/src/declarative/util/qbindablemap.h
@@ -42,11 +42,11 @@
#ifndef QBINDABLEMAP_H
#define QBINDABLEMAP_H
-#include <qfxglobal.h>
-#include <QObject>
-#include <QHash>
-#include <QStringList>
-#include <QVariant>
+#include <QtDeclarative/qfxglobal.h>
+#include <QtCore/QObject>
+#include <QtCore/QHash>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
QT_BEGIN_HEADER
diff --git a/src/declarative/util/qfxglobal.h b/src/declarative/util/qfxglobal.h
index 887351d..6ba9409 100644
--- a/src/declarative/util/qfxglobal.h
+++ b/src/declarative/util/qfxglobal.h
@@ -42,8 +42,8 @@
#ifndef QFXGLOBAL_H
#define QFXGLOBAL_H
-#include <qglobal.h>
-#include <QObject>
+#include <QtCore/qglobal.h>
+#include <QtCore/QObject>
QT_BEGIN_HEADER
diff --git a/src/declarative/util/qfxview.h b/src/declarative/util/qfxview.h
index 8dd9e2c..05bf005 100644
--- a/src/declarative/util/qfxview.h
+++ b/src/declarative/util/qfxview.h
@@ -42,11 +42,11 @@
#ifndef QFXVIEW_H
#define QFXVIEW_H
-#include <qfxglobal.h>
#include <QtCore/qdatetime.h>
#include <QtGui/qgraphicssceneevent.h>
#include <QtGui/qwidget.h>
-#include <qsimplecanvas.h>
+#include <QtDeclarative/qfxglobal.h>
+#include <QtDeclarative/qsimplecanvas.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/util/qmlanimation.h b/src/declarative/util/qmlanimation.h
index 578631c..8bd53e2 100644
--- a/src/declarative/util/qmlanimation.h
+++ b/src/declarative/util/qmlanimation.h
@@ -43,12 +43,12 @@
#define QMLANIMATION_H
#include <QtCore/qvariant.h>
+#include <QtCore/QAbstractAnimation>
#include <QtGui/qcolor.h>
-#include <qmltransition.h>
-#include <qmlpropertyvaluesource.h>
-#include <qmlstate.h>
-#include <qml.h>
-#include <QAbstractAnimation>
+#include <QtDeclarative/qmltransition.h>
+#include <QtDeclarative/qmlpropertyvaluesource.h>
+#include <QtDeclarative/qmlstate.h>
+#include <QtDeclarative/qml.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/util/qmlanimation_p.h b/src/declarative/util/qmlanimation_p.h
index 00937a6..36b826f 100644
--- a/src/declarative/util/qmlanimation_p.h
+++ b/src/declarative/util/qmlanimation_p.h
@@ -44,15 +44,15 @@
#include <private/qobject_p.h>
#include <private/qmlnullablevalue_p.h>
-#include <qmlanimation.h>
-#include <qml.h>
-#include <qmlcontext.h>
#include <private/qvariantanimation_p.h>
-#include <QPauseAnimation>
-#include <QVariantAnimation>
-#include <QAnimationGroup>
-#include <QColor>
-#include <qmltimelinevalueproxy.h>
+#include <QtCore/QPauseAnimation>
+#include <QtCore/QVariantAnimation>
+#include <QtCore/QAnimationGroup>
+#include <QtGui/QColor>
+#include <QtDeclarative/qmlanimation.h>
+#include <QtDeclarative/qml.h>
+#include <QtDeclarative/qmlcontext.h>
+#include <QtDeclarative/qmltimelinevalueproxy.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/util/qmlbehaviour.h b/src/declarative/util/qmlbehaviour.h
index 3d25cd8..7a54d63 100644
--- a/src/declarative/util/qmlbehaviour.h
+++ b/src/declarative/util/qmlbehaviour.h
@@ -42,9 +42,9 @@
#ifndef QMLBEHAVIOUR_H
#define QMLBEHAVIOUR_H
-#include <qmlpropertyvaluesource.h>
-#include <qml.h>
-#include <qmlstate.h>
+#include <QtDeclarative/qmlpropertyvaluesource.h>
+#include <QtDeclarative/qml.h>
+#include <QtDeclarative/qmlstate.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/util/qmlbind.h b/src/declarative/util/qmlbind.h
index 355edfd..5576957 100644
--- a/src/declarative/util/qmlbind.h
+++ b/src/declarative/util/qmlbind.h
@@ -42,9 +42,9 @@
#ifndef QMLBIND_H
#define QMLBIND_H
-#include <qfxglobal.h>
+#include <QtDeclarative/qfxglobal.h>
#include <QtCore/qobject.h>
-#include "qml.h"
+#include <QtDeclarative/qml.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/util/qmlfollow.h b/src/declarative/util/qmlfollow.h
index bd9363a..fa0bff8 100644
--- a/src/declarative/util/qmlfollow.h
+++ b/src/declarative/util/qmlfollow.h
@@ -42,8 +42,8 @@
#ifndef QMLFOLLOW_H
#define QMLFOLLOW_H
-#include <qmlpropertyvaluesource.h>
-#include <qml.h>
+#include <QtDeclarative/qmlpropertyvaluesource.h>
+#include <QtDeclarative/qml.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/util/qmlfont.h b/src/declarative/util/qmlfont.h
index b6bce7c..3a21c34 100644
--- a/src/declarative/util/qmlfont.h
+++ b/src/declarative/util/qmlfont.h
@@ -43,7 +43,7 @@
#define QMLFONT_H
#include <QtCore/qobject.h>
-#include <qml.h>
+#include <QtDeclarative/qml.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/util/qmllistaccessor.h b/src/declarative/util/qmllistaccessor.h
index 29f910d..dd766b2 100644
--- a/src/declarative/util/qmllistaccessor.h
+++ b/src/declarative/util/qmllistaccessor.h
@@ -42,7 +42,7 @@
#ifndef QMLLISTACCESSOR_H
#define QMLLISTACCESSOR_H
-#include <QVariant>
+#include <QtCore/QVariant>
QT_BEGIN_HEADER
diff --git a/src/declarative/util/qmllistmodel.h b/src/declarative/util/qmllistmodel.h
index 36aa009..ddf1e13 100644
--- a/src/declarative/util/qmllistmodel.h
+++ b/src/declarative/util/qmllistmodel.h
@@ -42,14 +42,14 @@
#ifndef QMLLISTMODEL_H
#define QMLLISTMODEL_H
-#include <QObject>
-#include <qfxglobal.h>
-#include <QStringList>
-#include <QHash>
-#include <QList>
-#include <QVariant>
-#include <qml.h>
-#include <qlistmodelinterface.h>
+#include <QtCore/QObject>
+#include <QtCore/QStringList>
+#include <QtCore/QHash>
+#include <QtCore/QList>
+#include <QtCore/QVariant>
+#include <QtDeclarative/qfxglobal.h>
+#include <QtDeclarative/qml.h>
+#include <QtDeclarative/qlistmodelinterface.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/util/qmlopenmetaobject.h b/src/declarative/util/qmlopenmetaobject.h
index f842f96..239276d 100644
--- a/src/declarative/util/qmlopenmetaobject.h
+++ b/src/declarative/util/qmlopenmetaobject.h
@@ -42,9 +42,9 @@
#ifndef QMLOPENMETAOBJECT_H
#define QMLOPENMETAOBJECT_H
-#include <QMetaObject>
+#include <QtCore/QMetaObject>
#include <QtCore/private/qobject_p.h>
-#include <QObject>
+#include <QtCore/QObject>
QT_BEGIN_HEADER
diff --git a/src/declarative/util/qmlpackage.h b/src/declarative/util/qmlpackage.h
index 6652b98..3861890 100644
--- a/src/declarative/util/qmlpackage.h
+++ b/src/declarative/util/qmlpackage.h
@@ -42,7 +42,7 @@
#ifndef QMLPACKAGE_H
#define QMLPACKAGE_H
-#include <qml.h>
+#include <QtDeclarative/qml.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/util/qmlscript.h b/src/declarative/util/qmlscript.h
index 8047a88..b739fd7 100644
--- a/src/declarative/util/qmlscript.h
+++ b/src/declarative/util/qmlscript.h
@@ -42,9 +42,9 @@
#ifndef QMLSCRIPT_H
#define QMLSCRIPT_H
-#include <qfxglobal.h>
+#include <QtDeclarative/qfxglobal.h>
#include <QtCore/qobject.h>
-#include "qml.h"
+#include <QtDeclarative/qml.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/util/qmlsetproperties.h b/src/declarative/util/qmlsetproperties.h
index 6d313b7..24ad99a 100644
--- a/src/declarative/util/qmlsetproperties.h
+++ b/src/declarative/util/qmlsetproperties.h
@@ -42,7 +42,7 @@
#ifndef QMLSETPROPERTIES_H
#define QMLSETPROPERTIES_H
-#include <qmlstateoperations.h>
+#include <QtDeclarative/qmlstateoperations.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/util/qmlstate.h b/src/declarative/util/qmlstate.h
index dd9d6ab..aa8871f 100644
--- a/src/declarative/util/qmlstate.h
+++ b/src/declarative/util/qmlstate.h
@@ -43,9 +43,9 @@
#define QMLSTATE_H
#include <QtCore/qobject.h>
-#include <qfxglobal.h>
-#include <qml.h>
-#include <QSequentialAnimationGroup>
+#include <QtCore/QSequentialAnimationGroup>
+#include <QtDeclarative/qfxglobal.h>
+#include <QtDeclarative/qml.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/util/qmlstate_p.h b/src/declarative/util/qmlstate_p.h
index 28e1781..a2f18eb 100644
--- a/src/declarative/util/qmlstate_p.h
+++ b/src/declarative/util/qmlstate_p.h
@@ -42,9 +42,9 @@
#ifndef QMLSTATE_P_H
#define QMLSTATE_P_H
-#include <qmlstate.h>
-#include "private/qobject_p.h"
-#include "private/qmlanimation_p.h"
+#include <QtDeclarative/qmlstate.h>
+#include <private/qobject_p.h>
+#include <private/qmlanimation_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/util/qmlstategroup.h b/src/declarative/util/qmlstategroup.h
index 55b84eb..cca1015 100644
--- a/src/declarative/util/qmlstategroup.h
+++ b/src/declarative/util/qmlstategroup.h
@@ -42,7 +42,7 @@
#ifndef QMLSTATEGROUP_H
#define QMLSTATEGROUP_H
-#include <qmlstate.h>
+#include <QtDeclarative/qmlstate.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/util/qmlstateoperations.h b/src/declarative/util/qmlstateoperations.h
index 8ecdcd2..720c639 100644
--- a/src/declarative/util/qmlstateoperations.h
+++ b/src/declarative/util/qmlstateoperations.h
@@ -42,7 +42,7 @@
#ifndef QMLSTATEOPERATIONS_H
#define QMLSTATEOPERATIONS_H
-#include <qmlstate.h>
+#include <QtDeclarative/qmlstate.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/util/qmltransition.h b/src/declarative/util/qmltransition.h
index 0b7ea14..646746e 100644
--- a/src/declarative/util/qmltransition.h
+++ b/src/declarative/util/qmltransition.h
@@ -43,9 +43,9 @@
#define QMLTRANSITION_H
#include <QtCore/qobject.h>
-#include <qfxglobal.h>
-#include <qmlstate.h>
-#include <qml.h>
+#include <QtDeclarative/qfxglobal.h>
+#include <QtDeclarative/qmlstate.h>
+#include <QtDeclarative/qml.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/widgets/graphicslayouts.h b/src/declarative/widgets/graphicslayouts.h
index beb4b65..e9930f1 100644
--- a/src/declarative/widgets/graphicslayouts.h
+++ b/src/declarative/widgets/graphicslayouts.h
@@ -42,9 +42,9 @@
#ifndef GRAPHICSLAYOUTS_H
#define GRAPHICSLAYOUTS_H
-#include "graphicswidgets.h"
-#include <QGraphicsLinearLayout>
-#include <QGraphicsGridLayout>
+#include <QtDeclarative/graphicswidgets.h>
+#include <QtGui/QGraphicsLinearLayout>
+#include <QtGui/QGraphicsGridLayout>
QT_BEGIN_HEADER
diff --git a/src/declarative/widgets/graphicswidgets.h b/src/declarative/widgets/graphicswidgets.h
index 47a753a..cec15b6 100644
--- a/src/declarative/widgets/graphicswidgets.h
+++ b/src/declarative/widgets/graphicswidgets.h
@@ -42,11 +42,11 @@
#ifndef GRAPHICSWIDGETS_H
#define GRAPHICSWIDGETS_H
-#include <qml.h>
-#include <QGraphicsScene>
-#include <QGraphicsView>
-#include <QGraphicsWidget>
-#include <QGraphicsItem>
+#include <QtDeclarative/qml.h>
+#include <QtGui/QGraphicsScene>
+#include <QtGui/QGraphicsView>
+#include <QtGui/QGraphicsWidget>
+#include <QtGui/QGraphicsItem>
QT_BEGIN_NAMESPACE
diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro
index b6e3584..14d8c24 100644
--- a/tests/auto/declarative/declarative.pro
+++ b/tests/auto/declarative/declarative.pro
@@ -14,7 +14,8 @@ SUBDIRS += datetimeformatter \
qmlmetaproperty \
qmllist \
qmllistaccessor \
- visual
+ visual\
+ qmlengine
# Tests which should run in Pulse
PULSE_TESTS = $$SUBDIRS
diff --git a/tests/auto/declarative/qmlengine/qmlengine.pro b/tests/auto/declarative/qmlengine/qmlengine.pro
new file mode 100644
index 0000000..4ac81e9
--- /dev/null
+++ b/tests/auto/declarative/qmlengine/qmlengine.pro
@@ -0,0 +1,5 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+SOURCES += tst_qmlengine.cpp
+
+DEFINES += SRCDIR=\\\"$$PWD\\\"
diff --git a/tests/auto/declarative/qmlengine/tst_qmlengine.cpp b/tests/auto/declarative/qmlengine/tst_qmlengine.cpp
new file mode 100644
index 0000000..9a04c61
--- /dev/null
+++ b/tests/auto/declarative/qmlengine/tst_qmlengine.cpp
@@ -0,0 +1,43 @@
+#include <qtest.h>
+#include <QtDeclarative/QmlEngine>
+
+#include <QtCore/QDebug>
+#include <QtCore/QFile>
+#include <QtCore/QUrl>
+
+class tst_qmlengine : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qmlengine() {}
+
+private slots:
+ void componentSearchPath();
+};
+
+
+void tst_qmlengine::componentSearchPath()
+{
+ QFile file(SRCDIR "/imports.qml");
+ QVERIFY(file.open(QIODevice::ReadOnly));
+
+ QmlEngine engine;
+
+ QList<QUrl> searchPath = engine.componentSearchPath(file.readAll(),
+ QUrl::fromLocalFile(file.fileName()));
+
+ QList<QUrl> expected;
+ expected << QUrl::fromLocalFile(SRCDIR);
+ expected << QUrl::fromLocalFile(file.fileName()).resolved(QUrl("import1"));
+ expected << QUrl::fromLocalFile(file.fileName()).resolved(QUrl("import2"));
+
+ QCOMPARE(searchPath.size(), expected.size());
+ for (int i = 0; i < expected.size(); ++i) {
+ QCOMPARE(searchPath.at(i).toString(QUrl::StripTrailingSlash),
+ expected.at(i).toString(QUrl::StripTrailingSlash));
+ }
+}
+
+QTEST_MAIN(tst_qmlengine)
+
+#include "tst_qmlengine.moc"