summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-12-08 13:39:21 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-12-08 13:39:21 (GMT)
commitf9357b1a6494fea60b822f2b154bbf4f2ab20270 (patch)
tree5851cd20614d9c5845311387e996a04600a00946
parent05c6b333b8afbb44c3120142a17537aba27f88e3 (diff)
parentfd4813062ce0851ddad4fe19358e4086e42efaa5 (diff)
downloadQt-f9357b1a6494fea60b822f2b154bbf4f2ab20270.zip
Qt-f9357b1a6494fea60b822f2b154bbf4f2ab20270.tar.gz
Qt-f9357b1a6494fea60b822f2b154bbf4f2ab20270.tar.bz2
Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r--doc/doc.pri5
-rw-r--r--doc/src/declarative/declarativeui.qdoc1
-rw-r--r--doc/src/declarative/pics/qmldebugger-creator.pngbin0 -> 170972 bytes
-rw-r--r--doc/src/declarative/qmldebugging.qdoc120
-rw-r--r--doc/src/declarative/qmli18n.qdoc66
-rw-r--r--doc/src/declarative/qmlreference.qdoc1
-rw-r--r--examples/widgets/stylesheet/mainwindow.ui2
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsgridview.cpp179
-rw-r--r--src/declarative/graphicsitems/qmlgraphicslistview.cpp2
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsloader.cpp2
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsrepeater.cpp2
-rw-r--r--src/declarative/graphicsitems/qmlgraphicswebview.cpp36
-rw-r--r--src/declarative/graphicsitems/qmlgraphicswebview_p.h5
-rw-r--r--src/declarative/qml/qmlcompileddata.cpp3
-rw-r--r--src/declarative/qml/qmlengine.cpp13
-rw-r--r--src/declarative/qml/qmlmetaproperty.cpp2
-rw-r--r--src/declarative/qml/qmlpropertycache.cpp1
-rw-r--r--src/declarative/qml/qmlsqldatabase.cpp1
-rw-r--r--src/declarative/qml/qmlworkerscript.cpp1
-rw-r--r--src/declarative/util/qmlanimation.cpp8
-rw-r--r--src/declarative/util/qmlanimation_p_p.h2
-rw-r--r--src/declarative/util/qmllistmodel.cpp2
-rw-r--r--src/declarative/util/qnumberformat.cpp4
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp2
-rw-r--r--src/gui/text/qtextdocument_p.cpp12
-rw-r--r--tests/auto/declarative/qmlecmascript/data/exceptionProducesWarning.qml8
-rw-r--r--tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp11
-rw-r--r--tests/auto/qtextcursor/tst_qtextcursor.cpp28
-rw-r--r--tools/qdoc3/documentation.pri5
-rw-r--r--tools/qdoc3/qdoc3.pro2
-rw-r--r--tools/qmldebugger/creatorplugin/QmlInspector.pluginspec12
-rw-r--r--tools/qmldebugger/creatorplugin/README6
-rw-r--r--tools/qmlviewer/qmlfolderlistmodel.cpp2
-rw-r--r--tools/qmlviewer/qmlviewer.cpp8
-rw-r--r--tools/tools.pro2
35 files changed, 461 insertions, 95 deletions
diff --git a/doc/doc.pri b/doc/doc.pri
index a5e4a82..9d7d5da 100644
--- a/doc/doc.pri
+++ b/doc/doc.pri
@@ -35,12 +35,9 @@ win32-g++:isEmpty(QMAKE_SH) {
QT_DOCUMENTATION = $$replace(QT_DOCUMENTATION, "/", "\\\\")
}
-
-!wince*:!cross_compile:SUBDIRS += tools/qdoc3
-
# Build rules:
adp_docs.commands = ($$QDOC $$ADP_DOCS_QDOCCONF_FILE)
-adp_docs.depends += sub-tools-qdoc3
+adp_docs.depends += sub-tools # qdoc3
qch_docs.commands = $$QT_DOCUMENTATION
qch_docs.depends += sub-tools
diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc
index b383836..637e5f1 100644
--- a/doc/src/declarative/declarativeui.qdoc
+++ b/doc/src/declarative/declarativeui.qdoc
@@ -100,6 +100,7 @@ completely new applications. QML is fully \l {Extending QML}{extensible from C+
\o \l {QML Elements}
\o \l {QML Global Object}
\o \l {Extending QML}
+\o \l {QML Internationalization}
\o \l {QtDeclarative Module}
\endlist
*/
diff --git a/doc/src/declarative/pics/qmldebugger-creator.png b/doc/src/declarative/pics/qmldebugger-creator.png
new file mode 100644
index 0000000..da1e22d
--- /dev/null
+++ b/doc/src/declarative/pics/qmldebugger-creator.png
Binary files differ
diff --git a/doc/src/declarative/qmldebugging.qdoc b/doc/src/declarative/qmldebugging.qdoc
new file mode 100644
index 0000000..13ad5f7
--- /dev/null
+++ b/doc/src/declarative/qmldebugging.qdoc
@@ -0,0 +1,120 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qmldebugging.html
+\title Debugging QML
+
+\section1 Logging
+
+console.log can be used to print debugging information to the console. For example:
+
+\qml
+Rectangle {
+ width: 200; height: 200
+ MouseRegion {
+ anchors.fill: parent
+ onClicked: console.log("clicked")
+ }
+}
+\endqml
+
+\section1 The QML Inspector
+
+The \c qmldebugger tool provides an experimental inspector to aid with debugging.
+It can be run as a Qt Creator plugin or as a standalone application.
+
+\section2 Qt Creator plugin
+
+The Qt Creator plugin currently builds against Qt Creator 1.3.
+
+To build the Qt Creator plugin:
+
+\list
+\o Set an environment variable \c CREATOR_SRC_DIR that points to the Qt Creator
+ source directory
+\o Set an environment variable \c CREATOR_BUILD_DIR that points to the Qt Creator
+ build directory
+\o Run \c qmake on \c $QTDIR/tools/qmldebugger/qmldebugger.pro
+\endlist
+
+This builds the plugin into your Qt Creator installation.
+
+The plugin adds a "QML Inspect" mode into Qt Creator that provides:
+
+\list
+\o An object tree showing all objects and their children
+\o The current property values for the object selected in the object tree
+ (this table is dynamically updated for all properties that have property changed
+ notifications)
+\o An expression evaluator for querying and setting values dynamically
+\o A table of watched properties (double-click on a property in the property
+ table to add it to the watch table)
+\o A graph that shows the frame rate of your application
+\endlist
+
+
+To start the debugger, open a QML project and click the "QML Inspect" mode, then click the green
+"play" button in the toolbar of the bottom-right debugger window.
+
+\image qmldebugger-creator.png
+
+
+\section2 Standalone qmldebugger tool
+
+To run the standalone \c qmldebugger tool, set an environment variable \c QML_DEBUG_SERVER_PORT
+to an available port number and run the \c qmlviewer. For example:
+
+\code
+ QML_DEBUG_SERVER_PORT=3768 qmlviewer myqmlfile.qml
+\endcode
+
+Then in another process, start the \c qmldebugger tool, enter the port number into the corresponding spinbox
+in the top right hand corner, and press the "Connect" button.
+
+
+\section1 Debugging Transitions
+
+When a transition doesn't look quite right, it can be helpful to view it in slow
+motion to see more clearly what is happening. \l {qmlviewer} provides a menu option
+"Slow Down Animations" to facilitate this.
+
+*/
diff --git a/doc/src/declarative/qmli18n.qdoc b/doc/src/declarative/qmli18n.qdoc
new file mode 100644
index 0000000..4b62fcb
--- /dev/null
+++ b/doc/src/declarative/qmli18n.qdoc
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qmli18n.html
+\title QML Internationalization
+
+Strings in QML can be marked for translation using the qsTr(), qsTranslate(),
+QT_TR_NOOP(), and QT_TRANSLATE_NOOP() functions.
+
+For example:
+\qml
+Text { text: qsTr("Pictures") }
+\endqml
+
+These functions are standard QtScript functions; for more details see
+QScriptEngine::installTranslatorFunctions().
+
+QML relies on the core internationalization capabilities provided by Qt. These
+capabilities are described more fully in:
+\list
+\o \l {Internationalization with Qt}
+\o \l {Qt Linguist Manual}
+\endlist
+
+You can test a translation in \l {qmlviewer} using the -translation option.
+
+*/
diff --git a/doc/src/declarative/qmlreference.qdoc b/doc/src/declarative/qmlreference.qdoc
index 2c79aeb..614bc18 100644
--- a/doc/src/declarative/qmlreference.qdoc
+++ b/doc/src/declarative/qmlreference.qdoc
@@ -90,5 +90,6 @@
\list
\o \l {elements}{QML Elements}
\o \l {QML Global Object}
+ \o \l {QML Internationalization}
\endlist
*/
diff --git a/examples/widgets/stylesheet/mainwindow.ui b/examples/widgets/stylesheet/mainwindow.ui
index 740d37b..2b232df 100644
--- a/examples/widgets/stylesheet/mainwindow.ui
+++ b/examples/widgets/stylesheet/mainwindow.ui
@@ -41,7 +41,7 @@
<string>Please read the LICENSE file before checking</string>
</property>
<property name="text" >
- <string>I &amp;accept the terms and &amp;conditions</string>
+ <string>I accept the terms and &amp;conditions</string>
</property>
</widget>
</item>
diff --git a/src/declarative/graphicsitems/qmlgraphicsgridview.cpp b/src/declarative/graphicsitems/qmlgraphicsgridview.cpp
index 7279ea6..fb40b35 100644
--- a/src/declarative/graphicsitems/qmlgraphicsgridview.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsgridview.cpp
@@ -157,7 +157,7 @@ public:
, highlightComponent(0), highlight(0), trackedItem(0)
, moveReason(Other), buffer(0), highlightXAnimator(0), highlightYAnimator(0)
, ownModel(false), wrap(false), autoHighlight(true)
- , fixCurrentVisibility(false) {}
+ , fixCurrentVisibility(false), lazyRelease(false) {}
void init();
void clear();
@@ -264,6 +264,16 @@ public:
return 0;
}
+ FxGridItem *firstVisibleItem() const {
+ const qreal pos = position();
+ for (int i = 0; i < visibleItems.count(); ++i) {
+ FxGridItem *item = visibleItems.at(i);
+ if (item->index != -1 && item->endRowPos() > pos)
+ return item;
+ }
+ return visibleItems.count() ? visibleItems.first() : 0;
+ }
+
// Map a model index to visibleItems list index.
// These may differ if removed items are still present in the visible list,
// e.g. doing a removal animation
@@ -321,6 +331,7 @@ public:
bool wrap : 1;
bool autoHighlight : 1;
bool fixCurrentVisibility : 1;
+ bool lazyRelease : 1;
};
void QmlGraphicsGridViewPrivate::init()
@@ -406,17 +417,24 @@ void QmlGraphicsGridViewPrivate::refill(qreal from, qreal to)
--i;
modelIndex = visibleItems.at(i)->index + 1;
}
+ int colNum = colPos / colSize();
FxGridItem *item = 0;
- while (modelIndex < model->count() && rowPos <= to) {
+
+ // Item creation and release is staggered in order to avoid
+ // creating/releasing multiple items in one frame
+ // while flicking (as much as possible).
+ while (modelIndex < model->count() && rowPos <= to + rowSize()*(columns - colNum)/(columns+1)) {
//qDebug() << "refill: append item" << modelIndex;
if (!(item = createItem(modelIndex)))
break;
item->setPosition(colPos, rowPos);
visibleItems.append(item);
colPos += colSize();
+ colNum++;
if (colPos > colSize() * (columns-1)) {
colPos = 0;
+ colNum = 0;
rowPos += rowSize();
}
++modelIndex;
@@ -431,7 +449,8 @@ void QmlGraphicsGridViewPrivate::refill(qreal from, qreal to)
rowPos -= rowSize();
}
}
- while (visibleIndex > 0 && rowPos + rowSize() - 1 >= from){
+ colNum = colPos / colSize();
+ while (visibleIndex > 0 && rowPos + rowSize() - 1 >= from - rowSize()*(colNum+1)/(columns+1)){
//qDebug() << "refill: prepend item" << visibleIndex-1 << "top pos" << rowPos << colPos;
if (!(item = createItem(visibleIndex-1)))
break;
@@ -439,30 +458,38 @@ void QmlGraphicsGridViewPrivate::refill(qreal from, qreal to)
item->setPosition(colPos, rowPos);
visibleItems.prepend(item);
colPos -= colSize();
+ colNum--;
if (colPos < 0) {
colPos = colSize() * (columns - 1);
+ colNum = columns-1;
rowPos -= rowSize();
}
changed = true;
}
- while (visibleItems.count() > 1 && (item = visibleItems.first()) && item->endRowPos() < from) {
- if (item->attached->delayRemove())
- break;
- //qDebug() << "refill: remove first" << visibleIndex << "top end pos" << item->endRowPos();
- if (item->index != -1)
- visibleIndex++;
- visibleItems.removeFirst();
- releaseItem(item);
- changed = true;
- }
- while (visibleItems.count() > 1 && (item = visibleItems.last()) && item->rowPos() > to) {
- if (item->attached->delayRemove())
- break;
- //qDebug() << "refill: remove last" << visibleIndex+visibleItems.count()-1;
- visibleItems.removeLast();
- releaseItem(item);
- changed = true;
+ if (!lazyRelease || !changed) { // avoid destroying items in the same frame that we create
+ while (visibleItems.count() > 1
+ && (item = visibleItems.first())
+ && item->endRowPos() < from - rowSize()*(item->colPos()/colSize()+1)/(columns+1)) {
+ if (item->attached->delayRemove())
+ break;
+ //qDebug() << "refill: remove first" << visibleIndex << "top end pos" << item->endRowPos();
+ if (item->index != -1)
+ visibleIndex++;
+ visibleItems.removeFirst();
+ releaseItem(item);
+ changed = true;
+ }
+ while (visibleItems.count() > 1
+ && (item = visibleItems.last())
+ && item->rowPos() > to + rowSize()*(columns - item->colPos()/colSize())/(columns+1)) {
+ if (item->attached->delayRemove())
+ break;
+ //qDebug() << "refill: remove last" << visibleIndex+visibleItems.count()-1;
+ visibleItems.removeLast();
+ releaseItem(item);
+ changed = true;
+ }
}
if (changed) {
if (flow == QmlGraphicsGridView::LeftToRight)
@@ -470,6 +497,7 @@ void QmlGraphicsGridViewPrivate::refill(qreal from, qreal to)
else
q->setViewportWidth(endPosition() - startPosition());
}
+ lazyRelease = false;
}
void QmlGraphicsGridViewPrivate::updateGrid()
@@ -1127,7 +1155,9 @@ void QmlGraphicsGridView::sizeChange()
void QmlGraphicsGridView::viewportMoved()
{
+ Q_D(QmlGraphicsGridView);
QmlGraphicsFlickable::viewportMoved();
+ d->lazyRelease = true;
refill();
}
@@ -1177,7 +1207,6 @@ void QmlGraphicsGridView::keyPressEvent(QKeyEvent *event)
QmlGraphicsFlickable::keyPressEvent(event);
if (event->isAccepted())
return;
-
if (d->model && d->model->count() && d->interactive) {
d->moveReason = QmlGraphicsGridViewPrivate::SetIndex;
int oldCurrent = currentIndex();
@@ -1430,21 +1459,71 @@ void QmlGraphicsGridView::itemsInserted(int modelIndex, int count)
}
QList<FxGridItem*> added;
- int i = 0;
- for (; i < insertCount && rowPos + d->rowSize() - 1 <= to; ++i) {
- int mod = (modelIndex+i) % d->columns;
- while (mod++ < d->columns && modelIndex + i < d->model->count() && i < insertCount) {
- FxGridItem *item = d->createItem(modelIndex + i);
- d->visibleItems.insert(index, item);
- item->setPosition(colPos, rowPos);
- added.append(item);
- colPos += d->colSize();
- if (colPos > d->colSize() * (d->columns-1)) {
- colPos = 0;
- rowPos += d->rowSize();
+ FxGridItem *firstItem = d->firstVisibleItem();
+ if (firstItem && rowPos < firstItem->rowPos()) {
+ int from = d->position() - d->buffer;
+ int i = 0;
+ int insertionIdx = index;
+ for (i = insertCount-1; i >= 0 && rowPos > from; --i) {
+ int mod = (modelIndex+i) % d->columns;
+ while (mod++ < d->columns && modelIndex + i < d->model->count() && i < insertCount) {
+ FxGridItem *item = d->createItem(modelIndex + i);
+ d->visibleItems.insert(insertionIdx, item);
+ item->setPosition(colPos, rowPos);
+ added.append(item);
+ colPos -= d->colSize();
+ if (colPos < 0) {
+ colPos = d->colSize() * (d->columns-1);
+ rowPos -= d->rowSize();
+ }
+ ++index;
+ ++i;
+ }
+ }
+ if (i >= 0) {
+ // If we didn't insert all our new items - anything
+ // before the current index is not visible - remove it.
+ while (insertionIdx--) {
+ FxGridItem *item = d->visibleItems.takeFirst();
+ if (item->index != -1)
+ d->visibleIndex++;
+ d->releaseItem(item);
+ }
+ } else {
+ // adjust pos of items before inserted items.
+ for (int i = insertionIdx-1; i >= 0; i--) {
+ FxGridItem *gridItem = d->visibleItems.at(i);
+ gridItem->setPosition(colPos, rowPos);
+ colPos -= d->colSize();
+ if (colPos < 0) {
+ colPos = d->colSize() * (d->columns-1);
+ rowPos -= d->rowSize();
+ }
+ }
+ }
+ } else {
+ int i = 0;
+ for (i = 0; i < insertCount && rowPos + d->rowSize() - 1 <= to; ++i) {
+ int mod = (modelIndex+i) % d->columns;
+ while (mod++ < d->columns && modelIndex + i < d->model->count() && i < insertCount) {
+ FxGridItem *item = d->createItem(modelIndex + i);
+ d->visibleItems.insert(index, item);
+ item->setPosition(colPos, rowPos);
+ added.append(item);
+ colPos += d->colSize();
+ if (colPos > d->colSize() * (d->columns-1)) {
+ colPos = 0;
+ rowPos += d->rowSize();
+ }
+ ++index;
+ ++i;
}
- ++index;
- ++i;
+ }
+ if (i < insertCount) {
+ // We didn't insert all our new items, which means anything
+ // beyond the current index is not visible - remove it.
+ while (d->visibleItems.count() > index)
+ d->releaseItem(d->visibleItems.takeLast());
}
}
@@ -1456,19 +1535,13 @@ void QmlGraphicsGridView::itemsInserted(int modelIndex, int count)
d->currentItem->setPosition(d->colPosAt(d->currentIndex), d->rowPosAt(d->currentIndex));
}
}
- if (i < insertCount) {
- // We didn't insert all our new items, which means anything
- // beyond the current index is not visible - remove it.
- while (d->visibleItems.count() > index)
- d->releaseItem(d->visibleItems.takeLast());
- } else {
- // Update the indexes of the following visible items.
- for (; index < d->visibleItems.count(); ++index) {
- FxGridItem *listItem = d->visibleItems.at(index);
- if (listItem->index != -1)
- listItem->index += count;
- }
+ // Update the indexes of the following visible items.
+ for (; index < d->visibleItems.count(); ++index) {
+ FxGridItem *listItem = d->visibleItems.at(index);
+ if (listItem->index != -1)
+ listItem->index += count;
}
+
// everything is in order now - emit add() signal
for (int j = 0; j < added.count(); ++j)
added.at(j)->attached->emitAdd();
@@ -1587,6 +1660,12 @@ void QmlGraphicsGridView::itemsMoved(int from, int to, int count)
Q_D(QmlGraphicsGridView);
QHash<int,FxGridItem*> moved;
+ bool removedBeforeVisible = false;
+ FxGridItem *firstItem = d->firstVisibleItem();
+
+ if (from < to && from < d->visibleIndex && to > d->visibleIndex)
+ removedBeforeVisible = true;
+
QList<FxGridItem*>::Iterator it = d->visibleItems.begin();
while (it != d->visibleItems.end()) {
FxGridItem *item = *it;
@@ -1595,12 +1674,16 @@ void QmlGraphicsGridView::itemsMoved(int from, int to, int count)
item->index += (to-from);
moved.insert(item->index, item);
it = d->visibleItems.erase(it);
+ if (item->rowPos() < firstItem->rowPos())
+ removedBeforeVisible = true;
} else {
if (item->index > from && item->index != -1) {
// move everything after the moved items.
item->index -= count;
if (item->index < d->visibleIndex)
d->visibleIndex = item->index;
+ } else if (item->index != -1) {
+ removedBeforeVisible = true;
}
++it;
}
@@ -1642,7 +1725,7 @@ void QmlGraphicsGridView::itemsMoved(int from, int to, int count)
while (moved.count())
d->releaseItem(moved.take(moved.begin().key()));
- d->layout();
+ d->layout(removedBeforeVisible);
}
void QmlGraphicsGridView::createdItem(int index, QmlGraphicsItem *item)
diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp
index 7fb6454..135262c 100644
--- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp
@@ -1256,6 +1256,8 @@ QmlGraphicsListView::~QmlGraphicsListView()
d->clear();
if (d->ownModel)
delete d->model;
+ delete d->header;
+ delete d->footer;
}
/*!
diff --git a/src/declarative/graphicsitems/qmlgraphicsloader.cpp b/src/declarative/graphicsitems/qmlgraphicsloader.cpp
index 86239cf..bb1020c 100644
--- a/src/declarative/graphicsitems/qmlgraphicsloader.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsloader.cpp
@@ -263,6 +263,7 @@ void QmlGraphicsLoaderPrivate::_q_sourceLoaded()
QObject *obj = component->create(ctxt);
if (obj) {
+ ctxt->setParent(obj);
item = qobject_cast<QmlGraphicsItem *>(obj);
if (item) {
item->setParentItem(q);
@@ -271,6 +272,7 @@ void QmlGraphicsLoaderPrivate::_q_sourceLoaded()
}
} else {
delete obj;
+ delete ctxt;
source = QUrl();
}
emit q->sourceChanged();
diff --git a/src/declarative/graphicsitems/qmlgraphicsrepeater.cpp b/src/declarative/graphicsitems/qmlgraphicsrepeater.cpp
index a650999..99f0faa 100644
--- a/src/declarative/graphicsitems/qmlgraphicsrepeater.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsrepeater.cpp
@@ -56,6 +56,8 @@ QmlGraphicsRepeaterPrivate::QmlGraphicsRepeaterPrivate()
QmlGraphicsRepeaterPrivate::~QmlGraphicsRepeaterPrivate()
{
+ if (ownModel)
+ delete model;
}
QML_DEFINE_TYPE(Qt,4,6,Repeater,QmlGraphicsRepeater)
diff --git a/src/declarative/graphicsitems/qmlgraphicswebview.cpp b/src/declarative/graphicsitems/qmlgraphicswebview.cpp
index 1fdf557..85fd0d7 100644
--- a/src/declarative/graphicsitems/qmlgraphicswebview.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicswebview.cpp
@@ -103,8 +103,7 @@ public:
QBasicTimer pressTimer;
QPoint pressPoint;
- int pressTime; // milliseconds before it's a "hold" XXX not currently settable
- static const int pressDragLength = 15; // XXX #pixels before it's no longer a "hold"; device-specific
+ int pressTime; // milliseconds before it's a "hold"
void updateWindowObjects();
class WindowObjectList : public QmlConcreteList<QObject *>
@@ -612,6 +611,28 @@ bool QmlGraphicsWebView::heuristicZoom(int clickX, int clickY, qreal maxzoom)
}
}
+/*!
+ \qmlproperty int WebView::pressGrabTime
+
+ The number of milliseconds the user must press before the WebView
+ starts passing move events through to the web engine (rather than
+ letting other QML elements such as a Flickable take them).
+
+ Defaults to 400ms. Set to 0 to always grab and pass move events to
+ the web engine.
+*/
+int QmlGraphicsWebView::pressGrabTime() const
+{
+ Q_D(const QmlGraphicsWebView);
+ return d->pressTime;
+}
+
+void QmlGraphicsWebView::setPressGrabTime(int ms)
+{
+ Q_D(QmlGraphicsWebView);
+ d->pressTime = ms;
+}
+
void QmlGraphicsWebView::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QmlGraphicsWebView);
@@ -620,8 +641,13 @@ void QmlGraphicsWebView::mousePressEvent(QGraphicsSceneMouseEvent *event)
QMouseEvent *me = sceneMouseEventToMouseEvent(event);
d->pressPoint = me->pos();
- d->pressTimer.start(d->pressTime,this);
- setKeepMouseGrab(false);
+ if (d->pressTime) {
+ d->pressTimer.start(d->pressTime,this);
+ setKeepMouseGrab(false);
+ } else {
+ grabMouse();
+ setKeepMouseGrab(true);
+ }
page()->event(me);
event->setAccepted(
@@ -684,7 +710,7 @@ void QmlGraphicsWebView::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
QMouseEvent *me = sceneMouseEventToMouseEvent(event);
if (d->pressTimer.isActive()) {
- if ((me->pos() - d->pressPoint).manhattanLength() > d->pressDragLength) {
+ if ((me->pos() - d->pressPoint).manhattanLength() > QApplication::startDragDistance()) {
d->pressTimer.stop();
}
}
diff --git a/src/declarative/graphicsitems/qmlgraphicswebview_p.h b/src/declarative/graphicsitems/qmlgraphicswebview_p.h
index 0b2ba07..f5edb7a 100644
--- a/src/declarative/graphicsitems/qmlgraphicswebview_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicswebview_p.h
@@ -99,6 +99,8 @@ class Q_DECLARATIVE_EXPORT QmlGraphicsWebView : public QmlGraphicsPaintedItem
Q_PROPERTY(QString html READ html WRITE setHtml)
+ Q_PROPERTY(int pressGrabTime READ pressGrabTime WRITE setPressGrabTime)
+
Q_PROPERTY(int preferredWidth READ preferredWidth WRITE setPreferredWidth NOTIFY preferredWidthChanged)
Q_PROPERTY(int preferredHeight READ preferredHeight WRITE setPreferredHeight NOTIFY preferredHeightChanged)
Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged)
@@ -135,6 +137,9 @@ public:
Q_INVOKABLE bool heuristicZoom(int clickX, int clickY, qreal maxzoom);
QRect elementAreaAt(int x, int y, int minwidth, int minheight) const;
+ int pressGrabTime() const;
+ void setPressGrabTime(int);
+
int preferredWidth() const;
void setPreferredWidth(int);
int preferredHeight() const;
diff --git a/src/declarative/qml/qmlcompileddata.cpp b/src/declarative/qml/qmlcompileddata.cpp
index 8b165c6..198b574 100644
--- a/src/declarative/qml/qmlcompileddata.cpp
+++ b/src/declarative/qml/qmlcompileddata.cpp
@@ -176,6 +176,9 @@ QmlCompiledData::~QmlCompiledData()
for (int ii = 0; ii < propertyCaches.count(); ++ii)
propertyCaches.at(ii)->release();
+ for (int ii = 0; ii < contextCaches.count(); ++ii)
+ contextCaches.at(ii)->release();
+
if (importCache)
importCache->release();
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp
index bd6d540..63d5b70 100644
--- a/src/declarative/qml/qmlengine.cpp
+++ b/src/declarative/qml/qmlengine.cpp
@@ -147,11 +147,18 @@ QmlScriptEngine::QmlScriptEngine(QmlEnginePrivate *priv)
newQMetaObject(StaticQtMetaObject::get());
globalObject().setProperty(QLatin1String("Qt"), qtObject);
- offlineStoragePath = QDesktopServices::storageLocation(QDesktopServices::DataLocation).replace('/', QDir::separator())
+ offlineStoragePath = QDesktopServices::storageLocation(QDesktopServices::DataLocation).replace(QLatin1Char('/'), QDir::separator())
+ QDir::separator() + QLatin1String("QML")
+ QDir::separator() + QLatin1String("OfflineStorage");
+
+
qt_add_qmlxmlhttprequest(this);
qt_add_qmlsqldatabase(this);
+ // XXX A Multimedia "Qt.Sound" class also needs to be made available,
+ // XXX but we don't want a dependency in that cirection.
+ // XXX When the above a done some better way, that way should also be
+ // XXX used to add Qt.Sound class.
+
//types
qtObject.setProperty(QLatin1String("rgba"), newFunction(QmlEnginePrivate::rgba, 4));
@@ -233,6 +240,8 @@ QmlEnginePrivate::~QmlEnginePrivate()
typeNameClass = 0;
delete listClass;
listClass = 0;
+ delete globalClass;
+ globalClass = 0;
for(int ii = 0; ii < bindValues.count(); ++ii)
clear(bindValues[ii]);
@@ -309,7 +318,7 @@ QmlWorkerScriptEngine *QmlEnginePrivate::getWorkerScriptEngine()
\code
QmlEngine engine;
- QmlComponent component(&engine, "Text { text: \"Hello world!\" }");
+ QmlComponent component(&engine, "import Qt 4.6\nText { text: \"Hello world!\" }", QUrl());
QmlGraphicsItem *item = qobject_cast<QmlGraphicsItem *>(component.create());
//add item to view, etc
diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp
index a1ea90d..9c7aff8 100644
--- a/src/declarative/qml/qmlmetaproperty.cpp
+++ b/src/declarative/qml/qmlmetaproperty.cpp
@@ -806,7 +806,7 @@ bool QmlMetaPropertyPrivate::write(QObject *object, const QmlPropertyCache::Data
if (value.userType() == QVariant::Double) {
double integral;
double fractional = modf(value.toDouble(), &integral);
- if (qFuzzyCompare(fractional, (double)0.0))
+ if (qFuzzyIsNull(fractional))
v.convert(QVariant::Int);
}
return writeEnumProperty(prop, coreIdx, object, v, flags);
diff --git a/src/declarative/qml/qmlpropertycache.cpp b/src/declarative/qml/qmlpropertycache.cpp
index 7e3a1c4..bad8ad8 100644
--- a/src/declarative/qml/qmlpropertycache.cpp
+++ b/src/declarative/qml/qmlpropertycache.cpp
@@ -198,7 +198,6 @@ QmlPropertyCache *QmlPropertyCache::create(QmlEngine *engine, const QMetaObject
cache->stringCache.insert(methodName, data);
cache->identifierCache.insert(data->identifier.identifier, data);
data->addref();
- data->addref();
}
return cache;
diff --git a/src/declarative/qml/qmlsqldatabase.cpp b/src/declarative/qml/qmlsqldatabase.cpp
index 6ddd5e5..c3c3ca3 100644
--- a/src/declarative/qml/qmlsqldatabase.cpp
+++ b/src/declarative/qml/qmlsqldatabase.cpp
@@ -409,7 +409,6 @@ void qt_add_qmlsqldatabase(QScriptEngine *engine)
{
QScriptValue openDatabase = engine->newFunction(qmlsqldatabase_open_sync, 4);
engine->globalObject().setProperty(QLatin1String("openDatabaseSync"), openDatabase);
-qDebug() << "qt_add_qmlsqldatabase" << engine;
QScriptValue sqlExceptionPrototype = engine->newObject();
for (int i=0; sqlerror[i]; ++i)
diff --git a/src/declarative/qml/qmlworkerscript.cpp b/src/declarative/qml/qmlworkerscript.cpp
index 5c281bb..a0d6ef0 100644
--- a/src/declarative/qml/qmlworkerscript.cpp
+++ b/src/declarative/qml/qmlworkerscript.cpp
@@ -389,6 +389,7 @@ QmlWorkerScriptEngine::QmlWorkerScriptEngine(QObject *parent)
QmlWorkerScriptEngine::~QmlWorkerScriptEngine()
{
+ qDeleteAll(d->workers);
delete d; d = 0;
}
diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp
index 8afe667..a4f67ac 100644
--- a/src/declarative/util/qmlanimation.cpp
+++ b/src/declarative/util/qmlanimation.cpp
@@ -2064,8 +2064,8 @@ void QmlPropertyAnimation::prepare(QmlMetaProperty &p)
d->property = d->userProperty;
if (!d->rangeIsSet) {
- d->va->setStartValue(QVariant(0.0f));
- d->va->setEndValue(QVariant(1.0f));
+ d->va->setStartValue(qreal(0));
+ d->va->setEndValue(qreal(1));
d->rangeIsSet = true;
}
@@ -2227,8 +2227,8 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions,
if (data->actions.count()) {
if (!d->rangeIsSet) {
- d->va->setStartValue(QVariant(0.0f));
- d->va->setEndValue(QVariant(1.0f));
+ d->va->setStartValue(qreal(0));
+ d->va->setEndValue(qreal(1));
d->rangeIsSet = true;
}
d->va->setAnimValue(data, QAbstractAnimation::DeleteWhenStopped);
diff --git a/src/declarative/util/qmlanimation_p_p.h b/src/declarative/util/qmlanimation_p_p.h
index fbd7114..2f911b4 100644
--- a/src/declarative/util/qmlanimation_p_p.h
+++ b/src/declarative/util/qmlanimation_p_p.h
@@ -102,6 +102,7 @@ public:
QActionAnimation(QObject *parent = 0) : QAbstractAnimation(parent), animAction(0), policy(KeepWhenStopped), running(false) {}
QActionAnimation(QAbstractAnimationAction *action, QObject *parent = 0)
: QAbstractAnimation(parent), animAction(action), policy(KeepWhenStopped), running(false) {}
+ ~QActionAnimation() { if (policy == DeleteWhenStopped) { delete animAction; animAction = 0; } }
virtual int duration() const { return 0; }
void setAnimAction(QAbstractAnimationAction *action, DeletionPolicy p)
{
@@ -145,6 +146,7 @@ class QmlTimeLineValueAnimator : public QVariantAnimation
Q_OBJECT
public:
QmlTimeLineValueAnimator(QObject *parent = 0) : QVariantAnimation(parent), animValue(0), fromSourced(0), policy(KeepWhenStopped) {}
+ ~QmlTimeLineValueAnimator() { if (policy == DeleteWhenStopped) { delete animValue; animValue = 0; } }
void setAnimValue(QmlTimeLineValue *value, DeletionPolicy p)
{
if (state() == Running)
diff --git a/src/declarative/util/qmllistmodel.cpp b/src/declarative/util/qmllistmodel.cpp
index 995a7a4..f4317af 100644
--- a/src/declarative/util/qmllistmodel.cpp
+++ b/src/declarative/util/qmllistmodel.cpp
@@ -199,6 +199,8 @@ static void dump(ModelNode *node, int ind);
When creating content dynamically, note that the set of available properties cannot be changed
except by first clearing the model - whatever properties are first added are then the
only permitted properties in the model.
+
+ \sa {qmlmodels}{Data Models}
*/
class ModelObject : public QObject
diff --git a/src/declarative/util/qnumberformat.cpp b/src/declarative/util/qnumberformat.cpp
index c6a03e9..fd44db1 100644
--- a/src/declarative/util/qnumberformat.cpp
+++ b/src/declarative/util/qnumberformat.cpp
@@ -75,7 +75,7 @@ void QNumberFormat::handleFormat()
{
// ### is extremely messy
if (_format.isEmpty()) {
- _text = QString(QLatin1String("%1")).arg(_number, -1, 'f', -1);
+ _text = QString::number(_number, 'f', -1);
return;
}
@@ -115,7 +115,7 @@ void QNumberFormat::handleFormat()
}
// round given the decimal length/precision
- inputString = QString(QLatin1String("%1")).arg(_number, -1, 'f', decimalLength);
+ inputString = QString::number(_number, 'f', decimalLength);
QStringList parts = inputString.split(QLatin1Char('.'));
QStringList formatParts = _format.split(QLatin1Char('.'));
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index bc47872..dd76f1c 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -2181,7 +2181,7 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo
}
// Enable subfocus
- if (newVisible) {
+ if (scene && newVisible) {
QGraphicsItem *p = parent;
bool done = false;
while (p) {
diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp
index 18e1ffc..b015198 100644
--- a/src/gui/text/qtextdocument_p.cpp
+++ b/src/gui/text/qtextdocument_p.cpp
@@ -870,6 +870,7 @@ int QTextDocumentPrivate::undoRedo(bool undo)
undoEnabled = false;
beginEditBlock();
+ int editPos = -1;
while (1) {
if (undo)
--undoState;
@@ -881,11 +882,13 @@ int QTextDocumentPrivate::undoRedo(bool undo)
remove(c.pos, c.length, (QTextUndoCommand::Operation)c.operation);
PMDEBUG(" erase: from %d, length %d", c.pos, c.length);
c.command = QTextUndoCommand::Removed;
+ editPos = c.pos;
break;
case QTextUndoCommand::Removed:
PMDEBUG(" insert: format %d (from %d, length %d, strpos=%d)", c.format, c.pos, c.length, c.strPos);
insert_string(c.pos, c.strPos, c.length, c.format, (QTextUndoCommand::Operation)c.operation);
c.command = QTextUndoCommand::Inserted;
+ editPos = c.pos + c.length;
break;
case QTextUndoCommand::BlockInserted:
case QTextUndoCommand::BlockAdded:
@@ -895,6 +898,7 @@ int QTextDocumentPrivate::undoRedo(bool undo)
c.command = QTextUndoCommand::BlockRemoved;
else
c.command = QTextUndoCommand::BlockDeleted;
+ editPos = c.pos;
break;
case QTextUndoCommand::BlockRemoved:
case QTextUndoCommand::BlockDeleted:
@@ -905,6 +909,7 @@ int QTextDocumentPrivate::undoRedo(bool undo)
c.command = QTextUndoCommand::BlockInserted;
else
c.command = QTextUndoCommand::BlockAdded;
+ editPos = c.pos + 1;
break;
case QTextUndoCommand::CharFormatChanged: {
resetBlockRevision = -1; // ## TODO
@@ -915,6 +920,7 @@ int QTextDocumentPrivate::undoRedo(bool undo)
int oldFormat = it.value()->format;
setCharFormat(c.pos, c.length, formats.charFormat(c.format));
c.format = oldFormat;
+ editPos = c.pos + c.length;
break;
}
case QTextUndoCommand::BlockFormatChanged: {
@@ -937,6 +943,7 @@ int QTextDocumentPrivate::undoRedo(bool undo)
group->blockFormatChanged(it);
}
documentChange(it.position(), it.length());
+ editPos = -1;
break;
}
case QTextUndoCommand::GroupFormatChange: {
@@ -946,6 +953,7 @@ int QTextDocumentPrivate::undoRedo(bool undo)
int oldFormat = formats.objectFormatIndex(c.objectIndex);
changeObjectFormat(object, c.format);
c.format = oldFormat;
+ editPos = -1;
break;
}
case QTextUndoCommand::Custom:
@@ -954,6 +962,7 @@ int QTextDocumentPrivate::undoRedo(bool undo)
c.custom->undo();
else
c.custom->redo();
+ editPos = -1;
break;
default:
Q_ASSERT(false);
@@ -979,8 +988,7 @@ int QTextDocumentPrivate::undoRedo(bool undo)
break;
}
undoEnabled = true;
- int editPos = -1;
- if (docChangeFrom >= 0) {
+ if (editPos < 0 && docChangeFrom >= 0) {
editPos = qMin(docChangeFrom + docChangeLength, length() - 1);
}
endEditBlock();
diff --git a/tests/auto/declarative/qmlecmascript/data/exceptionProducesWarning.qml b/tests/auto/declarative/qmlecmascript/data/exceptionProducesWarning.qml
new file mode 100644
index 0000000..44722a9
--- /dev/null
+++ b/tests/auto/declarative/qmlecmascript/data/exceptionProducesWarning.qml
@@ -0,0 +1,8 @@
+import Qt 4.6
+import Qt.test 1.0
+
+MyQmlObject {
+ Component.onCompleted:
+ { throw(123,"JS exception") }
+}
+
diff --git a/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp b/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp
index 96a164b..b28d805 100644
--- a/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp
+++ b/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp
@@ -525,13 +525,13 @@ void tst_QmlGraphicsGridView::moved()
QTest::qWait(300);
// Confirm items positioned correctly and indexes correct
- itemCount = findItems<QmlGraphicsItem>(viewport, "wrapper").count();
- for (int i = 3; i < model.count() && i < itemCount; ++i) {
+ itemCount = findItems<QmlGraphicsItem>(viewport, "wrapper").count()-1;
+ for (int i = 6; i < model.count()-6 && i < itemCount+6; ++i) {
QmlGraphicsItem *item = findItem<QmlGraphicsItem>(viewport, "wrapper", i);
if (!item) qWarning() << "Item" << i << "not found";
QVERIFY(item);
QCOMPARE(item->x(), qreal((i%3)*80));
- QCOMPARE(item->y(), qreal((i/3)*60 + 60));
+ QCOMPARE(item->y(), qreal((i/3)*60));
name = findItem<QmlGraphicsText>(viewport, "textName", i);
QVERIFY(name != 0);
QCOMPARE(name->text(), model.name(i));
@@ -547,12 +547,12 @@ void tst_QmlGraphicsGridView::moved()
QTest::qWait(300);
// Confirm items positioned correctly and indexes correct
- for (int i = 3; i < model.count() && i < itemCount; ++i) {
+ for (int i = 6; i < model.count()-6 && i < itemCount+6; ++i) {
QmlGraphicsItem *item = findItem<QmlGraphicsItem>(viewport, "wrapper", i);
if (!item) qWarning() << "Item" << i << "not found";
QVERIFY(item);
QVERIFY(item->x() == (i%3)*80);
- QVERIFY(item->y() == (i/3)*60 + 60);
+ QVERIFY(item->y() == (i/3)*60);
name = findItem<QmlGraphicsText>(viewport, "textName", i);
QVERIFY(name != 0);
QCOMPARE(name->text(), model.name(i));
@@ -648,6 +648,7 @@ void tst_QmlGraphicsGridView::currentIndex()
// Test keys
canvas->show();
+ canvas->setFocus();
qApp->processEvents();
QEvent wa(QEvent::WindowActivate);
diff --git a/tests/auto/qtextcursor/tst_qtextcursor.cpp b/tests/auto/qtextcursor/tst_qtextcursor.cpp
index d910c8d..d0c2afd 100644
--- a/tests/auto/qtextcursor/tst_qtextcursor.cpp
+++ b/tests/auto/qtextcursor/tst_qtextcursor.cpp
@@ -149,6 +149,8 @@ private slots:
void adjustCursorsOnInsert();
+ void cursorPositionWithBlockUndoAndRedo();
+
private:
int blockCount();
@@ -1747,9 +1749,33 @@ void tst_QTextCursor::adjustCursorsOnInsert()
QCOMPARE(selection.anchor(), posAfter);
doc->undo();
+}
+void tst_QTextCursor::cursorPositionWithBlockUndoAndRedo()
+{
+ cursor.insertText("AAAABBBBCCCCDDDD");
+ cursor.beginEditBlock();
+ cursor.setPosition(12);
+ int cursorPositionBefore = cursor.position();
+ cursor.insertText("*");
+ cursor.setPosition(8);
+ cursor.insertText("*");
+ cursor.setPosition(4);
+ cursor.insertText("*");
+ cursor.setPosition(0);
+ cursor.insertText("*");
+ int cursorPositionAfter = cursor.position();
+ cursor.endEditBlock();
+ QVERIFY(doc->toPlainText() == "*AAAA*BBBB*CCCC*DDDD");
+ QCOMPARE(12, cursorPositionBefore);
+ QCOMPARE(1, cursorPositionAfter);
-
+ doc->undo(&cursor);
+ QVERIFY(doc->toPlainText() == "AAAABBBBCCCCDDDD");
+ QCOMPARE(cursor.position(), cursorPositionBefore);
+ doc->redo(&cursor);
+ QVERIFY(doc->toPlainText() == "*AAAA*BBBB*CCCC*DDDD");
+ QCOMPARE(cursor.position(), cursorPositionAfter);
}
QTEST_MAIN(tst_QTextCursor)
diff --git a/tools/qdoc3/documentation.pri b/tools/qdoc3/documentation.pri
deleted file mode 100644
index d952183..0000000
--- a/tools/qdoc3/documentation.pri
+++ /dev/null
@@ -1,5 +0,0 @@
-# NOTE: THIS FILE IS SHARED BY qdoc3.pro AND projects.pro
-#
-# So while changing this file, please make sure to that your changes
-# work in root qt soure dir with (n)make docs and for building with qdoc
-#
diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro
index bacef3f..441bf39 100644
--- a/tools/qdoc3/qdoc3.pro
+++ b/tools/qdoc3/qdoc3.pro
@@ -105,3 +105,5 @@ SOURCES += apigenerator.cpp \
webxmlgenerator.cpp \
yyindent.cpp
+target.path = $$[QT_INSTALL_BINS]
+INSTALLS += target
diff --git a/tools/qmldebugger/creatorplugin/QmlInspector.pluginspec b/tools/qmldebugger/creatorplugin/QmlInspector.pluginspec
index cdba135..1cf12cf 100644
--- a/tools/qmldebugger/creatorplugin/QmlInspector.pluginspec
+++ b/tools/qmldebugger/creatorplugin/QmlInspector.pluginspec
@@ -19,10 +19,10 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Qml support</description>
<url>http://qt.nokia.com</url>
<dependencyList>
- <dependency name="QmlProjectManager" version="1.3.80"/>
- <dependency name="ProjectExplorer" version="1.3.80"/>
- <dependency name="CppTools" version="1.3.80"/>
- <dependency name="CppEditor" version="1.3.80"/>
- <dependency name="Help" version="1.3.80"/>
+ <dependency name="QmlProjectManager" version="1.3.0"/>
+ <dependency name="ProjectExplorer" version="1.3.0"/>
+ <dependency name="CppTools" version="1.3.0"/>
+ <dependency name="CppEditor" version="1.3.0"/>
+ <dependency name="Help" version="1.3.0"/>
</dependencyList>
-</plugin> \ No newline at end of file
+</plugin>
diff --git a/tools/qmldebugger/creatorplugin/README b/tools/qmldebugger/creatorplugin/README
index e7e205e..5723dca 100644
--- a/tools/qmldebugger/creatorplugin/README
+++ b/tools/qmldebugger/creatorplugin/README
@@ -1,5 +1,11 @@
+The qmldebugger Qt Creator plugin currently builds with Qt Creator 1.3.
+
To enable this project, qmldebugger.pro requires that these two environment
variables be defined:
CREATOR_SRC_DIR -> source directory for Qt Creator
CREATOR_BUILD_DIR -> build directory for Qt Creator
+
+Once these are defined, run qmake on qmldebugger.pro.
+
+The project will be built into Creator's plugin directory.
diff --git a/tools/qmlviewer/qmlfolderlistmodel.cpp b/tools/qmlviewer/qmlfolderlistmodel.cpp
index 4cbc426..4f33f31 100644
--- a/tools/qmlviewer/qmlfolderlistmodel.cpp
+++ b/tools/qmlviewer/qmlfolderlistmodel.cpp
@@ -42,7 +42,7 @@
#include "qmlfolderlistmodel.h"
#include <QDirModel>
#include <QDebug>
-#include <QtDeclarative/qmlcontext.h>
+#include <qmlcontext.h>
class QmlFolderListModelPrivate
{
diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp
index 1811327..831c680 100644
--- a/tools/qmlviewer/qmlviewer.cpp
+++ b/tools/qmlviewer/qmlviewer.cpp
@@ -43,8 +43,8 @@
#include "ui_recopts.h"
#include "qmlviewer.h"
-#include <QtDeclarative/qmlcontext.h>
-#include <QtDeclarative/qmlengine.h>
+#include <qmlcontext.h>
+#include <qmlengine.h>
#include "qml.h"
#include <private/qperformancelog_p_p.h>
#include <private/qabstractanimation_p.h>
@@ -547,7 +547,7 @@ void QmlViewer::createMenu(QMenuBar *menu, QMenu *flatmenu)
settingsMenu->addAction(fullscreenAction);
#endif
- QMenu *propertiesMenu = new QMenu(tr("Properties"));
+ QMenu *propertiesMenu = settingsMenu->addMenu(tr("Properties"));
QActionGroup *orientation = new QActionGroup(parent);
orientation->setExclusive(true);
portraitOrientation = new QAction(tr("orientation: Portrait"), parent);
@@ -562,8 +562,6 @@ void QmlViewer::createMenu(QMenuBar *menu, QMenu *flatmenu)
orientation->addAction(landscapeOrientation);
propertiesMenu->addAction(landscapeOrientation);
- settingsMenu->addMenu(propertiesMenu);
-
if (flatmenu) flatmenu->addSeparator();
QMenu *helpMenu = flatmenu ? flatmenu : menu->addMenu(tr("&Help"));
diff --git a/tools/tools.pro b/tools/tools.pro
index 87ba3c9..4cff507 100644
--- a/tools/tools.pro
+++ b/tools/tools.pro
@@ -31,5 +31,7 @@ contains(QT_CONFIG, dbus):SUBDIRS += qdbus
!wince*:contains(QT_CONFIG, xmlpatterns): SUBDIRS += xmlpatterns xmlpatternsvalidator
embedded: SUBDIRS += makeqpf
+!wince*:!cross_compile:SUBDIRS += qdoc3
+
CONFIG+=ordered
QTDIR_build:REQUIRES = "contains(QT_CONFIG, full-config)"