summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-hangul.c2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-shaper.h36
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/DerivedSources.pro6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/docs.pri2
-rw-r--r--src/activeqt/control/control.pro2
-rw-r--r--src/corelib/kernel/qabstractitemmodel.cpp10
-rw-r--r--src/corelib/tools/qlocale_symbian.cpp3
-rw-r--r--src/corelib/xml/qxmlstream.cpp3
-rw-r--r--src/declarative/QmlChanges.txt4
-rw-r--r--src/declarative/debugger/debugger.pri6
-rw-r--r--src/declarative/debugger/qdeclarativedebugservice.cpp11
-rw-r--r--src/declarative/debugger/qdeclarativedebugtiming.cpp95
-rw-r--r--src/declarative/debugger/qdeclarativedebugtiming_p.h96
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanchors.cpp34
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanchors_p_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp30
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable_p.h5
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable_p_p.h6
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp59
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem_p.h11
-rw-r--r--src/declarative/graphicsitems/qdeclarativepainteditem.cpp17
-rw-r--r--src/declarative/graphicsitems/qdeclarativepainteditem_p.h1
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp25
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview_p.h1
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview_p_p.h27
-rw-r--r--src/declarative/graphicsitems/qdeclarativerectangle.cpp10
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp37
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext_p.h9
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp186
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p.h19
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p_p.h8
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp141
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p.h10
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p_p.h4
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp8
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp102
-rw-r--r--src/declarative/qml/qdeclarativeworkerscript.cpp1
-rw-r--r--src/declarative/util/qdeclarativeview.cpp100
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel.cpp33
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp6
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp18
-rw-r--r--src/gui/itemviews/qitemdelegate.cpp1
-rw-r--r--src/gui/itemviews/qsortfilterproxymodel.cpp2
-rw-r--r--src/gui/kernel/qapplication.cpp3
-rw-r--r--src/gui/kernel/qdnd_x11.cpp21
-rw-r--r--src/gui/styles/qgtkstyle.cpp2
-rw-r--r--src/gui/styles/qgtkstyle_p.cpp2
-rw-r--r--src/gui/text/qstatictext.cpp163
-rw-r--r--src/gui/text/qstatictext_p.h19
-rw-r--r--src/imports/gestures/gestures.pro4
-rw-r--r--src/imports/gestures/plugin.cpp2
-rw-r--r--src/imports/gestures/qmldir2
-rw-r--r--src/imports/particles/particles.cpp2
-rw-r--r--src/imports/particles/particles.pro4
-rw-r--r--src/imports/particles/qmldir2
-rw-r--r--src/imports/webkit/plugin.cpp2
-rw-r--r--src/imports/webkit/qdeclarativewebview.cpp21
-rw-r--r--src/imports/webkit/qmldir2
-rw-r--r--src/imports/webkit/webkit.pro4
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp2
-rw-r--r--src/opengl/qpaintengine_opengl.cpp2
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp25
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h2
-rw-r--r--src/script/api/qscriptcontext.cpp1
-rw-r--r--src/src.pro16
-rw-r--r--src/tools/tools.pro16
67 files changed, 1074 insertions, 436 deletions
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-hangul.c b/src/3rdparty/harfbuzz/src/harfbuzz-hangul.c
index a819dac..6f89ed6 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-hangul.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-hangul.c
@@ -130,7 +130,7 @@ static int hangul_nextSyllableBoundary(const HB_UChar16 *s, int start, int end)
static const HB_OpenTypeFeature hangul_features [] = {
{ HB_MAKE_TAG('c', 'c', 'm', 'p'), CcmpProperty },
{ HB_MAKE_TAG('l', 'j', 'm', 'o'), CcmpProperty },
- { HB_MAKE_TAG('j', 'j', 'm', 'o'), CcmpProperty },
+ { HB_MAKE_TAG('v', 'j', 'm', 'o'), CcmpProperty },
{ HB_MAKE_TAG('t', 'j', 'm', 'o'), CcmpProperty },
{ 0, 0 }
};
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
index f7c7714..470e27b 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
@@ -34,6 +34,18 @@
HB_BEGIN_HEADER
+/*
+ using anything else than signed or unsigned for bitfields in C is non standard,
+ but accepted by almost all compilers. And it gives a significant reduction in
+ memory consumption as HB_CharAttributes and HB_GlyphAttributes will not have
+ a 4 byte alignment
+*/
+#ifdef __xlC__
+typedef unsigned hb_bitfield;
+#else
+typedef hb_uint8 hb_bitfield;
+#endif
+
typedef enum {
HB_Script_Common,
HB_Script_Greek,
@@ -123,12 +135,12 @@ typedef enum {
typedef struct {
- /*HB_LineBreakType*/ unsigned lineBreakType :2;
- /*HB_Bool*/ unsigned whiteSpace :1; /* A unicode whitespace character, except NBSP, ZWNBSP */
- /*HB_Bool*/ unsigned charStop :1; /* Valid cursor position (for left/right arrow) */
- /*HB_Bool*/ unsigned wordBoundary :1;
- /*HB_Bool*/ unsigned sentenceBoundary :1;
- unsigned unused :2;
+ /*HB_LineBreakType*/ hb_bitfield lineBreakType :2;
+ /*HB_Bool*/ hb_bitfield whiteSpace :1; /* A unicode whitespace character, except NBSP, ZWNBSP */
+ /*HB_Bool*/ hb_bitfield charStop :1; /* Valid cursor position (for left/right arrow) */
+ /*HB_Bool*/ hb_bitfield wordBoundary :1;
+ /*HB_Bool*/ hb_bitfield sentenceBoundary :1;
+ hb_bitfield unused :2;
} HB_CharAttributes;
void HB_GetCharAttributes(const HB_UChar16 *string, hb_uint32 stringLength,
@@ -181,12 +193,12 @@ typedef enum {
* it like that. If this is a problem please tell Trolltech :)
*/
typedef struct {
- unsigned justification :4; /* Justification class */
- unsigned clusterStart :1; /* First glyph of representation of cluster */
- unsigned mark :1; /* needs to be positioned around base char */
- unsigned zeroWidth :1; /* ZWJ, ZWNJ etc, with no width */
- unsigned dontPrint :1;
- unsigned combiningClass :8;
+ hb_bitfield justification :4; /* Justification class */
+ hb_bitfield clusterStart :1; /* First glyph of representation of cluster */
+ hb_bitfield mark :1; /* needs to be positioned around base char */
+ hb_bitfield zeroWidth :1; /* ZWJ, ZWNJ etc, with no width */
+ hb_bitfield dontPrint :1;
+ hb_bitfield combiningClass :8;
} HB_GlyphAttributes;
typedef struct HB_FaceRec_ {
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index 5def728..63e78a7 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -159,7 +159,7 @@ defineTest(addExtraCompiler) {
for(file,input) {
base = $$basename(file)
- base ~= s/\..+//
+ base ~= s/\\..+//
newfile=$$replace(outputRule,\\$\\{QMAKE_FILE_BASE\\},$$base)
SOURCES += $$newfile
}
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/DerivedSources.pro b/src/3rdparty/webkit/WebKit/qt/Api/DerivedSources.pro
index 389fb5f..22d4c8d 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/DerivedSources.pro
+++ b/src/3rdparty/webkit/WebKit/qt/Api/DerivedSources.pro
@@ -28,7 +28,7 @@ qtheader_module.commands += echo $${QUOTE}$${LITERAL_HASH}define QT_QTWEBKIT_MOD
qtheader_module.commands += echo $${QUOTE}$${LITERAL_HASH}include $${ESCAPE}<QtNetwork/QtNetwork$${ESCAPE}>$${QUOTE} >> $${qtheader_module.target} &&
WEBKIT_CLASS_HEADERS = $${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}PWD/QtWebKit
-regex = ".*\sclass\sQWEBKIT_EXPORT\s(\w+)\s(.*)"
+regex = ".*\\sclass\\sQWEBKIT_EXPORT\\s(\\w+)\\s(.*)"
for(HEADER, WEBKIT_API_HEADERS) {
# 1. Append to QtWebKit header that includes all other header files
@@ -70,7 +70,7 @@ for(HEADER, WEBKIT_API_HEADERS) {
res = $$find(src, $$regex)
isEmpty(res):break()
- exp = $$replace(src, $$regex, "EXPORTED_CLASS = \1")
+ exp = $$replace(src, $$regex, "EXPORTED_CLASS = \\1")
eval($$exp)
CLASS_TARGET = "qtheader_$${EXPORTED_CLASS}"
@@ -87,7 +87,7 @@ for(HEADER, WEBKIT_API_HEADERS) {
# Qt's QRegExp does not support inline non-greedy matching,
# so we'll have to work around it by updating the haystack
- src = $$replace(src, $$regex, "\2")
+ src = $$replace(src, $$regex, "\\2")
src_words = $$join(src, $${LITERAL_WHITESPACE})
}
}
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/docs.pri b/src/3rdparty/webkit/WebKit/qt/docs/docs.pri
index 804817b..a56ddb4 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/docs.pri
+++ b/src/3rdparty/webkit/WebKit/qt/docs/docs.pri
@@ -3,7 +3,7 @@ include(../../../WebKit.pri)
unix {
QDOC = SRCDIR=$$PWD/../../.. OUTPUT_DIR=$$OUTPUT_DIR $$(QTDIR)/bin/qdoc3
} else {
- QDOC = $$(QTDIR)\bin\qdoc3.exe
+ QDOC = $$(QTDIR)\\bin\\qdoc3.exe
}
unix {
diff --git a/src/activeqt/control/control.pro b/src/activeqt/control/control.pro
index bf3647e..44eb928 100644
--- a/src/activeqt/control/control.pro
+++ b/src/activeqt/control/control.pro
@@ -15,7 +15,7 @@ TARGET = QAxServer
}
CONFIG += qt warn_off staticlib
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE\lib
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE\\lib
DEFINES += QAX_SERVER
win32-g++:DEFINES += QT_NEEDS_QMAIN
diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp
index 3660a3c..24c26b6 100644
--- a/src/corelib/kernel/qabstractitemmodel.cpp
+++ b/src/corelib/kernel/qabstractitemmodel.cpp
@@ -2501,6 +2501,8 @@ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int star
}
/*!
+ \since 4.6
+
Begins a row move operation.
When reimplementing a subclass, this method simplifies moving
@@ -2526,7 +2528,7 @@ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int star
same, in which case you must ensure that the \a destinationChild is
not within the range of \a sourceFirst and \a sourceLast. You
must also ensure that you do not attempt to move a row to one of
- its own chilren or ancestors. This method returns false if either
+ its own children or ancestors. This method returns false if either
condition is true, in which case you should abort your move
operation.
@@ -2582,13 +2584,7 @@ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int star
Note that other rows may be displaced accordingly.
\endtable
- \note This function emits the rowsAboutToBeInserted() signal which
- connected views (or proxies) must handle before the data is inserted.
- Otherwise, the views may end up in an invalid state.
-
\sa endMoveRows()
-
- \since 4.6
*/
bool QAbstractItemModel::beginMoveRows(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationChild)
{
diff --git a/src/corelib/tools/qlocale_symbian.cpp b/src/corelib/tools/qlocale_symbian.cpp
index 1e674af..458bb2a 100644
--- a/src/corelib/tools/qlocale_symbian.cpp
+++ b/src/corelib/tools/qlocale_symbian.cpp
@@ -159,8 +159,9 @@ static const symbianToISO symbian_to_iso_list[] = {
{ ELangEnglish_Prc, "en_CN" }, // 159 ### Not supported by CLDR
{ ELangEnglish_Japan, "en_JP"}, // 160 ### Not supported by CLDR
{ ELangEnglish_Thailand, "en_TH" }, // 161 ### Not supported by CLDR
- { ELangMalay_Apac, "ms" } // 326
+ { ELangMalay_Apac, "ms" }, // 326
#endif
+ { 327/*ELangIndonesian_Apac*/,"id_ID" } // 327 - appeared in Symbian^3
};
/*!
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp
index 1bf00b8..ae12007 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -3716,7 +3716,8 @@ void QXmlStreamWriter::writeProcessingInstruction(const QString &target, const Q
{
Q_D(QXmlStreamWriter);
Q_ASSERT(!data.contains(QLatin1String("?>")));
- d->finishStartElement();
+ if (!d->finishStartElement(false) && d->autoFormatting)
+ d->indent(d->tagStack.size());
d->write("<?");
d->write(target);
if (!data.isNull()) {
diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt
index 25c2417..142920c 100644
--- a/src/declarative/QmlChanges.txt
+++ b/src/declarative/QmlChanges.txt
@@ -1,6 +1,9 @@
=============================================================================
The changes below are pre Qt 4.7.0 RC
+TextInput and TextEdit:
+ - showInputPanelOnFocus property added
+ - openSoftwareInputPanel() and closeSoftwareInputPanel() functions added
Flickable:
- overShoot is replaced by boundsBehavior enumeration
- flickingHorizontally and flickingVertically properties added
@@ -15,6 +18,7 @@ QList<QObject*> models no longer provide properties in model object. The
properties are now updated when the object changes. An object's property
"foo" may now be accessed as "foo", modelData.foo" or model.modelData.foo"
component.createObject has gained a mandatory "parent" argument
+TextEdit and TextInput now have a "selectByMouse" property that defaults to false.
C++ API
-------
diff --git a/src/declarative/debugger/debugger.pri b/src/declarative/debugger/debugger.pri
index dedea55..6777868 100644
--- a/src/declarative/debugger/debugger.pri
+++ b/src/declarative/debugger/debugger.pri
@@ -5,11 +5,13 @@ SOURCES += \
$$PWD/qpacketprotocol.cpp \
$$PWD/qdeclarativedebugservice.cpp \
$$PWD/qdeclarativedebugclient.cpp \
- $$PWD/qdeclarativedebug.cpp
+ $$PWD/qdeclarativedebug.cpp \
+ $$PWD/qdeclarativedebugtiming.cpp
HEADERS += \
$$PWD/qdeclarativedebuggerstatus_p.h \
$$PWD/qpacketprotocol_p.h \
$$PWD/qdeclarativedebugservice_p.h \
$$PWD/qdeclarativedebugclient_p.h \
- $$PWD/qdeclarativedebug_p.h
+ $$PWD/qdeclarativedebug_p.h \
+ $$PWD/qdeclarativedebugtiming_p.h
diff --git a/src/declarative/debugger/qdeclarativedebugservice.cpp b/src/declarative/debugger/qdeclarativedebugservice.cpp
index 34e73fd..dca2695 100644
--- a/src/declarative/debugger/qdeclarativedebugservice.cpp
+++ b/src/declarative/debugger/qdeclarativedebugservice.cpp
@@ -61,6 +61,7 @@ class QDeclarativeDebugServer : public QObject
public:
static QDeclarativeDebugServer *instance();
void listen();
+ void waitForConnection();
bool hasDebuggingClient() const;
private Q_SLOTS:
@@ -115,6 +116,12 @@ void QDeclarativeDebugServer::listen()
qWarning("QDeclarativeDebugServer: Unable to listen on port %d", d->port);
}
+void QDeclarativeDebugServer::waitForConnection()
+{
+ Q_D(QDeclarativeDebugServer);
+ d->tcpServer->waitForNewConnection(-1);
+}
+
void QDeclarativeDebugServer::newConnection()
{
Q_D(QDeclarativeDebugServer);
@@ -144,6 +151,7 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance()
if (!envTested) {
envTested = true;
QByteArray env = qgetenv("QML_DEBUG_SERVER_PORT");
+ QByteArray block = qgetenv("QML_DEBUG_SERVER_BLOCK");
bool ok = false;
int port = env.toInt(&ok);
@@ -151,6 +159,9 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance()
if (ok && port > 1024) {
server = new QDeclarativeDebugServer(port);
server->listen();
+ if (!block.isEmpty()) {
+ server->waitForConnection();
+ }
}
}
diff --git a/src/declarative/debugger/qdeclarativedebugtiming.cpp b/src/declarative/debugger/qdeclarativedebugtiming.cpp
new file mode 100644
index 0000000..5b93852
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativedebugtiming.cpp
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Technology Preview License Agreement accompanying
+** this package.
+**
+** 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.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativedebugtiming_p.h"
+
+#include <QtCore/qdatastream.h>
+
+Q_GLOBAL_STATIC(QDeclarativeDebugTiming, timerInstance);
+
+QDeclarativeDebugTiming::QDeclarativeDebugTiming()
+: QDeclarativeDebugService(QLatin1String("CanvasFrameRate"))
+{
+ m_timer.start();
+}
+
+void QDeclarativeDebugTiming::addEvent(EventType t)
+{
+ if (QDeclarativeDebugService::isDebuggingEnabled())
+ timerInstance()->addEventImpl(t);
+}
+
+void QDeclarativeDebugTiming::startRange(RangeType t)
+{
+ if (QDeclarativeDebugService::isDebuggingEnabled())
+ timerInstance()->startRangeImpl(t);
+}
+
+void QDeclarativeDebugTiming::endRange(RangeType t)
+{
+ if (QDeclarativeDebugService::isDebuggingEnabled())
+ timerInstance()->endRangeImpl(t);
+}
+
+void QDeclarativeDebugTiming::addEventImpl(EventType event)
+{
+ QByteArray data;
+ QDataStream ds(&data, QIODevice::WriteOnly);
+ ds << m_timer.elapsed() << (int)Event << (int)event;
+ sendMessage(data);
+}
+
+void QDeclarativeDebugTiming::startRangeImpl(RangeType range)
+{
+ QByteArray data;
+ QDataStream ds(&data, QIODevice::WriteOnly);
+ ds << m_timer.elapsed() << (int)RangeStart << (int)range;
+ sendMessage(data);
+}
+
+void QDeclarativeDebugTiming::endRangeImpl(RangeType range)
+{
+ QByteArray data;
+ QDataStream ds(&data, QIODevice::WriteOnly);
+ ds << m_timer.elapsed() << (int)RangeEnd << (int)range;
+ sendMessage(data);
+}
+
diff --git a/src/declarative/debugger/qdeclarativedebugtiming_p.h b/src/declarative/debugger/qdeclarativedebugtiming_p.h
new file mode 100644
index 0000000..d9ed67c
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativedebugtiming_p.h
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module 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 Technology Preview License Agreement accompanying
+** this package.
+**
+** 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.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEDEBUGTIMING_P_H
+#define QDECLARATIVEDEBUGTIMING_P_H
+
+#include <private/qdeclarativedebugservice_p.h>
+#include <QtCore/qelapsedtimer.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeDebugTiming : public QDeclarativeDebugService
+{
+public:
+ enum EventType {
+ FramePaint,
+ Mouse,
+ Key,
+
+ MaximumEventType
+ };
+
+ enum Message {
+ Event,
+ RangeStart,
+ RangeEnd,
+
+ MaximumMessage
+ };
+
+ enum RangeType {
+ Painting,
+ Compiling,
+ Creating,
+
+ MaximumRangeType
+ };
+
+ static void addEvent(EventType);
+ static void startRange(RangeType);
+ static void endRange(RangeType);
+
+ QDeclarativeDebugTiming();
+private:
+ void addEventImpl(EventType);
+ void startRangeImpl(RangeType);
+ void endRangeImpl(RangeType);
+ QElapsedTimer m_timer;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEDEBUGTIMING_P_H
+
diff --git a/src/declarative/graphicsitems/qdeclarativeanchors.cpp b/src/declarative/graphicsitems/qdeclarativeanchors.cpp
index ef07cbb..aa53aba 100644
--- a/src/declarative/graphicsitems/qdeclarativeanchors.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeanchors.cpp
@@ -92,17 +92,17 @@ static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine
//position when origin is 0,0
static qreal adjustedPosition(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
{
- int ret = 0;
+ qreal ret = 0.0;
QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(item);
switch(anchorLine) {
case QDeclarativeAnchorLine::Left:
- ret = 0;
+ ret = 0.0;
break;
case QDeclarativeAnchorLine::Right:
ret = d->width();
break;
case QDeclarativeAnchorLine::Top:
- ret = 0;
+ ret = 0.0;
break;
case QDeclarativeAnchorLine::Bottom:
ret = d->height();
@@ -459,10 +459,10 @@ void QDeclarativeAnchors::resetCenterIn()
bool QDeclarativeAnchorsPrivate::calcStretch(const QDeclarativeAnchorLine &edge1,
const QDeclarativeAnchorLine &edge2,
- int offset1,
- int offset2,
+ qreal offset1,
+ qreal offset2,
QDeclarativeAnchorLine::AnchorLine line,
- int &stretch)
+ qreal &stretch)
{
bool edge1IsParent = (edge1.item == item->parentItem());
bool edge2IsParent = (edge2.item == item->parentItem());
@@ -471,15 +471,15 @@ bool QDeclarativeAnchorsPrivate::calcStretch(const QDeclarativeAnchorLine &edge1
bool invalid = false;
if ((edge2IsParent && edge1IsParent) || (edge2IsSibling && edge1IsSibling)) {
- stretch = ((int)position(edge2.item, edge2.anchorLine) + offset2)
- - ((int)position(edge1.item, edge1.anchorLine) + offset1);
+ stretch = (position(edge2.item, edge2.anchorLine) + offset2)
+ - (position(edge1.item, edge1.anchorLine) + offset1);
} else if (edge2IsParent && edge1IsSibling) {
- stretch = ((int)position(edge2.item, edge2.anchorLine) + offset2)
- - ((int)position(item->parentObject(), line)
- + (int)position(edge1.item, edge1.anchorLine) + offset1);
+ stretch = (position(edge2.item, edge2.anchorLine) + offset2)
+ - (position(item->parentObject(), line)
+ + position(edge1.item, edge1.anchorLine) + offset1);
} else if (edge2IsSibling && edge1IsParent) {
- stretch = ((int)position(item->parentObject(), line) + (int)position(edge2.item, edge2.anchorLine) + offset2)
- - ((int)position(edge1.item, edge1.anchorLine) + offset1);
+ stretch = (position(item->parentObject(), line) + position(edge2.item, edge2.anchorLine) + offset2)
+ - (position(edge1.item, edge1.anchorLine) + offset1);
} else
invalid = true;
@@ -497,7 +497,7 @@ void QDeclarativeAnchorsPrivate::updateVerticalAnchors()
if (usedAnchors & QDeclarativeAnchors::TopAnchor) {
//Handle stretching
bool invalid = true;
- int height = 0;
+ qreal height = 0.0;
if (usedAnchors & QDeclarativeAnchors::BottomAnchor) {
invalid = calcStretch(top, bottom, topMargin, -bottomMargin, QDeclarativeAnchorLine::Top, height);
} else if (usedAnchors & QDeclarativeAnchors::VCenterAnchor) {
@@ -516,7 +516,7 @@ void QDeclarativeAnchorsPrivate::updateVerticalAnchors()
} else if (usedAnchors & QDeclarativeAnchors::BottomAnchor) {
//Handle stretching (top + bottom case is handled above)
if (usedAnchors & QDeclarativeAnchors::VCenterAnchor) {
- int height = 0;
+ qreal height = 0.0;
bool invalid = calcStretch(vCenter, bottom, vCenterOffset, -bottomMargin,
QDeclarativeAnchorLine::Top, height);
if (!invalid)
@@ -569,7 +569,7 @@ void QDeclarativeAnchorsPrivate::updateHorizontalAnchors()
if (usedAnchors & QDeclarativeAnchors::LeftAnchor) {
//Handle stretching
bool invalid = true;
- int width = 0;
+ qreal width = 0.0;
if (usedAnchors & QDeclarativeAnchors::RightAnchor) {
invalid = calcStretch(left, right, leftMargin, -rightMargin, QDeclarativeAnchorLine::Left, width);
} else if (usedAnchors & QDeclarativeAnchors::HCenterAnchor) {
@@ -588,7 +588,7 @@ void QDeclarativeAnchorsPrivate::updateHorizontalAnchors()
} else if (usedAnchors & QDeclarativeAnchors::RightAnchor) {
//Handle stretching (left + right case is handled in updateLeftAnchor)
if (usedAnchors & QDeclarativeAnchors::HCenterAnchor) {
- int width = 0;
+ qreal width = 0.0;
bool invalid = calcStretch(hCenter, right, hCenterOffset, -rightMargin,
QDeclarativeAnchorLine::Left, width);
if (!invalid)
diff --git a/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h b/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h
index 05be6c5..1bbea36 100644
--- a/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h
@@ -131,7 +131,7 @@ public:
bool checkVValid() const;
bool checkHAnchorValid(QDeclarativeAnchorLine anchor) const;
bool checkVAnchorValid(QDeclarativeAnchorLine anchor) const;
- bool calcStretch(const QDeclarativeAnchorLine &edge1, const QDeclarativeAnchorLine &edge2, int offset1, int offset2, QDeclarativeAnchorLine::AnchorLine line, int &stretch);
+ bool calcStretch(const QDeclarativeAnchorLine &edge1, const QDeclarativeAnchorLine &edge2, qreal offset1, qreal offset2, QDeclarativeAnchorLine::AnchorLine line, qreal &stretch);
void updateHorizontalAnchors();
void updateVerticalAnchors();
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 560d586..10dc0f8 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -160,6 +160,7 @@ void QDeclarativeFlickablePrivate::init()
q->setFiltersChildEvents(true);
QDeclarativeItemPrivate *viewportPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(viewport));
viewportPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
+ lastPosTime.invalidate();
}
/*
@@ -656,7 +657,7 @@ void QDeclarativeFlickablePrivate::handleMousePressEvent(QGraphicsSceneMouseEven
void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
Q_Q(QDeclarativeFlickable);
- if (!interactive || lastPosTime.isNull())
+ if (!interactive || !lastPosTime.isValid())
return;
bool rejectY = false;
bool rejectX = false;
@@ -752,7 +753,7 @@ void QDeclarativeFlickablePrivate::handleMouseReleaseEvent(QGraphicsSceneMouseEv
stealMouse = false;
q->setKeepMouseGrab(false);
pressed = false;
- if (lastPosTime.isNull())
+ if (!lastPosTime.isValid())
return;
if (QDeclarativeItemPrivate::elapsed(lastPosTime) > 100) {
@@ -780,7 +781,7 @@ void QDeclarativeFlickablePrivate::handleMouseReleaseEvent(QGraphicsSceneMouseEv
fixupX();
}
- lastPosTime = QTime();
+ lastPosTime.invalidate();
if (!timeline.isActive())
q->movementEnding();
@@ -1026,24 +1027,6 @@ QDeclarativeListProperty<QGraphicsObject> QDeclarativeFlickable::flickableChildr
return QGraphicsItemPrivate::get(d->viewport)->childrenList();
}
-bool QDeclarativeFlickable::overShoot() const
-{
- Q_D(const QDeclarativeFlickable);
- return d->boundsBehavior == DragAndOvershootBounds;
-}
-
-void QDeclarativeFlickable::setOverShoot(bool o)
-{
- Q_D(QDeclarativeFlickable);
- if ((o && d->boundsBehavior == DragAndOvershootBounds)
- || (!o && d->boundsBehavior == StopAtBounds))
- return;
- qmlInfo(this) << "overshoot is deprecated and will be removed imminently - use boundsBehavior.";
- d->boundsBehavior = o ? DragAndOvershootBounds : StopAtBounds;
- emit boundsBehaviorChanged();
- emit overShootChanged();
-}
-
/*!
\qmlproperty enumeration Flickable::boundsBehavior
This property holds whether the surface may be dragged
@@ -1078,7 +1061,6 @@ void QDeclarativeFlickable::setBoundsBehavior(BoundsBehavior b)
return;
d->boundsBehavior = b;
emit boundsBehaviorChanged();
- emit overShootChanged();
}
/*!
@@ -1237,8 +1219,8 @@ bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
}
return stealThisEvent || d->delayedPressEvent;
- } else if (!d->lastPosTime.isNull()) {
- d->lastPosTime = QTime();
+ } else if (d->lastPosTime.isValid()) {
+ d->lastPosTime.invalidate();
}
if (mouseEvent.type() == QEvent::GraphicsSceneMouseRelease) {
d->clearDelayedPress();
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p.h
index 05887b8..d40a0dc 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeflickable_p.h
@@ -64,7 +64,6 @@ class Q_DECLARATIVE_EXPORT QDeclarativeFlickable : public QDeclarativeItem
Q_PROPERTY(qreal horizontalVelocity READ horizontalVelocity NOTIFY horizontalVelocityChanged)
Q_PROPERTY(qreal verticalVelocity READ verticalVelocity NOTIFY verticalVelocityChanged)
- Q_PROPERTY(bool overShoot READ overShoot WRITE setOverShoot NOTIFY overShootChanged) // deprecated
Q_PROPERTY(BoundsBehavior boundsBehavior READ boundsBehavior WRITE setBoundsBehavior NOTIFY boundsBehaviorChanged)
Q_PROPERTY(qreal maximumFlickVelocity READ maximumFlickVelocity WRITE setMaximumFlickVelocity NOTIFY maximumFlickVelocityChanged)
Q_PROPERTY(qreal flickDeceleration READ flickDeceleration WRITE setFlickDeceleration NOTIFY flickDecelerationChanged)
@@ -101,9 +100,6 @@ public:
QDeclarativeListProperty<QObject> flickableData();
QDeclarativeListProperty<QGraphicsObject> flickableChildren();
- bool overShoot() const;
- void setOverShoot(bool);
-
enum BoundsBehavior { StopAtBounds, DragOverBounds, DragAndOvershootBounds };
BoundsBehavior boundsBehavior() const;
void setBoundsBehavior(BoundsBehavior);
@@ -172,7 +168,6 @@ Q_SIGNALS:
void pageChanged();
void flickableDirectionChanged();
void interactiveChanged();
- void overShootChanged();
void boundsBehaviorChanged();
void maximumFlickVelocityChanged();
void flickDecelerationChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
index b467ed2..66d2678 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
@@ -140,13 +140,13 @@ public:
bool stealMouse : 1;
bool pressed : 1;
bool interactive : 1;
- QTime lastPosTime;
+ QElapsedTimer lastPosTime;
QPointF lastPos;
QPointF pressPos;
- QTime pressTime;
+ QElapsedTimer pressTime;
qreal deceleration;
qreal maxVelocity;
- QTime velocityTime;
+ QElapsedTimer velocityTime;
QPointF lastFlickablePosition;
qreal reportedVelocitySmoothing;
QGraphicsSceneMouseEvent *delayedPressEvent;
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 2841ac3..7bd08ce 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -3145,41 +3145,56 @@ QDebug operator<<(QDebug debug, QDeclarativeItem *item)
return debug;
}
-int QDeclarativeItemPrivate::consistentTime = -1;
-void QDeclarativeItemPrivate::setConsistentTime(int t)
+qint64 QDeclarativeItemPrivate::consistentTime = -1;
+void QDeclarativeItemPrivate::setConsistentTime(qint64 t)
{
consistentTime = t;
}
-QTime QDeclarativeItemPrivate::currentTime()
+class QElapsedTimerConsistentTimeHack
{
- if (consistentTime == -1)
- return QTime::currentTime();
- else
- return QTime(0, 0).addMSecs(consistentTime);
-}
+public:
+ void start() {
+ t1 = QDeclarativeItemPrivate::consistentTime;
+ t2 = 0;
+ }
+ qint64 elapsed() {
+ return QDeclarativeItemPrivate::consistentTime - t1;
+ }
+ qint64 restart() {
+ qint64 val = QDeclarativeItemPrivate::consistentTime - t1;
+ t1 = QDeclarativeItemPrivate::consistentTime;
+ t2 = 0;
+ return val;
+ }
-void QDeclarativeItemPrivate::start(QTime &t)
+private:
+ qint64 t1;
+ qint64 t2;
+};
+
+void QDeclarativeItemPrivate::start(QElapsedTimer &t)
{
- t = currentTime();
+ if (QDeclarativeItemPrivate::consistentTime == -1)
+ t.start();
+ else
+ ((QElapsedTimerConsistentTimeHack*)&t)->start();
}
-int QDeclarativeItemPrivate::elapsed(QTime &t)
+qint64 QDeclarativeItemPrivate::elapsed(QElapsedTimer &t)
{
- int n = t.msecsTo(currentTime());
- if (n < 0) // passed midnight
- n += 86400 * 1000;
- return n;
+ if (QDeclarativeItemPrivate::consistentTime == -1)
+ return t.elapsed();
+ else
+ return ((QElapsedTimerConsistentTimeHack*)&t)->elapsed();
}
-int QDeclarativeItemPrivate::restart(QTime &t)
+qint64 QDeclarativeItemPrivate::restart(QElapsedTimer &t)
{
- QTime time = currentTime();
- int n = t.msecsTo(time);
- if (n < 0) // passed midnight
- n += 86400*1000;
- t = time;
- return n;
+ if (QDeclarativeItemPrivate::consistentTime == -1)
+ return t.restart();
+ else
+ return ((QElapsedTimerConsistentTimeHack*)&t)->restart();
}
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativeitem_p.h b/src/declarative/graphicsitems/qdeclarativeitem_p.h
index 15b34f0..184d6f1 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeitem_p.h
@@ -305,12 +305,11 @@ public:
virtual void focusChanged(bool);
- static int consistentTime;
- static QTime currentTime();
- static void setConsistentTime(int t);
- static void start(QTime &);
- static int elapsed(QTime &);
- static int restart(QTime &);
+ static qint64 consistentTime;
+ static void setConsistentTime(qint64 t);
+ static void start(QElapsedTimer &);
+ static qint64 elapsed(QElapsedTimer &);
+ static qint64 restart(QElapsedTimer &);
};
/*
diff --git a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
index c4f0b86..13d1b61 100644
--- a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
@@ -152,8 +152,6 @@ void QDeclarativePaintedItem::setContentsSize(const QSize &size)
Q_D(QDeclarativePaintedItem);
if (d->contentsSize == size) return;
d->contentsSize = size;
- setImplicitWidth(size.width()*d->contentsScale);
- setImplicitHeight(size.height()*d->contentsScale);
clearCache();
update();
emit contentsSizeChanged();
@@ -170,8 +168,6 @@ void QDeclarativePaintedItem::setContentsScale(qreal scale)
Q_D(QDeclarativePaintedItem);
if (d->contentsScale == scale) return;
d->contentsScale = scale;
- setImplicitWidth(d->contentsSize.width()*scale);
- setImplicitHeight(d->contentsSize.height()*scale);
clearCache();
update();
emit contentsScaleChanged();
@@ -232,6 +228,19 @@ void QDeclarativePaintedItem::setCacheFrozen(bool frozen)
// XXX clear cache?
}
+QRectF QDeclarativePaintedItem::boundingRect() const
+{
+ Q_D(const QDeclarativePaintedItem);
+ qreal w = d->mWidth;
+ QSizeF sz = d->contentsSize * d->contentsScale;
+ if (w < sz.width())
+ w = sz.width();
+ qreal h = d->mHeight;
+ if (h < sz.height())
+ h = sz.height();
+ return QRectF(0.0,0.0,w,h);
+}
+
/*!
\internal
*/
diff --git a/src/declarative/graphicsitems/qdeclarativepainteditem_p.h b/src/declarative/graphicsitems/qdeclarativepainteditem_p.h
index 8d08ba2..86f065a 100644
--- a/src/declarative/graphicsitems/qdeclarativepainteditem_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepainteditem_p.h
@@ -93,6 +93,7 @@ protected:
const QVariant &value);
void setCacheFrozen(bool);
+ QRectF boundingRect() const;
Q_SIGNALS:
void fillColorChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index 207cc25..448ec06 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -110,6 +110,8 @@ QDeclarativeItem *QDeclarativePathViewPrivate::getItem(int modelIndex)
att->setOnPath(true);
}
item->setParentItem(q);
+ QDeclarativeItemPrivate *itemPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(item));
+ itemPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
}
requestedIndex = -1;
return item;
@@ -121,6 +123,8 @@ void QDeclarativePathViewPrivate::releaseItem(QDeclarativeItem *item)
return;
if (QDeclarativePathViewAttached *att = attached(item))
att->setOnPath(false);
+ QDeclarativeItemPrivate *itemPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(item));
+ itemPrivate->removeItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
model->release(item);
}
@@ -944,7 +948,7 @@ void QDeclarativePathView::mousePressEvent(QGraphicsSceneMouseEvent *event)
void QDeclarativePathView::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativePathView);
- if (!d->interactive || d->lastPosTime.isNull())
+ if (!d->interactive || !d->lastPosTime.isValid())
return;
if (!d->stealMouse) {
@@ -978,7 +982,7 @@ void QDeclarativePathView::mouseReleaseEvent(QGraphicsSceneMouseEvent *)
Q_D(QDeclarativePathView);
d->stealMouse = false;
setKeepMouseGrab(false);
- if (!d->interactive || d->lastPosTime.isNull())
+ if (!d->interactive || !d->lastPosTime.isValid())
return;
qreal elapsed = qreal(d->lastElapsed + QDeclarativeItemPrivate::elapsed(d->lastPosTime)) / 1000.;
@@ -1013,7 +1017,7 @@ void QDeclarativePathView::mouseReleaseEvent(QGraphicsSceneMouseEvent *)
d->fixOffset();
}
- d->lastPosTime = QTime();
+ d->lastPosTime.invalidate();
ungrabMouse();
}
@@ -1055,8 +1059,8 @@ bool QDeclarativePathView::sendMouseEvent(QGraphicsSceneMouseEvent *event)
grabMouse();
return d->stealMouse;
- } else if (!d->lastPosTime.isNull()) {
- d->lastPosTime = QTime();
+ } else if (d->lastPosTime.isValid()) {
+ d->lastPosTime.invalidate();
}
return false;
}
@@ -1084,6 +1088,16 @@ bool QDeclarativePathView::sceneEventFilter(QGraphicsItem *i, QEvent *e)
return QDeclarativeItem::sceneEventFilter(i, e);
}
+bool QDeclarativePathView::event(QEvent *event)
+{
+ if (event->type() == QEvent::User) {
+ refill();
+ return true;
+ }
+
+ return QDeclarativeItem::event(event);
+}
+
void QDeclarativePathView::componentComplete()
{
Q_D(QDeclarativePathView);
@@ -1103,6 +1117,7 @@ void QDeclarativePathView::refill()
if (!d->isValid() || !isComponentComplete())
return;
+ d->layoutScheduled = false;
bool currentVisible = false;
// first move existing items and remove items off path
diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p.h
index 349a01c..8a6f53f 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepathview_p.h
@@ -161,6 +161,7 @@ protected:
void mouseReleaseEvent(QGraphicsSceneMouseEvent *);
bool sendMouseEvent(QGraphicsSceneMouseEvent *event);
bool sceneEventFilter(QGraphicsItem *, QEvent *);
+ bool event(QEvent *event);
void componentComplete();
private Q_SLOTS:
diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h
index 303486f..a0d2610 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h
@@ -68,7 +68,7 @@ QT_BEGIN_NAMESPACE
class QDeclarativeOpenMetaObjectType;
class QDeclarativePathViewAttached;
-class QDeclarativePathViewPrivate : public QDeclarativeItemPrivate
+class QDeclarativePathViewPrivate : public QDeclarativeItemPrivate, public QDeclarativeItemChangeListener
{
Q_DECLARE_PUBLIC(QDeclarativePathView)
@@ -77,7 +77,8 @@ public:
: path(0), currentIndex(0), currentItemOffset(0.0), startPc(0), lastDist(0)
, lastElapsed(0), mappedRange(1.0)
, stealMouse(false), ownModel(false), interactive(true), haveHighlightRange(true)
- , autoHighlight(true), highlightUp(false), dragMargin(0), deceleration(100)
+ , autoHighlight(true), highlightUp(false), layoutScheduled(false)
+ , dragMargin(0), deceleration(100)
, moveOffset(this, &QDeclarativePathViewPrivate::setOffset)
, firstIndex(-1), pathItems(-1), requestedIndex(-1)
, moveReason(Other), attType(0), highlightComponent(0), highlightItem(0)
@@ -89,14 +90,29 @@ public:
{
}
- void init()
- {
+ void init() {
Q_Q(QDeclarativePathView);
offset = 0;
q->setAcceptedMouseButtons(Qt::LeftButton);
q->setFlag(QGraphicsItem::ItemIsFocusScope);
q->setFiltersChildEvents(true);
q->connect(&tl, SIGNAL(updated()), q, SLOT(ticked()));
+ lastPosTime.invalidate();
+ }
+
+ void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry) {
+ if ((newGeometry.size() != oldGeometry.size())
+ && (!highlightItem || item != highlightItem)) {
+ scheduleLayout();
+ }
+ }
+
+ void scheduleLayout() {
+ Q_Q(QDeclarativePathView);
+ if (!layoutScheduled) {
+ layoutScheduled = true;
+ QCoreApplication::postEvent(q, new QEvent(QEvent::User), Qt::HighEventPriority);
+ }
}
QDeclarativeItem *getItem(int modelIndex);
@@ -138,7 +154,8 @@ public:
bool haveHighlightRange : 1;
bool autoHighlight : 1;
bool highlightUp : 1;
- QTime lastPosTime;
+ bool layoutScheduled : 1;
+ QElapsedTimer lastPosTime;
QPointF lastPos;
qreal dragMargin;
qreal deceleration;
diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
index d098aa0..301ca00 100644
--- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
@@ -114,11 +114,11 @@ void QDeclarativeGradientStop::updateGradient()
rectangle with a gradient starting with red, blending to yellow at 1/3 of the
size of the rectangle, and ending with Green:
- \table
- \row
- \o \image gradient.png
- \o \quotefile doc/src/snippets/declarative/gradient.qml
- \endtable
+ \snippet doc/src/snippets/declarative/gradient.qml code
+
+ Note that this item is not a visual representation of a gradient. To display a
+ gradient use a visual item (like rectangle) which supports having a gradient set
+ on it for display.
\sa GradientStop
*/
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index 4e7e0fd..2c1eb67 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -499,13 +499,10 @@ void QDeclarativeText::setVAlign(VAlignment align)
wrap if an explicit width has been set. wrapMode can be one of:
\list
- \o Text.NoWrap - no wrapping will be performed.
- \o Text.WordWrap - wrapping is done on word boundaries. If the text cannot be
- word-wrapped to the specified width it will be partially drawn outside of the item's bounds.
- If this is undesirable then enable clipping on the item (Item::clip).
- \o Text.WrapAnywhere - Text can be wrapped at any point on a line, even if it occurs in the middle of a word.
- \o Text.WrapAtWordBoundaryOrAnywhere - If possible, wrapping occurs at a word boundary; otherwise it
- will occur at the appropriate point on the line, even in the middle of a word.
+ \o Text.NoWrap - no wrapping will be performed. If the text contains insufficient newlines, then implicitWidth will exceed a set width.
+ \o Text.WordWrap - wrapping is done on word boundaries only. If a word is too long, implicitWidth will exceed a set width.
+ \o Text.WrapAnywhere - wrapping is done at any point on a line, even if it occurs in the middle of a word.
+ \o Text.Wrap - if possible, wrapping occurs at a word boundary; otherwise it will occur at the appropriate point on the line, even in the middle of a word.
\endlist
The default is Text.NoWrap.
@@ -715,6 +712,7 @@ void QDeclarativeTextPrivate::updateSize()
QFontMetrics fm(font);
if (text.isEmpty()) {
q->setImplicitHeight(fm.height());
+ emit q->paintedSizeChanged();
return;
}
@@ -753,11 +751,36 @@ void QDeclarativeTextPrivate::updateSize()
//### need to comfirm cost of always setting these for richText
q->setImplicitWidth(richText ? (int)doc->idealWidth() : size.width());
q->setImplicitHeight(richText ? (int)doc->size().height() : size.height());
+ emit q->paintedSizeChanged();
} else {
dirty = true;
}
}
+/*!
+ \qmlproperty real Text::paintedWidth
+
+ Returns the width of the text, including width past the width
+ which is covered due to insufficient wrapping if WrapMode is set.
+*/
+qreal QDeclarativeText::paintedWidth() const
+{
+ return implicitWidth();
+}
+
+/*!
+ \qmlproperty real Text::paintedHeight
+
+ Returns the height of the text, including height past the height
+ which is covered due to there being more text than fits in the set height.
+*/
+qreal QDeclarativeText::paintedHeight() const
+{
+ return implicitHeight();
+}
+
+
+
// ### text layout handling should be profiled and optimized as needed
// what about QStackTextEngine engine(tmp, d->font.font()); QTextLayout textLayout(&engine);
diff --git a/src/declarative/graphicsitems/qdeclarativetext_p.h b/src/declarative/graphicsitems/qdeclarativetext_p.h
index 00ce126..db21140 100644
--- a/src/declarative/graphicsitems/qdeclarativetext_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetext_p.h
@@ -71,6 +71,8 @@ class Q_DECLARATIVE_EXPORT QDeclarativeText : public QDeclarativeItem
Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged)
Q_PROPERTY(TextFormat textFormat READ textFormat WRITE setTextFormat NOTIFY textFormatChanged)
Q_PROPERTY(TextElideMode elide READ elideMode WRITE setElideMode NOTIFY elideModeChanged) //### elideMode?
+ Q_PROPERTY(qreal paintedWidth READ paintedWidth NOTIFY paintedSizeChanged)
+ Q_PROPERTY(qreal paintedHeight READ paintedHeight NOTIFY paintedSizeChanged)
public:
QDeclarativeText(QDeclarativeItem *parent=0);
@@ -98,7 +100,8 @@ public:
enum WrapMode { NoWrap = QTextOption::NoWrap,
WordWrap = QTextOption::WordWrap,
WrapAnywhere = QTextOption::WrapAnywhere,
- WrapAtWordBoundaryOrAnywhere = QTextOption::WrapAtWordBoundaryOrAnywhere
+ WrapAtWordBoundaryOrAnywhere = QTextOption::WrapAtWordBoundaryOrAnywhere, // COMPAT
+ Wrap = QTextOption::WrapAtWordBoundaryOrAnywhere
};
QString text() const;
@@ -137,6 +140,9 @@ public:
int resourcesLoading() const; // mainly for testing
+ qreal paintedWidth() const;
+ qreal paintedHeight() const;
+
Q_SIGNALS:
void textChanged(const QString &text);
void linkActivated(const QString &link);
@@ -149,6 +155,7 @@ Q_SIGNALS:
void wrapModeChanged();
void textFormatChanged(TextFormat textFormat);
void elideModeChanged(TextElideMode mode);
+ void paintedSizeChanged();
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index e34bb3d..9ccb8d2 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -61,8 +61,9 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass TextEdit QDeclarativeTextEdit
- \since 4.7
+ \since 4.7
\brief The TextEdit item allows you to add editable formatted text to a scene.
+ \inherits Item
It can display both plain and rich text. For example:
@@ -483,14 +484,13 @@ void QDeclarativeTextEdit::setVAlign(QDeclarativeTextEdit::VAlignment alignment)
The text will only wrap if an explicit width has been set.
\list
- \o TextEdit.NoWrap - no wrapping will be performed.
- \o TextEdit.WordWrap - wrapping is done on word boundaries.
- \o TextEdit.WrapAnywhere - Text can be wrapped at any point on a line, even if it occurs in the middle of a word.
- \o TextEdit.WrapAtWordBoundaryOrAnywhere - If possible, wrapping occurs at a word boundary; otherwise it
- will occur at the appropriate point on the line, even in the middle of a word.
+ \o TextEdit.NoWrap - no wrapping will be performed. If the text contains insufficient newlines, then implicitWidth will exceed a set width.
+ \o TextEdit.WordWrap - wrapping is done on word boundaries only. If a word is too long, implicitWidth will exceed a set width.
+ \o TextEdit.WrapAnywhere - wrapping is done at any point on a line, even if it occurs in the middle of a word.
+ \o TextEdit.Wrap - if possible, wrapping occurs at a word boundary; otherwise it will occur at the appropriate point on the line, even in the middle of a word.
\endlist
- The default is TextEdit.NoWrap.
+ The default is TextEdit.NoWrap. If you set a width, consider using TextEdit.Wrap.
*/
QDeclarativeTextEdit::WrapMode QDeclarativeTextEdit::wrapMode() const
{
@@ -510,6 +510,29 @@ void QDeclarativeTextEdit::setWrapMode(WrapMode mode)
}
/*!
+ \qmlproperty real TextEdit::paintedWidth
+
+ Returns the width of the text, including width past the width
+ which is covered due to insufficient wrapping if WrapMode is set.
+*/
+qreal QDeclarativeTextEdit::paintedWidth() const
+{
+ return implicitWidth();
+}
+
+/*!
+ \qmlproperty real TextEdit::paintedHeight
+
+ Returns the height of the text, including height past the height
+ which is covered due to there being more text than fits in the set height.
+*/
+qreal QDeclarativeTextEdit::paintedHeight() const
+{
+ return implicitHeight();
+}
+
+
+/*!
\qmlproperty bool TextEdit::cursorVisible
If true the text edit shows a cursor.
@@ -781,7 +804,7 @@ void QDeclarativeTextEdit::componentComplete()
}
/*!
- \qmlproperty string TextEdit::selectByMouse
+ \qmlproperty bool TextEdit::selectByMouse
Defaults to false.
@@ -939,8 +962,8 @@ Handles the given mouse \a event.
void QDeclarativeTextEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextEdit);
- bool hadFocus = hasFocus();
if (d->focusOnPress){
+ bool hadFocus = hasFocus();
QGraphicsItem *p = parentItem();//###Is there a better way to find my focus scope?
while(p) {
if (p->flags() & QGraphicsItem::ItemIsFocusScope)
@@ -948,9 +971,11 @@ void QDeclarativeTextEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
p = p->parentItem();
}
setFocus(true);
+ if (hasFocus() == hadFocus && d->showInputPanelOnFocus && !isReadOnly()) {
+ // re-open input panel on press if already focused
+ openSoftwareInputPanel();
+ }
}
- if (!hadFocus && hasFocus())
- d->clickCausedFocus = true;
if (event->type() != QEvent::GraphicsSceneMouseDoubleClick || d->selectByMouse)
d->control->processEvent(event, QPointF(0, -d->yoff));
if (!event->isAccepted())
@@ -964,11 +989,6 @@ Handles the given mouse \a event.
void QDeclarativeTextEdit::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextEdit);
- QWidget *widget = event->widget();
- if (widget && (d->control->textInteractionFlags() & Qt::TextEditable) && boundingRect().contains(event->pos()))
- qt_widget_private(widget)->handleSoftwareInputPanel(event->button(), d->clickCausedFocus);
- d->clickCausedFocus = false;
-
d->control->processEvent(event, QPointF(0, -d->yoff));
if (!event->isAccepted())
QDeclarativePaintedItem::mouseReleaseEvent(event);
@@ -1155,7 +1175,7 @@ void QDeclarativeTextEdit::updateSize()
int dy = height();
// ### assumes that if the width is set, the text will fill to edges
// ### (unless wrap is false, then clipping will occur)
- if (widthValid())
+ if (widthValid() && d->document->textWidth() != width())
d->document->setTextWidth(width());
dy -= (int)d->document->size().height();
@@ -1171,7 +1191,7 @@ void QDeclarativeTextEdit::updateSize()
//### need to comfirm cost of always setting these
int newWidth = qCeil(d->document->idealWidth());
- if (!widthValid())
+ if (!widthValid() && d->document->textWidth() != newWidth)
d->document->setTextWidth(newWidth); // ### Text does not align if width is not set (QTextDoc bug)
int cursorWidth = 1;
if(d->cursor)
@@ -1181,9 +1201,12 @@ void QDeclarativeTextEdit::updateSize()
newWidth += 3;// ### Need a better way of accounting for space between char and cursor
// ### Setting the implicitWidth triggers another updateSize(), and unless there are bindings nothing has changed.
setImplicitWidth(newWidth);
- setImplicitHeight(d->document->isEmpty() ? fm.height() : (int)d->document->size().height());
+ qreal newHeight = d->document->isEmpty() ? fm.height() : (int)d->document->size().height();
+ setImplicitHeight(newHeight);
- setContentsSize(QSize(width(), height()));
+ setContentsSize(QSize(newWidth, newHeight));
+
+ emit paintedSizeChanged();
} else {
d->dirty = true;
}
@@ -1204,4 +1227,127 @@ void QDeclarativeTextEditPrivate::updateDefaultTextOption()
document->setDefaultTextOption(opt);
}
+
+/*!
+ \qmlmethod void TextEdit::openSoftwareInputPanel()
+
+ Opens software input panels like virtual keyboards for typing, useful for
+ customizing when you want the input keyboard to be shown and hidden in
+ your application.
+
+ By default input panels are shown when TextEdit element gains focus and hidden
+ when the focus is lost. You can disable the automatic behavior by setting the
+ property showInputPanelOnFocus to false and use functions openSoftwareInputPanel()
+ and closeSoftwareInputPanel() to implement the behavior you want.
+
+ Only relevant on platforms, which provide virtual keyboards.
+
+ \code
+ import Qt 4.7
+ TextEdit {
+ id: textEdit
+ text: "Hello world!"
+ showInputPanelOnFocus: false
+ MouseArea {
+ anchors.fill: parent
+ onClicked: textEdit.openSoftwareInputPanel()
+ }
+ onFocusChanged: if (!focus) closeSoftwareInputpanel()
+ }
+ \endcode
+*/
+void QDeclarativeTextEdit::openSoftwareInputPanel()
+{
+ QEvent event(QEvent::RequestSoftwareInputPanel);
+ if (qApp) {
+ if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
+ if (view->scene() && view->scene() == scene()) {
+ QApplication::sendEvent(view, &event);
+ }
+ }
+ }
+}
+
+/*!
+ \qmlmethod void TextEdit::closeSoftwareInputPanel()
+
+ Closes a software input panel like a virtual keyboard shown on the screen, useful
+ for customizing when you want the input keyboard to be shown and hidden in
+ your application.
+
+ By default input panels are shown when TextEdit element gains focus and hidden
+ when the focus is lost. You can disable the automatic behavior by setting the
+ property showInputPanelOnFocus to false and use functions openSoftwareInputPanel()
+ and closeSoftwareInputPanel() to implement the behavior you want.
+
+ Only relevant on platforms, which provide virtual keyboards.
+
+ \code
+ import Qt 4.7
+ TextEdit {
+ id: textEdit
+ text: "Hello world!"
+ showInputPanelOnFocus: false
+ MouseArea {
+ anchors.fill: parent
+ onClicked: textEdit.openSoftwareInputPanel()
+ }
+ onFocusChanged: if (!focus) closeSoftwareInputpanel()
+ }
+ \endcode
+*/
+void QDeclarativeTextEdit::closeSoftwareInputPanel()
+{
+ QEvent event(QEvent::CloseSoftwareInputPanel);
+ if (qApp) {
+ if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
+ if (view->scene() && view->scene() == scene()) {
+ QApplication::sendEvent(view, &event);
+ }
+ }
+ }
+}
+
+/*!
+ \qmlproperty bool TextEdit::showInputPanelOnFocus
+ Whether input panels are automatically shown when TextEdit element gains
+ focus and hidden when focus is lost. By default this is set to true.
+
+ Only relevant on platforms, which provide virtual keyboards.
+*/
+bool QDeclarativeTextEdit::showInputPanelOnFocus() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->showInputPanelOnFocus;
+}
+
+void QDeclarativeTextEdit::setShowInputPanelOnFocus(bool showOnFocus)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (d->showInputPanelOnFocus == showOnFocus)
+ return;
+
+ d->showInputPanelOnFocus = showOnFocus;
+
+ emit showInputPanelOnFocusChanged(d->showInputPanelOnFocus);
+}
+
+void QDeclarativeTextEdit::focusInEvent(QFocusEvent *event)
+{
+ Q_D(const QDeclarativeTextEdit);
+ if (d->showInputPanelOnFocus && !isReadOnly() && event->reason() != Qt::ActiveWindowFocusReason) {
+ openSoftwareInputPanel();
+ }
+ QDeclarativePaintedItem::focusInEvent(event);
+}
+
+void QDeclarativeTextEdit::focusOutEvent(QFocusEvent *event)
+{
+ Q_D(const QDeclarativeTextEdit);
+ if (d->showInputPanelOnFocus && !isReadOnly()) {
+ closeSoftwareInputPanel();
+ }
+ QDeclarativePaintedItem::focusOutEvent(event);
+}
+
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
index 891b868..47174f4 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
@@ -74,6 +74,8 @@ class Q_DECLARATIVE_EXPORT QDeclarativeTextEdit : public QDeclarativePaintedItem
Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign NOTIFY horizontalAlignmentChanged)
Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign NOTIFY verticalAlignmentChanged)
Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged)
+ Q_PROPERTY(qreal paintedWidth READ paintedWidth NOTIFY paintedSizeChanged)
+ Q_PROPERTY(qreal paintedHeight READ paintedHeight NOTIFY paintedSizeChanged)
Q_PROPERTY(TextFormat textFormat READ textFormat WRITE setTextFormat NOTIFY textFormatChanged)
Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly NOTIFY readOnlyChanged)
Q_PROPERTY(bool cursorVisible READ isCursorVisible WRITE setCursorVisible NOTIFY cursorVisibleChanged)
@@ -84,6 +86,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeTextEdit : public QDeclarativePaintedItem
Q_PROPERTY(int selectionEnd READ selectionEnd WRITE setSelectionEnd NOTIFY selectionEndChanged)
Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectionChanged)
Q_PROPERTY(bool focusOnPress READ focusOnPress WRITE setFocusOnPress NOTIFY focusOnPressChanged)
+ Q_PROPERTY(bool showInputPanelOnFocus READ showInputPanelOnFocus WRITE setShowInputPanelOnFocus NOTIFY showInputPanelOnFocusChanged)
Q_PROPERTY(bool persistentSelection READ persistentSelection WRITE setPersistentSelection NOTIFY persistentSelectionChanged)
Q_PROPERTY(qreal textMargin READ textMargin WRITE setTextMargin NOTIFY textMarginChanged)
Q_PROPERTY(Qt::InputMethodHints inputMethodHints READ inputMethodHints WRITE setInputMethodHints)
@@ -113,9 +116,13 @@ public:
enum WrapMode { NoWrap = QTextOption::NoWrap,
WordWrap = QTextOption::WordWrap,
WrapAnywhere = QTextOption::WrapAnywhere,
- WrapAtWordBoundaryOrAnywhere = QTextOption::WrapAtWordBoundaryOrAnywhere
+ WrapAtWordBoundaryOrAnywhere = QTextOption::WrapAtWordBoundaryOrAnywhere, // COMPAT
+ Wrap = QTextOption::WrapAtWordBoundaryOrAnywhere
};
+ Q_INVOKABLE void openSoftwareInputPanel();
+ Q_INVOKABLE void closeSoftwareInputPanel();
+
QString text() const;
void setText(const QString &);
@@ -163,6 +170,9 @@ public:
bool focusOnPress() const;
void setFocusOnPress(bool on);
+ bool showInputPanelOnFocus() const;
+ void setShowInputPanelOnFocus(bool showOnFocus);
+
bool persistentSelection() const;
void setPersistentSelection(bool on);
@@ -185,8 +195,12 @@ public:
QVariant inputMethodQuery(Qt::InputMethodQuery property) const;
+ qreal paintedWidth() const;
+ qreal paintedHeight() const;
+
Q_SIGNALS:
void textChanged(const QString &);
+ void paintedSizeChanged();
void cursorPositionChanged();
void cursorRectangleChanged();
void selectionStartChanged();
@@ -207,6 +221,7 @@ Q_SIGNALS:
void persistentSelectionChanged(bool isPersistentSelection);
void textMarginChanged(qreal textMargin);
void selectByMouseChanged(bool selectByMouse);
+ void showInputPanelOnFocusChanged(bool showOnFocus);
public Q_SLOTS:
void selectAll();
@@ -228,6 +243,8 @@ protected:
bool event(QEvent *);
void keyPressEvent(QKeyEvent *);
void keyReleaseEvent(QKeyEvent *);
+ void focusInEvent(QFocusEvent *event);
+ void focusOutEvent(QFocusEvent *event);
// mouse filter?
void mousePressEvent(QGraphicsSceneMouseEvent *event);
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
index d96796c..8e1d630 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
@@ -70,9 +70,9 @@ public:
QDeclarativeTextEditPrivate()
: color("black"), hAlign(QDeclarativeTextEdit::AlignLeft), vAlign(QDeclarativeTextEdit::AlignTop),
imgDirty(true), dirty(false), richText(false), cursorVisible(false), focusOnPress(true),
- persistentSelection(true), clickCausedFocus(false), textMargin(0.0), lastSelectionStart(0), lastSelectionEnd(0),
- cursorComponent(0), cursor(0), format(QDeclarativeTextEdit::AutoText), document(0),
- wrapMode(QDeclarativeTextEdit::NoWrap),
+ showInputPanelOnFocus(true), persistentSelection(true), textMargin(0.0), lastSelectionStart(0),
+ lastSelectionEnd(0), cursorComponent(0), cursor(0), format(QDeclarativeTextEdit::AutoText),
+ document(0), wrapMode(QDeclarativeTextEdit::NoWrap),
selectByMouse(false),
yoff(0)
{
@@ -101,8 +101,8 @@ public:
bool richText : 1;
bool cursorVisible : 1;
bool focusOnPress : 1;
+ bool showInputPanelOnFocus : 1;
bool persistentSelection : 1;
- bool clickCausedFocus : 1;
qreal textMargin;
int lastSelectionStart;
int lastSelectionEnd;
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 2e7715f..9c70ea9 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -54,8 +54,9 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass TextInput QDeclarativeTextInput
- \since 4.7
+ \since 4.7
\brief The TextInput item allows you to add an editable line of text to a scene.
+ \inherits Item
TextInput can only display a single line of text, and can only display
plain text. However it can provide addition input constraints on the text.
@@ -885,8 +886,8 @@ void QDeclarativeTextInput::keyPressEvent(QKeyEvent* ev)
void QDeclarativeTextInput::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextInput);
- bool hadFocus = hasFocus();
if(d->focusOnPress){
+ bool hadFocus = hasFocus();
QGraphicsItem *p = parentItem();//###Is there a better way to find my focus scope?
while(p) {
if (p->flags() & QGraphicsItem::ItemIsFocusScope)
@@ -894,9 +895,11 @@ void QDeclarativeTextInput::mousePressEvent(QGraphicsSceneMouseEvent *event)
p = p->parentItem();
}
setFocus(true);
+ if (hasFocus() == hadFocus && d->showInputPanelOnFocus && !isReadOnly()) {
+ // re-open input panel on press w already focused
+ openSoftwareInputPanel();
+ }
}
- if (!hadFocus && hasFocus())
- d->clickCausedFocus = true;
bool mark = event->modifiers() & Qt::ShiftModifier;
int cursor = d->xToPos(event->pos().x());
@@ -922,10 +925,7 @@ Handles the given mouse \a event.
void QDeclarativeTextInput::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextInput);
- QWidget *widget = event->widget();
- if (widget && !d->control->isReadOnly() && boundingRect().contains(event->pos()))
- qt_widget_private(widget)->handleSoftwareInputPanel(event->button(), d->clickCausedFocus);
- d->clickCausedFocus = false;
+ d->control->processEvent(event);
if (!event->isAccepted())
QDeclarativePaintedItem::mouseReleaseEvent(event);
}
@@ -1120,7 +1120,7 @@ QString QDeclarativeTextInput::displayText() const
}
/*!
- \qmlproperty string TextInput::selectByMouse
+ \qmlproperty bool TextInput::selectByMouse
Defaults to false.
@@ -1174,6 +1174,129 @@ void QDeclarativeTextInput::moveCursorSelection(int position)
d->control->moveCursor(position, true);
}
+/*!
+ \qmlmethod void TextInput::openSoftwareInputPanel()
+
+ Opens software input panels like virtual keyboards for typing, useful for
+ customizing when you want the input keyboard to be shown and hidden in
+ your application.
+
+ By default input panels are shown when TextInput element gains focus and hidden
+ when the focus is lost. You can disable the automatic behavior by setting the
+ property showInputPanelOnFocus to false and use functions openSoftwareInputPanel()
+ and closeSoftwareInputPanel() to implement the behavior you want.
+
+ Only relevant on platforms, which provide virtual keyboards.
+
+ \code
+ import Qt 4.7
+ TextInput {
+ id: textInput
+ text: "Hello world!"
+ showInputPanelOnFocus: false
+ MouseArea {
+ anchors.fill: parent
+ onClicked: textInput.openSoftwareInputPanel()
+ }
+ onFocusChanged: if (!focus) closeSoftwareInputPanel()
+ }
+ \endcode
+*/
+void QDeclarativeTextInput::openSoftwareInputPanel()
+{
+ QEvent event(QEvent::RequestSoftwareInputPanel);
+ if (qApp) {
+ if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
+ if (view->scene() && view->scene() == scene()) {
+ QApplication::sendEvent(view, &event);
+ }
+ }
+ }
+}
+
+/*!
+ \qmlmethod void TextInput::closeSoftwareInputPanel()
+
+ Closes a software input panel like a virtual keyboard shown on the screen, useful
+ for customizing when you want the input keyboard to be shown and hidden in
+ your application.
+
+ By default input panels are shown when TextInput element gains focus and hidden
+ when the focus is lost. You can disable the automatic behavior by setting the
+ property showInputPanelOnFocus to false and use functions openSoftwareInputPanel()
+ and closeSoftwareInputPanel() to implement the behavior you want.
+
+ Only relevant on platforms, which provide virtual keyboards.
+
+ \code
+ import Qt 4.7
+ TextInput {
+ id: textInput
+ text: "Hello world!"
+ showInputPanelOnFocus: false
+ MouseArea {
+ anchors.fill: parent
+ onClicked: textInput.openSoftwareInputPanel()
+ }
+ onFocusChanged: if (!focus) closeSoftwareInputPanel()
+ }
+ \endcode
+*/
+void QDeclarativeTextInput::closeSoftwareInputPanel()
+{
+ QEvent event(QEvent::CloseSoftwareInputPanel);
+ if (qApp) {
+ QEvent event(QEvent::CloseSoftwareInputPanel);
+ if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
+ if (view->scene() && view->scene() == scene()) {
+ QApplication::sendEvent(view, &event);
+ }
+ }
+ }
+}
+
+/*!
+ \qmlproperty bool TextInput::showInputPanelOnFocus
+ Whether input panels are automatically shown when TextInput element gains
+ focus and hidden when focus is lost. By default this is set to true.
+
+ Only relevant on platforms, which provide virtual keyboards.
+*/
+bool QDeclarativeTextInput::showInputPanelOnFocus() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->showInputPanelOnFocus;
+}
+
+void QDeclarativeTextInput::setShowInputPanelOnFocus(bool showOnFocus)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->showInputPanelOnFocus == showOnFocus)
+ return;
+
+ d->showInputPanelOnFocus = showOnFocus;
+
+ emit showInputPanelOnFocusChanged(d->showInputPanelOnFocus);
+}
+
+void QDeclarativeTextInput::focusInEvent(QFocusEvent *event)
+{
+ Q_D(const QDeclarativeTextInput);
+ if (d->showInputPanelOnFocus && !isReadOnly() && event->reason() != Qt::ActiveWindowFocusReason) {
+ openSoftwareInputPanel();
+ }
+ QDeclarativePaintedItem::focusInEvent(event);
+}
+
+void QDeclarativeTextInput::focusOutEvent(QFocusEvent *event)
+{
+ Q_D(const QDeclarativeTextInput);
+ if (d->showInputPanelOnFocus && !isReadOnly()) {
+ closeSoftwareInputPanel();
+ }
+ QDeclarativePaintedItem::focusOutEvent(event);
+}
+
void QDeclarativeTextInputPrivate::init()
{
Q_Q(QDeclarativeTextInput);
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
index b2fd057..438293a 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
@@ -86,6 +86,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeTextInput : public QDeclarativePaintedIte
Q_PROPERTY(bool acceptableInput READ hasAcceptableInput NOTIFY acceptableInputChanged)
Q_PROPERTY(EchoMode echoMode READ echoMode WRITE setEchoMode NOTIFY echoModeChanged)
Q_PROPERTY(bool focusOnPress READ focusOnPress WRITE setFocusOnPress NOTIFY focusOnPressChanged)
+ Q_PROPERTY(bool showInputPanelOnFocus READ showInputPanelOnFocus WRITE setShowInputPanelOnFocus NOTIFY showInputPanelOnFocusChanged)
Q_PROPERTY(QString passwordCharacter READ passwordCharacter WRITE setPasswordCharacter NOTIFY passwordCharacterChanged)
Q_PROPERTY(QString displayText READ displayText NOTIFY displayTextChanged)
Q_PROPERTY(bool autoScroll READ autoScroll WRITE setAutoScroll NOTIFY autoScrollChanged)
@@ -112,6 +113,9 @@ public:
Q_INVOKABLE int xToPosition(int x);
Q_INVOKABLE void moveCursorSelection(int pos);
+ Q_INVOKABLE void openSoftwareInputPanel();
+ Q_INVOKABLE void closeSoftwareInputPanel();
+
QString text() const;
void setText(const QString &);
@@ -172,6 +176,9 @@ public:
bool focusOnPress() const;
void setFocusOnPress(bool);
+ bool showInputPanelOnFocus() const;
+ void setShowInputPanelOnFocus(bool showOnFocus);
+
bool autoScroll() const;
void setAutoScroll(bool);
@@ -208,6 +215,7 @@ Q_SIGNALS:
void focusOnPressChanged(bool focusOnPress);
void autoScrollChanged(bool autoScroll);
void selectByMouseChanged(bool selectByMouse);
+ void showInputPanelOnFocusChanged(bool showOnFocus);
protected:
virtual void geometryChanged(const QRectF &newGeometry,
@@ -218,6 +226,8 @@ protected:
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
void keyPressEvent(QKeyEvent* ev);
bool event(QEvent *e);
+ void focusInEvent(QFocusEvent *event);
+ void focusOutEvent(QFocusEvent *event);
public Q_SLOTS:
void selectAll();
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
index 1d8e0f7..f44d014 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
@@ -72,7 +72,7 @@ public:
color((QRgb)0), style(QDeclarativeText::Normal),
styleColor((QRgb)0), hAlign(QDeclarativeTextInput::AlignLeft),
hscroll(0), oldScroll(0), focused(false), focusOnPress(true),
- cursorVisible(false), autoScroll(true), clickCausedFocus(false),
+ showInputPanelOnFocus(true), cursorVisible(false), autoScroll(true),
selectByMouse(false)
{
}
@@ -115,9 +115,9 @@ public:
int oldScroll;
bool focused;
bool focusOnPress;
+ bool showInputPanelOnFocus;
bool cursorVisible;
bool autoScroll;
- bool clickCausedFocus;
bool selectByMouse;
};
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index 7aa17e8..2dc2d2d 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -53,6 +53,7 @@
#include "private/qdeclarativebinding_p_p.h"
#include "private/qdeclarativeglobal_p.h"
#include "private/qdeclarativescriptparser_p.h"
+#include "private/qdeclarativedebugtiming_p.h"
#include <QStack>
#include <QStringList>
@@ -693,6 +694,10 @@ QDeclarativeComponentPrivate::beginCreate(QDeclarativeContextData *context, cons
QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+ bool isRoot = !ep->inBeginCreate;
+ if (isRoot)
+ QDeclarativeDebugTiming::startRange(QDeclarativeDebugTiming::Creating);
+
QDeclarativeContextData *ctxt = new QDeclarativeContextData;
ctxt->isInternal = true;
ctxt->url = cc->url;
@@ -839,6 +844,7 @@ void QDeclarativeComponentPrivate::complete(QDeclarativeEnginePrivate *enginePri
enginePriv->erroredBindings->removeError();
}
}
+
}
}
@@ -860,6 +866,8 @@ void QDeclarativeComponentPrivate::completeCreate()
if (state.completePending) {
QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
complete(ep, &state);
+
+ QDeclarativeDebugTiming::endRange(QDeclarativeDebugTiming::Creating);
}
}
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index a7384a9..8679e76 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -153,11 +153,11 @@ void QDeclarativeEnginePrivate::defineModule()
/*!
\qmlclass Qt QDeclarativeEnginePrivate
-\brief The QML Global Qt Object
+\brief The QML global Qt object provides useful enums and functions from Qt.
-The Qt object provides useful enums and functions from Qt, for use in all QML
-files. Note that you do note create instances of this type, but instead use
-the members of the global "Qt" object.
+The Qt object provides useful enums and functions from Qt, for use in all QML files.
+
+You do not create instances of this type, but instead use the members of the global "Qt" object.
\section1 Enums
@@ -172,23 +172,23 @@ data types. This is primarily useful when setting the properties of an item
when the property has one of the following types:
\list
-\o Color
-\o Rect
-\o Point
-\o Size
-\o Vector3D
+\o \c color - use \l{Qt::rgba()}{Qt.rgba()}, \l{Qt::darker()}{Qt.darker()}, \l{Qt::lighter()}{Qt.lighter()} or \l{Qt::tint()}{Qt.tint()}
+\o \c rect - use \l{Qt::rect()}{Qt.rect()}
+\o \c point - use \l{Qt::point()}{Qt.point()}
+\o \c size - use \l{Qt::size()}{Qt.size()}
+\o \c vector3d - use \l{Qt::vector3d()}{Qt.vector3d()}
\endlist
-There are also string based constructors for these types, see \l{qdeclarativebasictypes.html}{Qml Types}.
+There are also string based constructors for these types, see \l{qdeclarativebasictypes.html}{QML Basic Types}.
\section1 Date/Time Formatters
The Qt object contains several functions for formatting dates and times.
\list
- \o \l{Qt::formatDateTime}{string Qt.formatDateTime(datetime date, variant format)
- \o \l{Qt::formatDate}{string Qt.formatDate(datetime date, variant format)
- \o \l{Qt::formatTime}{string Qt.formatTime(datetime date, variant format)
+ \o \l{Qt::formatDateTime}{string Qt.formatDateTime(datetime date, variant format)}
+ \o \l{Qt::formatDate}{string Qt.formatDate(datetime date, variant format)}
+ \o \l{Qt::formatTime}{string Qt.formatTime(datetime date, variant format)}
\endlist
The format specification is described at \l{Qt::formatDateTime}{Qt.formatDateTime}.
@@ -226,8 +226,7 @@ QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e)
/*!
\qmlmethod url Qt::resolvedUrl(url)
-This function returns \c url resolved relative to the URL of the
-caller.
+Returns \c url resolved relative to the URL of the caller.
*/
QUrl QDeclarativeScriptEngine::resolvedUrl(QScriptContext *context, const QUrl& url)
{
@@ -1035,8 +1034,11 @@ QString QDeclarativeEnginePrivate::urlToLocalFileOrQrc(const QUrl& url)
/*!
\qmlmethod object Qt::createComponent(url)
-This function takes the URL of a QML file as its only argument. It returns
-a component object which can be used to create and load that QML file.
+Returns a \l Component object created from the QML file at the specified \a url,
+or \c null if there was an error in creating the component.
+
+Call \l {Component::createObject()}{Component.createObject()} on the returned
+component to create an object instance of the component.
Here is an example. Remember that QML files that might be loaded
over the network cannot be expected to be ready immediately.
@@ -1049,17 +1051,8 @@ If you are certain the files will be local, you could simplify to:
\snippet doc/src/snippets/declarative/componentCreation.js 2
-The methods and properties of the \l {Component} element are defined in its own
-page, but when using it dynamically only two methods are usually used.
- \l {Component::createObject()}{Component.createObject()} returns the created object or \c null if there is an error.
-If there is an error, \l {Component::errorString()}{Component.errorString()} describes
-the error that occurred. Note that createObject() takes exactly one argument, which is set
-to the parent of the created object. Graphical objects without a parent will not appear
-on the scene, but if you do not wish to parent the item at this point you can safely pass
-in null.
-
-If you want to just create an arbitrary string of QML, instead of
-loading a QML file, consider the \l{Qt.createQmlObject(string qml, object parent, string filepath)}{Qt.createQmlObject()} function.
+To create a QML object from an arbitrary string of QML (instead of a file),
+use \l{Qt::createQmlObject()}{Qt.createQmlObject()}.
*/
QScriptValue QDeclarativeEnginePrivate::createComponent(QScriptContext *ctxt, QScriptEngine *engine)
@@ -1088,29 +1081,22 @@ QScriptValue QDeclarativeEnginePrivate::createComponent(QScriptContext *ctxt, QS
/*!
\qmlmethod object Qt::createQmlObject(string qml, object parent, string filepath)
-Creates a new object from the specified string of QML. It requires a
-second argument, which is the id of an existing QML object to use as
-the new object's parent. If a third argument is provided, this is used
-for error reporting as the filepath that the QML came from.
+Returns a new object created from the given \a string of QML with the specified \a parent,
+or \c null if there was an error in creating the object.
+
+If \a filepath is specified, it will be used for error reporting for the created object.
Example (where \c targetItem is the id of an existing QML item):
\snippet doc/src/snippets/declarative/createQmlObject.qml 0
-This function is intended for use inside QML only. It is intended to behave
-similarly to eval, but for creating QML elements.
-
-Returns the created object, \c or null if there is an error. In the case of an
-error, a QtScript Error object is thrown. This object has the additional property,
-qmlErrors, which is an array of all the errors encountered when trying to execute the
-QML. Each object in the array has the members \c lineNumber, \c columnNumber, \c fileName and \c message.
+In the case of an error, a QtScript Error object is thrown. This object has an additional property,
+\c qmlErrors, which is an array of the errors encountered.
+Each object in this array has the members \c lineNumber, \c columnNumber, \c fileName and \c message.
Note that this function returns immediately, and therefore may not work if
-the QML loads new components. If you are trying to load a new component,
-for example from a QML file, consider the \l{Qt.createComponent(url file)}{Qt.createComponent()} function
-instead. 'New components' refers to external QML files that have not yet
-been loaded, and so it is safe to use \c Qt.createQmlObject() to load built-in
-components.
+the \a qml string loads new components (that is, external QML files that have not yet been loaded).
+If this is the case, consider using \l{Qt::createComponent()}{Qt.createComponent()} instead.
*/
QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QScriptEngine *engine)
@@ -1217,7 +1203,7 @@ QScriptValue QDeclarativeEnginePrivate::isQtObject(QScriptContext *ctxt, QScript
/*!
\qmlmethod Qt::vector3d(real x, real y, real z)
-This function returns a Vector3D with the specified \c x, \c y and \c z.
+Returns a Vector3D with the specified \c x, \c y and \c z.
*/
QScriptValue QDeclarativeEnginePrivate::vector3d(QScriptContext *ctxt, QScriptEngine *engine)
{
@@ -1231,7 +1217,7 @@ QScriptValue QDeclarativeEnginePrivate::vector3d(QScriptContext *ctxt, QScriptEn
/*!
\qmlmethod string Qt::formatDate(datetime date, variant format)
-This function returns the string representation of \c date, formatted according to \c format.
+Returns the string representation of \c date, formatted according to \c format.
*/
QScriptValue QDeclarativeEnginePrivate::formatDate(QScriptContext*ctxt, QScriptEngine*engine)
{
@@ -1256,7 +1242,7 @@ QScriptValue QDeclarativeEnginePrivate::formatDate(QScriptContext*ctxt, QScriptE
/*!
\qmlmethod string Qt::formatTime(datetime time, variant format)
-This function returns the string representation of \c time, formatted according to \c format.
+Returns the string representation of \c time, formatted according to \c format.
See Qt::formatDateTime for how to define \c format.
*/
@@ -1283,7 +1269,7 @@ QScriptValue QDeclarativeEnginePrivate::formatTime(QScriptContext*ctxt, QScriptE
/*!
\qmlmethod string Qt::formatDateTime(datetime dateTime, variant format)
-This function returns the string representation of \c dateTime, formatted according to \c format.
+Returns the string representation of \c dateTime, formatted according to \c format.
\c format for the date/time formatting functions is be specified as follows.
@@ -1374,7 +1360,7 @@ QScriptValue QDeclarativeEnginePrivate::formatDateTime(QScriptContext*ctxt, QScr
/*!
\qmlmethod color Qt::rgba(real red, real green, real blue, real alpha)
-This function returns a Color with the specified \c red, \c green, \c blue and \c alpha components.
+Returns a Color with the specified \c red, \c green, \c blue and \c alpha components.
All components should be in the range 0-1 inclusive.
*/
QScriptValue QDeclarativeEnginePrivate::rgba(QScriptContext *ctxt, QScriptEngine *engine)
@@ -1402,7 +1388,7 @@ QScriptValue QDeclarativeEnginePrivate::rgba(QScriptContext *ctxt, QScriptEngine
/*!
\qmlmethod color Qt::hsla(real hue, real saturation, real lightness, real alpha)
-This function returns a Color with the specified \c hue, \c saturation, \c lightness and \c alpha components.
+Returns a Color with the specified \c hue, \c saturation, \c lightness and \c alpha components.
All components should be in the range 0-1 inclusive.
*/
QScriptValue QDeclarativeEnginePrivate::hsla(QScriptContext *ctxt, QScriptEngine *engine)
@@ -1430,7 +1416,7 @@ QScriptValue QDeclarativeEnginePrivate::hsla(QScriptContext *ctxt, QScriptEngine
/*!
\qmlmethod rect Qt::rect(int x, int y, int width, int height)
-This function returns a Rect with the top-left corner at \c x, \c y and the specified \c width and \c height.
+Returns a Rect with the top-left corner at \c x, \c y and the specified \c width and \c height.
*/
QScriptValue QDeclarativeEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine *engine)
{
@@ -1450,7 +1436,7 @@ QScriptValue QDeclarativeEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine
/*!
\qmlmethod point Qt::point(int x, int y)
-This function returns a Point with the specified \c x and \c y coordinates.
+Returns a Point with the specified \c x and \c y coordinates.
*/
QScriptValue QDeclarativeEnginePrivate::point(QScriptContext *ctxt, QScriptEngine *engine)
{
@@ -1463,7 +1449,7 @@ QScriptValue QDeclarativeEnginePrivate::point(QScriptContext *ctxt, QScriptEngin
/*!
\qmlmethod Qt::size(int width, int height)
-This function returns as Size with the specified \c width and \c height.
+Returns a Size with the specified \c width and \c height.
*/
QScriptValue QDeclarativeEnginePrivate::size(QScriptContext *ctxt, QScriptEngine *engine)
{
@@ -1476,7 +1462,7 @@ QScriptValue QDeclarativeEnginePrivate::size(QScriptContext *ctxt, QScriptEngine
/*!
\qmlmethod color Qt::lighter(color baseColor, real factor)
-This function returns a color lighter than \c baseColor by the \c factor provided.
+Returns a color lighter than \c baseColor by the \c factor provided.
If the factor is greater than 1.0, this functions returns a lighter color.
Setting factor to 1.5 returns a color that is 50% brighter. If the factor is less than 1.0,
@@ -1512,7 +1498,7 @@ QScriptValue QDeclarativeEnginePrivate::lighter(QScriptContext *ctxt, QScriptEng
/*!
\qmlmethod color Qt::darker(color baseColor, real factor)
-This function returns a color darker than \c baseColor by the \c factor provided.
+Returns a color darker than \c baseColor by the \c factor provided.
If the factor is greater than 1.0, this function returns a darker color.
Setting factor to 3.0 returns a color that has one-third the brightness.
@@ -1549,7 +1535,7 @@ QScriptValue QDeclarativeEnginePrivate::darker(QScriptContext *ctxt, QScriptEngi
/*!
\qmlmethod bool Qt::openUrlExternally(url target)
-This function attempts to open the specified \c target url in an external application, based on the user's desktop preferences. It will return true if it succeeds, and false otherwise.
+Attempts to open the specified \c target url in an external application, based on the user's desktop preferences. Returns true if it succeeds, and false otherwise.
*/
QScriptValue QDeclarativeEnginePrivate::desktopOpenUrl(QScriptContext *ctxt, QScriptEngine *e)
{
@@ -1564,7 +1550,7 @@ QScriptValue QDeclarativeEnginePrivate::desktopOpenUrl(QScriptContext *ctxt, QSc
/*!
\qmlmethod list<string> Qt::fontFamilies()
-This function returns a list of the font families available to the application.
+Returns a list of the font families available to the application.
*/
QScriptValue QDeclarativeEnginePrivate::fontFamilies(QScriptContext *ctxt, QScriptEngine *e)
@@ -1579,7 +1565,7 @@ QScriptValue QDeclarativeEnginePrivate::fontFamilies(QScriptContext *ctxt, QScri
/*!
\qmlmethod string Qt::md5(data)
-This function returns a hex string of the md5 hash of \c data.
+Returns a hex string of the md5 hash of \c data.
*/
QScriptValue QDeclarativeEnginePrivate::md5(QScriptContext *ctxt, QScriptEngine *)
{
diff --git a/src/declarative/qml/qdeclarativeworkerscript.cpp b/src/declarative/qml/qdeclarativeworkerscript.cpp
index 1550351..2ca030e 100644
--- a/src/declarative/qml/qdeclarativeworkerscript.cpp
+++ b/src/declarative/qml/qdeclarativeworkerscript.cpp
@@ -295,6 +295,7 @@ void QDeclarativeWorkerScriptEnginePrivate::processLoad(int id, const QUrl &url)
ctxt->pushScope(urlContext);
ctxt->pushScope(activation);
ctxt->setActivationObject(activation);
+ QDeclarativeScriptParser::extractPragmas(script);
workerEngine->baseUrl = url;
workerEngine->evaluate(script);
diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp
index e68ef94..d2dab76 100644
--- a/src/declarative/util/qdeclarativeview.cpp
+++ b/src/declarative/util/qdeclarativeview.cpp
@@ -45,11 +45,11 @@
#include <qdeclarativeitem.h>
#include <qdeclarativeengine.h>
#include <qdeclarativecontext.h>
-#include <qdeclarativedebug_p.h>
-#include <qdeclarativedebugservice_p.h>
#include <qdeclarativeglobal_p.h>
#include <qdeclarativeguard_p.h>
+#include <private/qdeclarativedebugtiming_p.h>
+
#include <qscriptvalueiterator.h>
#include <qdebug.h>
#include <qtimer.h>
@@ -66,66 +66,64 @@
#include <QtCore/qabstractanimation.h>
#include <private/qgraphicsview_p.h>
#include <private/qdeclarativeitem_p.h>
+#include <private/qabstractanimation_p.h>
#include <private/qdeclarativeitemchangelistener_p.h>
QT_BEGIN_NAMESPACE
DEFINE_BOOL_CONFIG_OPTION(frameRateDebug, QML_SHOW_FRAMERATE)
-class QDeclarativeViewDebugServer;
-class FrameBreakAnimation : public QAbstractAnimation
+class QDeclarativeScene : public QGraphicsScene
{
public:
- FrameBreakAnimation(QDeclarativeViewDebugServer *s)
- : QAbstractAnimation((QObject*)s), server(s)
- {
- start();
- }
+ QDeclarativeScene();
- virtual int duration() const { return -1; }
- virtual void updateCurrentTime(int msecs);
+protected:
+ virtual void keyPressEvent(QKeyEvent *);
+ virtual void keyReleaseEvent(QKeyEvent *);
-private:
- QDeclarativeViewDebugServer *server;
+ virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *);
+ virtual void mousePressEvent(QGraphicsSceneMouseEvent *);
+ virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *);
};
-class QDeclarativeViewDebugServer : public QDeclarativeDebugService
+QDeclarativeScene::QDeclarativeScene()
{
-public:
- QDeclarativeViewDebugServer(QObject *parent = 0) : QDeclarativeDebugService(QLatin1String("CanvasFrameRate"), parent), breaks(0)
- {
- timer.start();
- new FrameBreakAnimation(this);
- }
+}
- void addTiming(int pe, int tbf)
- {
- if (!isEnabled())
- return;
-
- bool isFrameBreak = breaks > 1;
- breaks = 0;
- int e = timer.elapsed();
- QByteArray data;
- QDataStream ds(&data, QIODevice::WriteOnly);
- ds << (int)pe << (int)tbf << (int)e
- << (bool)isFrameBreak;
- sendMessage(data);
- }
+void QDeclarativeScene::keyPressEvent(QKeyEvent *e)
+{
+ QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::Key);
- void frameBreak() { ++breaks; }
+ QGraphicsScene::keyPressEvent(e);
+}
-private:
- QTime timer;
- int breaks;
-};
+void QDeclarativeScene::keyReleaseEvent(QKeyEvent *e)
+{
+ QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::Key);
-Q_GLOBAL_STATIC(QDeclarativeViewDebugServer, qfxViewDebugServer);
+ QGraphicsScene::keyReleaseEvent(e);
+}
-void FrameBreakAnimation::updateCurrentTime(int msecs)
+void QDeclarativeScene::mouseMoveEvent(QGraphicsSceneMouseEvent *e)
{
- Q_UNUSED(msecs);
- server->frameBreak();
+ QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::Mouse);
+
+ QGraphicsScene::mouseMoveEvent(e);
+}
+
+void QDeclarativeScene::mousePressEvent(QGraphicsSceneMouseEvent *e)
+{
+ QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::Mouse);
+
+ QGraphicsScene::mousePressEvent(e);
+}
+
+void QDeclarativeScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *e)
+{
+ QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::Mouse);
+
+ QGraphicsScene::mouseReleaseEvent(e);
}
class QDeclarativeViewPrivate : public QGraphicsViewPrivate, public QDeclarativeItemChangeListener
@@ -152,11 +150,11 @@ public:
QBasicTimer resizetimer;
QDeclarativeView::ResizeMode resizeMode;
- QTime frameTimer;
+ QElapsedTimer frameTimer;
void init();
- QGraphicsScene scene;
+ QDeclarativeScene scene;
};
void QDeclarativeViewPrivate::execute()
@@ -676,12 +674,18 @@ void QDeclarativeView::resizeEvent(QResizeEvent *e)
void QDeclarativeView::paintEvent(QPaintEvent *event)
{
Q_D(QDeclarativeView);
+
+ QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::FramePaint);
+ QDeclarativeDebugTiming::startRange(QDeclarativeDebugTiming::Painting);
+
int time = 0;
- if (frameRateDebug() || QDeclarativeViewDebugServer::isDebuggingEnabled())
+ if (frameRateDebug())
time = d->frameTimer.restart();
+
QGraphicsView::paintEvent(event);
- if (QDeclarativeViewDebugServer::isDebuggingEnabled())
- qfxViewDebugServer()->addTiming(d->frameTimer.elapsed(), time);
+
+ QDeclarativeDebugTiming::endRange(QDeclarativeDebugTiming::Painting);
+
if (frameRateDebug())
qDebug() << "paintEvent:" << d->frameTimer.elapsed() << "time since last frame:" << time;
}
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
index d08e37b..4f9355b 100644
--- a/src/declarative/util/qdeclarativexmllistmodel.cpp
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -80,7 +80,11 @@ typedef QPair<int, int> QDeclarativeXmlListRange;
/*!
\qmlproperty string XmlRole::name
- The name for the role. This name is used to access the model data for this role from Qml.
+
+ The name for the role. This name is used to access the model data for this role.
+
+ For example, the following model has a role named "title", which can be accessed
+ from the view's delegate:
\qml
XmlListModel {
@@ -91,19 +95,27 @@ typedef QPair<int, int> QDeclarativeXmlListRange;
ListView {
model: xmlModel
- Text { text: title }
+ delegate: Text { text: title }
}
\endqml
*/
/*!
\qmlproperty string XmlRole::query
- The relative XPath query for this role. The query should not start with a '/' (i.e. it must be
- relative).
+ The relative XPath expression query for this role. The query must be relative; it cannot start
+ with a '/'.
- \qml
- XmlRole { name: "title"; query: "title/string()" }
- \endqml
+ For example, if there is an XML document like this:
+
+ \quotefile doc/src/snippets/declarative/xmlrole.xml
+
+ Here are some valid XPath expressions for XmlRole queries on this document:
+
+ \snippet doc/src/snippets/declarative/xmlrole.qml 0
+ \dots 4
+ \snippet doc/src/snippets/declarative/xmlrole.qml 1
+
+ See the \l{http://www.w3.org/TR/xpath20/}{W3C XPath 2.0 specification} for more information.
*/
/*!
@@ -521,9 +533,12 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla
\endqml
The \l {XmlListModel::query}{query} value of "/rss/channel/item" specifies that the XmlListModel should generate
- a model item for each \c <item> in the XML document. The XmlRole objects define the
+ a model item for each \c <item> in the XML document.
+
+ The XmlRole objects define the
model item attributes; here, each model item will have \c title and \c pubDate
attributes that match the \c title and \c pubDate values of its corresponding \c <item>.
+ (See \l XmlRole::query for more examples of valid XPath expressions for XmlRole.)
The model could be used in a ListView, like this:
@@ -559,8 +574,6 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla
If multiple key roles are specified, the model only adds and reload items
with a combined value of all key roles that is not already present in
the model.
-
- \sa {declarative/xml/xmldata}{XML data example}
*/
QDeclarativeXmlListModel::QDeclarativeXmlListModel(QObject *parent)
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index db6c4c5..36d21a6 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -1275,14 +1275,14 @@ void QGraphicsItemPrivate::childrenBoundingRectHelper(QTransform *x, QRectF *rec
QTransform matrix = childd->transformToParent();
if (x)
matrix *= *x;
- *rect |= matrix.mapRect(child->boundingRect());
+ *rect |= matrix.mapRect(child->d_ptr->effectiveBoundingRect());
if (!childd->children.isEmpty())
childd->childrenBoundingRectHelper(&matrix, rect);
} else {
if (x)
- *rect |= x->mapRect(child->boundingRect());
+ *rect |= x->mapRect(child->d_ptr->effectiveBoundingRect());
else
- *rect |= child->boundingRect();
+ *rect |= child->d_ptr->effectiveBoundingRect();
if (!childd->children.isEmpty())
childd->childrenBoundingRectHelper(x, rect);
}
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index ae0abf9..22c3f92 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -4889,6 +4889,24 @@ void QGraphicsScenePrivate::markDirty(QGraphicsItem *item, const QRectF &rect, b
if (updateAll)
return;
+ if (removingItemFromScene && !ignoreOpacity && !item->d_ptr->ignoreOpacity) {
+ // If any of the item's ancestors ignore opacity, it means that the opacity
+ // was set to 0 (and the update request has not yet been processed). That
+ // also means that we have to ignore the opacity for the item itself; otherwise
+ // things like: parent->setOpacity(0); scene->removeItem(child) won't work.
+ // Note that we only do this when removing items from the scene. In all other
+ // cases the ignoreOpacity bit propagates properly in processDirtyItems, but
+ // since the item is removed immediately it won't be processed there.
+ QGraphicsItem *p = item->d_ptr->parent;
+ while (p) {
+ if (p->d_ptr->ignoreOpacity) {
+ item->d_ptr->ignoreOpacity = true;
+ break;
+ }
+ p = p->d_ptr->parent;
+ }
+ }
+
if (item->d_ptr->discardUpdateRequest(/*ignoreVisibleBit=*/force,
/*ignoreDirtyBit=*/removingItemFromScene || invalidateChildren,
/*ignoreOpacity=*/ignoreOpacity)) {
diff --git a/src/gui/itemviews/qitemdelegate.cpp b/src/gui/itemviews/qitemdelegate.cpp
index d5f6fd2..9bbfc23 100644
--- a/src/gui/itemviews/qitemdelegate.cpp
+++ b/src/gui/itemviews/qitemdelegate.cpp
@@ -667,7 +667,6 @@ void QItemDelegate::drawDisplay(QPainter *painter, const QStyleOptionViewItem &o
{
Q_D(const QItemDelegate);
- QPen pen = painter->pen();
QPalette::ColorGroup cg = option.state & QStyle::State_Enabled
? QPalette::Normal : QPalette::Disabled;
if (cg == QPalette::Normal && !(option.state & QStyle::State_Active))
diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp
index b12cd45..f9b6b94 100644
--- a/src/gui/itemviews/qsortfilterproxymodel.cpp
+++ b/src/gui/itemviews/qsortfilterproxymodel.cpp
@@ -2392,7 +2392,7 @@ bool QSortFilterProxyModel::lessThan(const QModelIndex &left, const QModelIndex
QVariant r = (right.model() ? right.model()->data(right, d->sort_role) : QVariant());
switch (l.userType()) {
case QVariant::Invalid:
- return (r.type() == QVariant::Invalid);
+ return (r.type() != QVariant::Invalid);
case QVariant::Int:
return l.toInt() < r.toInt();
case QVariant::UInt:
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 57c4c99..0d11b27 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -666,7 +666,8 @@ void QApplicationPrivate::process_cmdline()
\o -geometry \e geometry, sets the client geometry of the first window
that is shown.
\o -fn or \c -font \e font, defines the application font. The font
- should be specified using an X logical font description.
+ should be specified using an X logical font description. Note that
+ this option is ignored when Qt is built with fontconfig support enabled.
\o -bg or \c -background \e color, sets the default background color
and an application palette (light and dark shades are calculated).
\o -fg or \c -foreground \e color, sets the default foreground color.
diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp
index 2b12317..92dd0a1 100644
--- a/src/gui/kernel/qdnd_x11.cpp
+++ b/src/gui/kernel/qdnd_x11.cpp
@@ -64,6 +64,7 @@
#include "qtextcodec.h"
#include "qdnd_p.h"
+#include "qapplication_p.h"
#include "qt_x11_p.h"
#include "qx11info_x11.h"
@@ -1111,7 +1112,20 @@ void qt_xdnd_send_leave()
waiting_for_status = false;
}
-
+// TODO: remove and use QApplication::currentKeyboardModifiers() in Qt 4.8.
+static Qt::KeyboardModifiers currentKeyboardModifiers()
+{
+ Window root;
+ Window child;
+ int root_x, root_y, win_x, win_y;
+ uint keybstate;
+ for (int i = 0; i < ScreenCount(X11->display); ++i) {
+ if (XQueryPointer(X11->display, QX11Info::appRootWindow(i), &root, &child,
+ &root_x, &root_y, &win_x, &win_y, &keybstate))
+ return X11->translateModifiers(keybstate & 0x00ff);
+ }
+ return 0;
+}
void QX11Data::xdndHandleDrop(QWidget *, const XEvent * xe, bool passive)
{
@@ -1159,6 +1173,11 @@ void QX11Data::xdndHandleDrop(QWidget *, const XEvent * xe, bool passive)
if (!dropData)
dropData = (manager->object) ? manager->dragPrivate()->data : manager->dropData;
+ // Drop coming from another app? Update keyboard modifiers.
+ if (!qt_xdnd_dragging) {
+ QApplicationPrivate::modifier_buttons = currentKeyboardModifiers();
+ }
+
QDropEvent de(qt_xdnd_current_position, possible_actions, dropData,
QApplication::mouseButtons(), QApplication::keyboardModifiers());
QApplication::sendEvent(qt_xdnd_current_widget, &de);
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index 6c8d561..9d6dc9a 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -325,6 +325,7 @@ void QGtkStyle::polish(QApplication *app)
qt_filedialog_save_filename_hook = &QGtkStylePrivate::saveFilename;
qt_filedialog_open_filenames_hook = &QGtkStylePrivate::openFilenames;
qt_filedialog_existing_directory_hook = &QGtkStylePrivate::openDirectory;
+ qApp->installEventFilter(&d->filter);
}
}
}
@@ -345,6 +346,7 @@ void QGtkStyle::unpolish(QApplication *app)
qt_filedialog_save_filename_hook = 0;
qt_filedialog_open_filenames_hook = 0;
qt_filedialog_existing_directory_hook = 0;
+ qApp->removeEventFilter(&d->filter);
}
}
diff --git a/src/gui/styles/qgtkstyle_p.cpp b/src/gui/styles/qgtkstyle_p.cpp
index 3c6a1ef..4ed0fab 100644
--- a/src/gui/styles/qgtkstyle_p.cpp
+++ b/src/gui/styles/qgtkstyle_p.cpp
@@ -285,8 +285,6 @@ void QGtkStylePrivate::init()
{
resolveGtk();
initGtkWidgets();
- if (isThemeAvailable())
- qApp->installEventFilter(&filter);
}
GtkWidget* QGtkStylePrivate::gtkWidget(const QHashableLatin1Literal &path)
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index c7817c6..84c1d96 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -363,23 +363,24 @@ QSizeF QStaticText::size() const
}
QStaticTextPrivate::QStaticTextPrivate()
- : textWidth(-1.0), items(0), itemCount(0), glyphPool(0), positionPool(0),
+ : textWidth(-1.0), items(0), itemCount(0), glyphPool(0), positionPool(0), charPool(0),
needsRelayout(true), useBackendOptimizations(false), textFormat(Qt::AutoText)
{
}
QStaticTextPrivate::QStaticTextPrivate(const QStaticTextPrivate &other)
: text(other.text), font(other.font), textWidth(other.textWidth), matrix(other.matrix),
- items(0), itemCount(0), glyphPool(0), positionPool(0), needsRelayout(true),
+ items(0), itemCount(0), glyphPool(0), positionPool(0), charPool(0), needsRelayout(true),
useBackendOptimizations(other.useBackendOptimizations), textFormat(other.textFormat)
{
}
QStaticTextPrivate::~QStaticTextPrivate()
{
- delete[] items;
+ delete[] items;
delete[] glyphPool;
delete[] positionPool;
+ delete[] charPool;
}
QStaticTextPrivate *QStaticTextPrivate::get(const QStaticText *q)
@@ -395,15 +396,8 @@ namespace {
class DrawTextItemRecorder: public QPaintEngine
{
public:
- DrawTextItemRecorder(int expectedItemCount, QStaticTextItem *items,
- int expectedGlyphCount, QFixedPoint *positionPool, glyph_t *glyphPool)
- : m_items(items),
- m_itemCount(0), m_glyphCount(0),
- m_expectedItemCount(expectedItemCount),
- m_expectedGlyphCount(expectedGlyphCount),
- m_glyphPool(glyphPool),
- m_positionPool(positionPool),
- m_dirtyPen(false)
+ DrawTextItemRecorder(bool useBackendOptimizations, int numChars)
+ : m_dirtyPen(false), m_useBackendOptimizations(useBackendOptimizations)
{
}
@@ -415,26 +409,19 @@ namespace {
virtual void drawTextItem(const QPointF &position, const QTextItem &textItem)
{
- const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem);
-
- m_itemCount++;
- m_glyphCount += ti.glyphs.numGlyphs;
- if (m_items == 0)
- return;
-
- Q_ASSERT(m_itemCount <= m_expectedItemCount);
- Q_ASSERT(m_glyphCount <= m_expectedGlyphCount);
-
- QStaticTextItem *currentItem = (m_items + (m_itemCount - 1));
- currentItem->fontEngine = ti.fontEngine;
- currentItem->font = ti.font();
- currentItem->chars = ti.chars;
- currentItem->numChars = ti.num_chars;
- currentItem->numGlyphs = ti.glyphs.numGlyphs;
- currentItem->glyphs = m_glyphPool;
- currentItem->glyphPositions = m_positionPool;
+ const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem);
+
+ QStaticTextItem currentItem;
+ currentItem.fontEngine = ti.fontEngine;
+ currentItem.font = ti.font();
+ currentItem.charOffset = m_chars.size();
+ currentItem.numChars = ti.num_chars;
+ currentItem.numGlyphs = ti.glyphs.numGlyphs;
+ currentItem.glyphOffset = m_glyphs.size(); // Store offset into glyph pool
+ currentItem.positionOffset = m_glyphs.size(); // Offset into position pool
+ currentItem.useBackendOptimizations = m_useBackendOptimizations;
if (m_dirtyPen)
- currentItem->color = state->pen().color();
+ currentItem.color = state->pen().color();
QTransform matrix = state->transform();
matrix.translate(position.x(), position.y());
@@ -447,13 +434,21 @@ namespace {
Q_ASSERT(size == ti.glyphs.numGlyphs);
Q_ASSERT(size == positions.size());
- memmove(currentItem->glyphs, glyphs.constData(), sizeof(glyph_t) * size);
- memmove(currentItem->glyphPositions, positions.constData(), sizeof(QFixedPoint) * size);
+ m_glyphs.resize(m_glyphs.size() + size);
+ m_positions.resize(m_glyphs.size());
+ m_chars.resize(m_chars.size() + ti.num_chars);
- m_glyphPool += size;
- m_positionPool += size;
- }
+ glyph_t *glyphsDestination = m_glyphs.data() + currentItem.glyphOffset;
+ qMemCopy(glyphsDestination, glyphs.constData(), sizeof(glyph_t) * currentItem.numGlyphs);
+ QFixedPoint *positionsDestination = m_positions.data() + currentItem.positionOffset;
+ qMemCopy(positionsDestination, positions.constData(), sizeof(QFixedPoint) * currentItem.numGlyphs);
+
+ QChar *charsDestination = m_chars.data() + currentItem.charOffset;
+ qMemCopy(charsDestination, ti.chars, sizeof(QChar) * currentItem.numChars);
+
+ m_items.append(currentItem);
+ }
virtual bool begin(QPaintDevice *) { return true; }
virtual bool end() { return true; }
@@ -463,38 +458,42 @@ namespace {
return User;
}
- int itemCount() const
+ QVector<QStaticTextItem> items() const
{
- return m_itemCount;
+ return m_items;
}
- int glyphCount() const
+ QVector<QFixedPoint> positions() const
{
- return m_glyphCount;
+ return m_positions;
}
- private:
- QStaticTextItem *m_items;
- int m_itemCount;
- int m_glyphCount;
- int m_expectedItemCount;
- int m_expectedGlyphCount;
+ QVector<glyph_t> glyphs() const
+ {
+ return m_glyphs;
+ }
+
+ QVector<QChar> chars() const
+ {
+ return m_chars;
+ }
- glyph_t *m_glyphPool;
- QFixedPoint *m_positionPool;
+ private:
+ QVector<QStaticTextItem> m_items;
+ QVector<QFixedPoint> m_positions;
+ QVector<glyph_t> m_glyphs;
+ QVector<QChar> m_chars;
bool m_dirtyPen;
+ bool m_useBackendOptimizations;
};
class DrawTextItemDevice: public QPaintDevice
{
public:
- DrawTextItemDevice(int expectedItemCount = -1, QStaticTextItem *items = 0,
- int expectedGlyphCount = -1, QFixedPoint *positionPool = 0,
- glyph_t *glyphPool = 0)
+ DrawTextItemDevice(bool useBackendOptimizations, int numChars)
{
- m_paintEngine = new DrawTextItemRecorder(expectedItemCount, items,
- expectedGlyphCount, positionPool, glyphPool);
+ m_paintEngine = new DrawTextItemRecorder(useBackendOptimizations, numChars);
}
~DrawTextItemDevice()
@@ -538,14 +537,24 @@ namespace {
return m_paintEngine;
}
- int itemCount() const
+ QVector<glyph_t> glyphs() const
{
- return m_paintEngine->itemCount();
+ return m_paintEngine->glyphs();
}
- int glyphCount() const
+ QVector<QFixedPoint> positions() const
{
- return m_paintEngine->glyphCount();
+ return m_paintEngine->positions();
+ }
+
+ QVector<QStaticTextItem> items() const
+ {
+ return m_paintEngine->items();
+ }
+
+ QVector<QChar> chars() const
+ {
+ return m_paintEngine->chars();
}
private:
@@ -616,42 +625,42 @@ void QStaticTextPrivate::init()
delete[] items;
delete[] glyphPool;
delete[] positionPool;
+ delete[] charPool;
position = QPointF(0, 0);
- // Draw once to count number of items and glyphs, so that we can use as little memory
- // as possible to store the data
- DrawTextItemDevice counterDevice;
+ DrawTextItemDevice device(useBackendOptimizations, text.size());
{
- QPainter painter(&counterDevice);
+ QPainter painter(&device);
painter.setFont(font);
painter.setTransform(matrix);
paintText(QPointF(0, 0), &painter);
-
}
- itemCount = counterDevice.itemCount();
+ QVector<QStaticTextItem> deviceItems = device.items();
+ QVector<QFixedPoint> positions = device.positions();
+ QVector<glyph_t> glyphs = device.glyphs();
+ QVector<QChar> chars = device.chars();
+
+ itemCount = deviceItems.size();
items = new QStaticTextItem[itemCount];
- if (useBackendOptimizations) {
- for (int i=0; i<itemCount; ++i)
- items[i].useBackendOptimizations = true;
- }
+ glyphPool = new glyph_t[glyphs.size()];
+ qMemCopy(glyphPool, glyphs.constData(), glyphs.size() * sizeof(glyph_t));
+ positionPool = new QFixedPoint[positions.size()];
+ qMemCopy(positionPool, positions.constData(), positions.size() * sizeof(QFixedPoint));
- int glyphCount = counterDevice.glyphCount();
- glyphPool = new glyph_t[glyphCount];
- positionPool = new QFixedPoint[glyphCount];
+ charPool = new QChar[chars.size()];
+ qMemCopy(charPool, chars.constData(), chars.size() * sizeof(QChar));
- // Draw again to actually record the items and glyphs
- DrawTextItemDevice recorderDevice(itemCount, items, glyphCount, positionPool, glyphPool);
- {
- QPainter painter(&recorderDevice);
- painter.setFont(font);
- painter.setTransform(matrix);
+ for (int i=0; i<itemCount; ++i) {
+ items[i] = deviceItems.at(i);
- paintText(QPointF(0, 0), &painter);
+ items[i].glyphs = glyphPool + items[i].glyphOffset;
+ items[i].glyphPositions = positionPool + items[i].positionOffset;
+ items[i].chars = charPool + items[i].charOffset;
}
needsRelayout = false;
diff --git a/src/gui/text/qstatictext_p.h b/src/gui/text/qstatictext_p.h
index f017ed1..2ab5579 100644
--- a/src/gui/text/qstatictext_p.h
+++ b/src/gui/text/qstatictext_p.h
@@ -88,9 +88,18 @@ public:
userData = newUserData;
}
- QFixedPoint *glyphPositions; // 8 bytes per glyph
- glyph_t *glyphs; // 4 bytes per glyph
- const QChar *chars; // 2 bytes per glyph
+ union {
+ QFixedPoint *glyphPositions; // 8 bytes per glyph
+ int positionOffset;
+ };
+ union {
+ glyph_t *glyphs; // 4 bytes per glyph
+ int glyphOffset;
+ };
+ union {
+ QChar *chars; // 2 bytes per glyph
+ int charOffset;
+ };
// =================
// 14 bytes per glyph
@@ -134,14 +143,16 @@ public:
QTransform matrix; // 80 bytes per text
QStaticTextItem *items; // 4 bytes per text
int itemCount; // 4 bytes per text
+
glyph_t *glyphPool; // 4 bytes per text
QFixedPoint *positionPool; // 4 bytes per text
+ QChar *charPool; // 4 bytes per text
unsigned char needsRelayout : 1;
unsigned char useBackendOptimizations : 1; // 1 byte per text
unsigned char textFormat : 2;
// ================
- // 163 bytes per text
+ // 167 bytes per text
static QStaticTextPrivate *get(const QStaticText *q);
};
diff --git a/src/imports/gestures/gestures.pro b/src/imports/gestures/gestures.pro
index f55c00e..4ef7931 100644
--- a/src/imports/gestures/gestures.pro
+++ b/src/imports/gestures/gestures.pro
@@ -1,4 +1,4 @@
-TARGET = gesturesqmlplugin
+TARGET = qmlgesturesplugin
TARGETPATH = Qt/labs/gestures
include(../qimportbase.pri)
@@ -17,7 +17,7 @@ symbian:{
load(data_caging_paths)
include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
- importFiles.sources = gesturesqmlplugin.dll qmldir
+ importFiles.sources = qmlgesturesplugin.dll qmldir
importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH
DEPLOYMENT = importFiles
diff --git a/src/imports/gestures/plugin.cpp b/src/imports/gestures/plugin.cpp
index b8a9751..11f2392 100644
--- a/src/imports/gestures/plugin.cpp
+++ b/src/imports/gestures/plugin.cpp
@@ -61,5 +61,5 @@ QT_END_NAMESPACE
#include "plugin.moc"
-Q_EXPORT_PLUGIN2(gesturesqmlplugin, QT_PREPEND_NAMESPACE(GestureAreaQmlPlugin));
+Q_EXPORT_PLUGIN2(qmlgesturesplugin, QT_PREPEND_NAMESPACE(GestureAreaQmlPlugin));
diff --git a/src/imports/gestures/qmldir b/src/imports/gestures/qmldir
index 9d9d587..2a31920 100644
--- a/src/imports/gestures/qmldir
+++ b/src/imports/gestures/qmldir
@@ -1 +1 @@
-plugin gesturesqmlplugin
+plugin qmlgesturesplugin
diff --git a/src/imports/particles/particles.cpp b/src/imports/particles/particles.cpp
index ae3f318..ca2b060 100644
--- a/src/imports/particles/particles.cpp
+++ b/src/imports/particles/particles.cpp
@@ -65,5 +65,5 @@ QT_END_NAMESPACE
#include "particles.moc"
-Q_EXPORT_PLUGIN2(particlesqmlmodule, QT_PREPEND_NAMESPACE(QParticlesQmlModule));
+Q_EXPORT_PLUGIN2(qmlparticlesplugin, QT_PREPEND_NAMESPACE(QParticlesQmlModule));
diff --git a/src/imports/particles/particles.pro b/src/imports/particles/particles.pro
index 79ac543..9fd4db5 100644
--- a/src/imports/particles/particles.pro
+++ b/src/imports/particles/particles.pro
@@ -1,4 +1,4 @@
-TARGET = particles
+TARGET = qmlparticlesplugin
TARGETPATH = Qt/labs/particles
include(../qimportbase.pri)
@@ -21,7 +21,7 @@ symbian:{
load(data_caging_paths)
include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
- importFiles.sources = particles.dll qmldir
+ importFiles.sources = qmlparticlesplugin.dll qmldir
importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH
DEPLOYMENT = importFiles
diff --git a/src/imports/particles/qmldir b/src/imports/particles/qmldir
index 15456bb..aeebd2c 100644
--- a/src/imports/particles/qmldir
+++ b/src/imports/particles/qmldir
@@ -1 +1 @@
-plugin particles
+plugin qmlparticlesplugin
diff --git a/src/imports/webkit/plugin.cpp b/src/imports/webkit/plugin.cpp
index e3d73ec..c8e56ba 100644
--- a/src/imports/webkit/plugin.cpp
+++ b/src/imports/webkit/plugin.cpp
@@ -63,5 +63,5 @@ QT_END_NAMESPACE
#include "plugin.moc"
-Q_EXPORT_PLUGIN2(webkitqmlplugin, QT_PREPEND_NAMESPACE(WebKitQmlPlugin));
+Q_EXPORT_PLUGIN2(qmlwebkitplugin, QT_PREPEND_NAMESPACE(WebKitQmlPlugin));
diff --git a/src/imports/webkit/qdeclarativewebview.cpp b/src/imports/webkit/qdeclarativewebview.cpp
index 36a25f6..050e2b7 100644
--- a/src/imports/webkit/qdeclarativewebview.cpp
+++ b/src/imports/webkit/qdeclarativewebview.cpp
@@ -150,6 +150,9 @@ public:
The item includes no scrolling, scaling,
toolbars, etc., those must be implemented around WebView. See the WebBrowser example
for a demonstration of this.
+
+ When this item has keyboard focus, all keyboard input will be sent directly to the
+ web page within.
*/
/*!
@@ -701,20 +704,12 @@ void QDeclarativeWebView::hoverMoveEvent (QGraphicsSceneHoverEvent * event)
QDeclarativeItem::hoverMoveEvent(event);
}
-bool QDeclarativeWebView::sceneEvent(QEvent *event)
-{
- if (event->type() == QEvent::KeyPress) {
- QKeyEvent *k = static_cast<QKeyEvent *>(event);
- if (k->key() == Qt::Key_Tab || k->key() == Qt::Key_Backtab) {
- if (!(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier))) { //### Add MetaModifier?
- page()->event(event);
- if (event->isAccepted())
- return true;
- }
- }
- }
+bool QDeclarativeWebView::sceneEvent(QEvent *event)
+{
+ if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease)//Key events go to the page
+ return page()->event(event);
return QDeclarativeItem::sceneEvent(event);
-}
+}
/*!
diff --git a/src/imports/webkit/qmldir b/src/imports/webkit/qmldir
index 258aa2c..dcfdd06 100644
--- a/src/imports/webkit/qmldir
+++ b/src/imports/webkit/qmldir
@@ -1 +1 @@
-plugin webkitqmlplugin
+plugin qmlwebkitplugin
diff --git a/src/imports/webkit/webkit.pro b/src/imports/webkit/webkit.pro
index 77cbc4d..7b2ac66 100644
--- a/src/imports/webkit/webkit.pro
+++ b/src/imports/webkit/webkit.pro
@@ -1,4 +1,4 @@
-TARGET = webkitqmlplugin
+TARGET = qmlwebkitplugin
TARGETPATH = org/webkit
include(../qimportbase.pri)
@@ -18,7 +18,7 @@ symbian:{
load(data_caging_paths)
include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
- importFiles.sources = webkitqmlplugin.dll qmldir
+ importFiles.sources = qmlwebkitplugin.dll qmldir
importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH
DEPLOYMENT = importFiles
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 4461358..5758b25 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1401,7 +1401,7 @@ void QGL2PaintEngineEx::drawTextItem(const QPointF &p, const QTextItem &textItem
{
QStaticTextItem staticTextItem;
- staticTextItem.chars = ti.chars;
+ staticTextItem.chars = const_cast<QChar *>(ti.chars);
staticTextItem.fontEngine = ti.fontEngine;
staticTextItem.glyphs = glyphs.data();
staticTextItem.numChars = ti.num_chars;
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp
index 28d37bc..12c487d 100644
--- a/src/opengl/qpaintengine_opengl.cpp
+++ b/src/opengl/qpaintengine_opengl.cpp
@@ -4999,7 +4999,7 @@ void QOpenGLPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte
{
QStaticTextItem staticTextItem;
- staticTextItem.chars = ti.chars;
+ staticTextItem.chars = const_cast<QChar *>(ti.chars);
staticTextItem.fontEngine = ti.fontEngine;
staticTextItem.glyphs = glyphs.data();
staticTextItem.numChars = ti.num_chars;
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index 80366d1..f704432 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
@@ -91,6 +91,7 @@ void QDirectFBPixmapData::resize(int width, int height)
setSerialNumber(++global_ser_no);
}
+#ifdef QT_DIRECTFB_OPAQUE_DETECTION
// mostly duplicated from qimage.cpp (QImageData::checkForAlphaPixels)
static bool checkForAlphaPixels(const QImage &img)
{
@@ -160,12 +161,16 @@ static bool checkForAlphaPixels(const QImage &img)
return false;
}
+#endif // QT_DIRECTFB_OPAQUE_DETECTION
-bool QDirectFBPixmapData::hasAlphaChannel(const QImage &img)
+bool QDirectFBPixmapData::hasAlphaChannel(const QImage &img, Qt::ImageConversionFlags flags)
{
-#ifndef QT_NO_DIRECTFB_OPAQUE_DETECTION
- return checkForAlphaPixels(img);
+ if (img.depth() == 1)
+ return true;
+#ifdef QT_DIRECTFB_OPAQUE_DETECTION
+ return ((flags & Qt::NoOpaqueDetection) ? img.hasAlphaChannel() : checkForAlphaPixels(img));
#else
+ Q_UNUSED(flags);
return img.hasAlphaChannel();
#endif
}
@@ -287,19 +292,9 @@ bool QDirectFBPixmapData::fromDataBufferDescription(const DFBDataBufferDescripti
#endif
-void QDirectFBPixmapData::fromImage(const QImage &img,
- Qt::ImageConversionFlags flags)
+void QDirectFBPixmapData::fromImage(const QImage &img, Qt::ImageConversionFlags flags)
{
- if (img.depth() == 1) {
- alpha = true;
-#ifndef QT_NO_DIRECTFB_OPAQUE_DETECTION
- } else if (flags & Qt::NoOpaqueDetection || QDirectFBPixmapData::hasAlphaChannel(img)) {
- alpha = true;
-#else
- } else if (img.hasAlphaChannel()) {
- alpha = true;
-#endif
- }
+ alpha = QDirectFBPixmapData::hasAlphaChannel(img, flags);
imageFormat = alpha ? screen->alphaPixmapFormat() : screen->pixelFormat();
QImage image;
if ((flags & ~Qt::NoOpaqueDetection) != Qt::AutoColor) {
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h
index da6edc6..343b26e 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h
@@ -86,8 +86,8 @@ public:
virtual int metric(QPaintDevice::PaintDeviceMetric m) const { return QDirectFBPaintDevice::metric(m); }
inline QImage::Format pixelFormat() const { return imageFormat; }
- static bool hasAlphaChannel(const QImage &img);
inline bool hasAlphaChannel() const { return alpha; }
+ static bool hasAlphaChannel(const QImage &img, Qt::ImageConversionFlags flags = Qt::AutoColor);
private:
#ifdef QT_DIRECTFB_IMAGEPROVIDER
bool fromDataBufferDescription(const DFBDataBufferDescription &dataBuffer);
diff --git a/src/script/api/qscriptcontext.cpp b/src/script/api/qscriptcontext.cpp
index 639af80..3f08e74 100644
--- a/src/script/api/qscriptcontext.cpp
+++ b/src/script/api/qscriptcontext.cpp
@@ -742,6 +742,7 @@ void QScriptContext::pushScope(const QScriptValue &object)
*/
QScriptValue QScriptContext::popScope()
{
+ activationObject(); //ensure the creation of the normal scope for native context
JSC::CallFrame *frame = QScriptEnginePrivate::frameForContext(this);
JSC::ScopeChainNode *scope = frame->scopeChain();
Q_ASSERT(scope != 0);
diff --git a/src/src.pro b/src/src.pro
index 7574796..5436c4a 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -157,24 +157,24 @@ for(subname, SRC_SUBDIRS) {
SUB_TEMPLATE = $$list($$fromfile($$subpro, TEMPLATE))
!isEqual(subname, src_tools_bootstrap):if(isEqual($$SUB_TEMPLATE, lib) | isEqual($$SUB_TEMPLATE, subdirs) | isEqual(subname, src_tools_idc) | isEqual(subname, src_tools_uic3)):!separate_debug_info {
#debug
- eval(debug-$${subtarget}.depends = $${subdir}\$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS)
- eval(debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) debug))
+ debug-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS
+ debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) debug)
EXTRA_DEBUG_TARGETS += debug-$${subtarget}
QMAKE_EXTRA_TARGETS += debug-$${subtarget}
#release
- eval(release-$${subtarget}.depends = $${subdir}\$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS)
- eval(release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) release))
+ release-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS
+ release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) release)
EXTRA_RELEASE_TARGETS += release-$${subtarget}
QMAKE_EXTRA_TARGETS += release-$${subtarget}
} else { #do not have a real debug target/release
#debug
- eval(debug-$${subtarget}.depends = $${subdir}\$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS)
- eval(debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first))
+ debug-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS
+ debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first)
EXTRA_DEBUG_TARGETS += debug-$${subtarget}
QMAKE_EXTRA_TARGETS += debug-$${subtarget}
#release
- eval(release-$${subtarget}.depends = $${subdir}\$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS)
- eval(release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first))
+ release-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS
+ release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first)
EXTRA_RELEASE_TARGETS += release-$${subtarget}
QMAKE_EXTRA_TARGETS += release-$${subtarget}
}
diff --git a/src/tools/tools.pro b/src/tools/tools.pro
index 1ecb944..4736d09 100644
--- a/src/tools/tools.pro
+++ b/src/tools/tools.pro
@@ -45,24 +45,24 @@ EXTRA_RELEASE_TARGETS =
SUB_TEMPLATE = $$list($$fromfile($$subpro, TEMPLATE))
!isEqual(subname, src_tools_bootstrap):if(isEqual($$SUB_TEMPLATE, lib) | isEqual($$SUB_TEMPLATE, subdirs) | isEqual(subname, src_tools_idc) | isEqual(subname, src_tools_uic3)):!separate_debug_info {
#debug
- eval(debug-$${subtarget}.depends = $${subdir}\$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS)
- eval(debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) debug))
+ debug-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS
+ debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) debug)
EXTRA_DEBUG_TARGETS += debug-$${subtarget}
QMAKE_EXTRA_TARGETS += debug-$${subtarget}
#release
- eval(release-$${subtarget}.depends = $${subdir}\$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS)
- eval(release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) release))
+ release-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS
+ release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) release)
EXTRA_RELEASE_TARGETS += release-$${subtarget}
QMAKE_EXTRA_TARGETS += release-$${subtarget}
} else { #do not have a real debug target/release
#debug
- eval(debug-$${subtarget}.depends = $${subdir}\$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS)
- eval(debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first))
+ debug-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS
+ debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first)
EXTRA_DEBUG_TARGETS += debug-$${subtarget}
QMAKE_EXTRA_TARGETS += debug-$${subtarget}
#release
- eval(release-$${subtarget}.depends = $${subdir}\$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS)
- eval(release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first))
+ release-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS
+ release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first)
EXTRA_RELEASE_TARGETS += release-$${subtarget}
QMAKE_EXTRA_TARGETS += release-$${subtarget}
}