summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@nokia.com>2010-05-28 13:17:48 (GMT)
committerMartin Smith <martin.smith@nokia.com>2010-05-28 13:17:48 (GMT)
commit19fc2c24f02ecef0c9a466d5351aa44ceb973bf3 (patch)
tree63e64d36f718517e558317276a0e9804e9889640 /src
parentb0b4ca6547807fc602176c1ad262f15f6858116a (diff)
parent71425f24893fecb15cd4d01e6dc3d391051e9d6b (diff)
downloadQt-19fc2c24f02ecef0c9a466d5351aa44ceb973bf3.zip
Qt-19fc2c24f02ecef0c9a466d5351aa44ceb973bf3.tar.gz
Qt-19fc2c24f02ecef0c9a466d5351aa44ceb973bf3.tar.bz2
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
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/corelib/tools/qlocale_symbian.cpp3
-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/qdeclarativeflickable.cpp19
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable_p.h5
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp15
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview_p.h1
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview_p_p.h24
-rw-r--r--src/declarative/graphicsitems/qdeclarativerectangle.cpp4
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp8
-rw-r--r--src/declarative/util/qdeclarativeview.cpp98
-rw-r--r--src/gui/itemviews/qitemdelegate.cpp1
-rw-r--r--src/gui/kernel/qapplication.cpp3
-rw-r--r--src/gui/styles/qgtkstyle.cpp2
-rw-r--r--src/gui/styles/qgtkstyle_p.cpp2
-rw-r--r--src/imports/webkit/qdeclarativewebview.cpp21
-rw-r--r--src/script/api/qscriptcontext.cpp1
-rw-r--r--src/src.pro16
-rw-r--r--src/tools/tools.pro16
23 files changed, 361 insertions, 124 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/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/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/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 560d586..1dde510 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -1026,24 +1026,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 +1060,6 @@ void QDeclarativeFlickable::setBoundsBehavior(BoundsBehavior b)
return;
d->boundsBehavior = b;
emit boundsBehaviorChanged();
- emit overShootChanged();
}
/*!
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/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index 207cc25..3a69f44 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);
}
@@ -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..3abb2f4 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,8 +90,7 @@ public:
{
}
- void init()
- {
+ void init() {
Q_Q(QDeclarativePathView);
offset = 0;
q->setAcceptedMouseButtons(Qt::LeftButton);
@@ -99,6 +99,21 @@ public:
q->connect(&tl, SIGNAL(updated()), q, SLOT(ticked()));
}
+ 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);
void releaseItem(QDeclarativeItem *item);
QDeclarativePathViewAttached *attached(QDeclarativeItem *item);
@@ -138,6 +153,7 @@ public:
bool haveHighlightRange : 1;
bool autoHighlight : 1;
bool highlightUp : 1;
+ bool layoutScheduled : 1;
QTime lastPosTime;
QPointF lastPos;
qreal dragMargin;
diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
index 4f7a722..301ca00 100644
--- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
@@ -116,6 +116,10 @@ void QDeclarativeGradientStop::updateGradient()
\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/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/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp
index b7ce9c9..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:
- QElapsedTimer 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
@@ -156,7 +154,7 @@ public:
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/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/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/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/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/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}
}