summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-04-20 13:24:42 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-04-20 13:24:42 (GMT)
commite1ffbc04131dc6f76fa76821c297d08162e4b1ee (patch)
tree3759931edbad1f7dfbcdc11dc05cb0c161cf1073
parent55b84a03e33b87e44b2e65ed1c02f93aa553c323 (diff)
parent5184d55d434296710041812976656ed6825447ec (diff)
downloadQt-e1ffbc04131dc6f76fa76821c297d08162e4b1ee.zip
Qt-e1ffbc04131dc6f76fa76821c297d08162e4b1ee.tar.gz
Qt-e1ffbc04131dc6f76fa76821c297d08162e4b1ee.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: QDeclarativeDebug: Fix endless loop for property with SCRITABLE false Fix Symbian/Linux compilation breakage in plugins/qmltooling Make QMLViewer startup animation stop after a while Fix excessive scrolling in TextInput with mid string pre-edit text.
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp16
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea_p.h3
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea_p_p.h17
-rw-r--r--src/declarative/qml/qdeclarativeenginedebug.cpp12
-rw-r--r--src/gui/widgets/qlinecontrol.cpp2
-rw-r--r--src/plugins/qmltooling/qmldbg_ost/qostdevice.h2
-rw-r--r--tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp21
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp14
-rw-r--r--tools/qml/startup/startup.qml2
9 files changed, 80 insertions, 9 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index f5145d0..d4e7f7b 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -496,6 +496,9 @@ void QDeclarativeMouseArea::mousePressEvent(QGraphicsSceneMouseEvent *event)
d->pressAndHoldTimer.start(PressAndHoldDelay, this);
setKeepMouseGrab(d->stealMouse);
event->setAccepted(setPressed(true));
+
+ if(!event->isAccepted() && d->forwardToList.count())
+ d->forwardEvent(event);
}
}
@@ -573,6 +576,9 @@ void QDeclarativeMouseArea::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
me.setX(d->lastPos.x());
me.setY(d->lastPos.y());
emit positionChanged(&me);
+
+ if(!event->isAccepted() && d->forwardToList.count())
+ d->forwardEvent(event);
}
@@ -594,6 +600,9 @@ void QDeclarativeMouseArea::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
if (s && s->mouseGrabberItem() == this)
ungrabMouse();
setKeepMouseGrab(false);
+
+ if(!event->isAccepted() && d->forwardToList.count())
+ d->forwardEvent(event);
}
d->doubleClick = false;
}
@@ -959,4 +968,11 @@ QDeclarativeDrag *QDeclarativeMouseArea::drag()
*/
+QDeclarativeListProperty<QGraphicsObject> QDeclarativeMouseArea::forwardTo()
+{
+ Q_D(QDeclarativeMouseArea);
+ return d->forwardTo;
+}
+
+
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p.h
index 985f27e..351d4de 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea_p.h
+++ b/src/declarative/graphicsitems/qdeclarativemousearea_p.h
@@ -130,6 +130,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeMouseArea : public QDeclarativeItem
Q_PROPERTY(bool hoverEnabled READ hoverEnabled WRITE setHoverEnabled NOTIFY hoverEnabledChanged)
Q_PROPERTY(QDeclarativeDrag *drag READ drag CONSTANT) //### add flicking to QDeclarativeDrag or add a QDeclarativeFlick ???
Q_PROPERTY(bool preventStealing READ preventStealing WRITE setPreventStealing NOTIFY preventStealingChanged REVISION 1)
+ Q_PROPERTY(QDeclarativeListProperty<QGraphicsObject> forwardTo READ forwardTo);
public:
QDeclarativeMouseArea(QDeclarativeItem *parent=0);
@@ -157,6 +158,8 @@ public:
bool preventStealing() const;
void setPreventStealing(bool prevent);
+ QDeclarativeListProperty<QGraphicsObject> forwardTo();
+
Q_SIGNALS:
void hoveredChanged();
void pressedChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
index 67694fb..7248c92 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
@@ -70,6 +70,8 @@ public:
: absorb(true), hovered(false), pressed(false), longPress(false),
moved(false), stealMouse(false), doubleClick(false), preventStealing(false), drag(0)
{
+ Q_Q(QDeclarativeMouseArea);
+ forwardTo = QDeclarativeListProperty<QGraphicsObject>(q, forwardToList);
}
~QDeclarativeMouseAreaPrivate();
@@ -89,6 +91,18 @@ public:
lastModifiers = event->modifiers();
}
+ void forwardEvent(QGraphicsSceneMouseEvent* event)
+ {
+ Q_Q(QDeclarativeMouseArea);
+ for(int i=0; i < forwardToList.count(); i++){
+ event->setPos(forwardToList[i]->mapFromScene(event->scenePos()));
+ forwardToList[i]->scene()->sendEvent(forwardToList[i], event);
+ if(event->isAccepted())
+ break;
+ }
+ event->setPos(q->mapFromScene(event->scenePos()));
+ }
+
bool isPressAndHoldConnected() {
Q_Q(QDeclarativeMouseArea);
static int idx = QObjectPrivate::get(q)->signalIndex("pressAndHold(QDeclarativeMouseEvent*)");
@@ -121,6 +135,9 @@ public:
Qt::MouseButtons lastButtons;
Qt::KeyboardModifiers lastModifiers;
QBasicTimer pressAndHoldTimer;
+
+ QDeclarativeListProperty<QGraphicsObject> forwardTo;
+ QList<QGraphicsObject*> forwardToList;
};
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp
index 31fd516..b2a05c3 100644
--- a/src/declarative/qml/qdeclarativeenginedebug.cpp
+++ b/src/declarative/qml/qdeclarativeenginedebug.cpp
@@ -249,10 +249,16 @@ void QDeclarativeEngineDebugServer::buildObjectDump(QDataStream &message,
return;
}
- message << (object->metaObject()->propertyCount() + fakeProperties.count());
+ QList<int> propertyIndexes;
+ for (int ii = 0; ii < object->metaObject()->propertyCount(); ++ii) {
+ if (object->metaObject()->property(ii).isScriptable())
+ propertyIndexes << ii;
+ }
+
+ message << propertyIndexes.size() + fakeProperties.count();
- for (int ii = 0; ii < object->metaObject()->propertyCount(); ++ii)
- message << propertyData(object, ii);
+ for (int ii = 0; ii < propertyIndexes.size(); ++ii)
+ message << propertyData(object, propertyIndexes.at(ii));
for (int ii = 0; ii < fakeProperties.count(); ++ii)
message << fakeProperties[ii];
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index 5a281ad..d03e5de 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -435,7 +435,7 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event)
removeSelectedText();
}
if (!event->commitString().isEmpty()) {
- insert(event->commitString());
+ internalInsert(event->commitString());
cursorPositionChanged = true;
}
diff --git a/src/plugins/qmltooling/qmldbg_ost/qostdevice.h b/src/plugins/qmltooling/qmldbg_ost/qostdevice.h
index ba1f443..2c26ff7 100644
--- a/src/plugins/qmltooling/qmldbg_ost/qostdevice.h
+++ b/src/plugins/qmltooling/qmldbg_ost/qostdevice.h
@@ -42,7 +42,7 @@
#ifndef QOSTDEVICE_H
#define QOSTDEVICE_H
-#include <QIODevice.h>
+#include <QtCore/QIODevice>
QT_BEGIN_NAMESPACE
diff --git a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
index d01463e..69f9732 100644
--- a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
+++ b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
@@ -66,7 +66,6 @@
Q_DECLARE_METATYPE(QDeclarativeDebugWatch::State)
-
class tst_QDeclarativeDebug : public QObject
{
Q_OBJECT
@@ -118,6 +117,18 @@ private slots:
void setBindingInStates();
};
+class NonScriptProperty : public QObject {
+ Q_OBJECT
+ Q_PROPERTY(int nonScriptProp READ nonScriptProp WRITE setNonScriptProp NOTIFY nonScriptPropChanged SCRIPTABLE false)
+public:
+ int nonScriptProp() const { return 0; }
+ void setNonScriptProp(int) {}
+signals:
+ void nonScriptPropChanged();
+};
+QML_DECLARE_TYPE(NonScriptProperty)
+
+
QDeclarativeDebugObjectReference tst_QDeclarativeDebug::findRootObject(int context, bool recursive)
{
QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this);
@@ -282,6 +293,7 @@ void tst_QDeclarativeDebug::compareProperties(const QDeclarativeDebugPropertyRef
void tst_QDeclarativeDebug::initTestCase()
{
qRegisterMetaType<QDeclarativeDebugWatch::State>();
+ qmlRegisterType<NonScriptProperty>("Test", 1, 0, "NonScriptPropertyElement");
QTest::ignoreMessage(QtWarningMsg, "Qml debugging is enabled. Only use this in a safe environment!");
QDeclarativeDebugHelper::enableDebugging();
@@ -291,7 +303,8 @@ void tst_QDeclarativeDebug::initTestCase()
QList<QByteArray> qml;
qml << "import QtQuick 1.0\n"
- "Item {"
+ "import Test 1.0\n"
+ "Item {"
"id: root\n"
"width: 10; height: 20; scale: blueRect.scale;"
"Rectangle { id: blueRect; width: 500; height: 600; color: \"blue\"; }"
@@ -307,6 +320,8 @@ void tst_QDeclarativeDebug::initTestCase()
"list[0] = blueRect;\n"
"varObjList = list;\n"
"}\n"
+ "NonScriptPropertyElement {\n"
+ "}\n"
"}";
// add second component to test multiple root contexts
@@ -725,7 +740,7 @@ void tst_QDeclarativeDebug::queryObject()
// check source as defined in main()
QDeclarativeDebugFileReference source = obj.source();
QCOMPARE(source.url(), QUrl::fromLocalFile(""));
- QCOMPARE(source.lineNumber(), 2);
+ QCOMPARE(source.lineNumber(), 3);
QCOMPARE(source.columnNumber(), 1);
// generically test all properties, children and childrens' properties
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
index ef32ee3..943b1fa 100644
--- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
+++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -2285,6 +2285,20 @@ void tst_qdeclarativetextinput::preeditAutoScroll()
ic.sendPreeditText(preeditText.mid(0, 3), 1);
QCOMPARE(input.positionAt(0), 0);
QCOMPARE(input.positionAt(input.width()), 5);
+
+ ic.sendEvent(QInputMethodEvent());
+ input.setAutoScroll(true);
+ // Test committing pre-edit text at the start of the string. QTBUG-18789
+ input.setCursorPosition(0);
+ ic.sendPreeditText(input.text(), 5);
+ QCOMPARE(input.positionAt(0), 0);
+
+ QInputMethodEvent event;
+ event.setCommitString(input.text());
+ ic.sendEvent(event);
+
+ QCOMPARE(input.positionAt(0), 0);
+ QCOMPARE(input.positionAt(input.width()), 5);
}
void tst_qdeclarativetextinput::preeditMicroFocus()
diff --git a/tools/qml/startup/startup.qml b/tools/qml/startup/startup.qml
index fae7401..a216ac6 100644
--- a/tools/qml/startup/startup.qml
+++ b/tools/qml/startup/startup.qml
@@ -90,7 +90,7 @@ Rectangle {
NumberAnimation on rotation {
from: 0
to: 360
- loops: NumberAnimation.Infinite
+ loops: 3
running: true
duration: 2000
}