Skip to content

Commit 5d04822

Browse files
author
Qt Continuous Integration System
committed
Merge branch 'qt-4.8-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-4.8-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: remove exec bit ... again ... Add Korean translation QDeclarativeDebug: Fix typo in warning QDeclarativeDebug: Fix endless loop for property with SCRITABLE false Fix Symbian/Linux compilation breakage in plugins/qmltooling Build break fix for simulated QS60Style fix unititialized value use when timestamping qconfig.h Drift correction and better accuracy for repeating timers in Symbian Make QMLViewer startup animation stop after a while Fix excessive scrolling in TextInput with mid string pre-edit text.
2 parents 9220909 + 1b95c4e commit 5d04822

27 files changed

+21406
-27
lines changed

bin/syncqt

+3-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,9 @@ sub syncHeader {
335335
open HEADER, ">$header" || die "Could not open $header for writing!\n";
336336
print HEADER "#include \"$iheader_out\"\n";
337337
close HEADER;
338-
utime(time, $ts, $header) or die "$iheader, $header";
338+
if(defined($ts)) {
339+
utime(time, $ts, $header) or die "$iheader, $header";
340+
}
339341
return 1;
340342
}
341343
return 0;

src/corelib/kernel/qeventdispatcher_symbian.cpp

+22-5
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,10 @@ void QWakeUpActiveObject::RunL()
234234

235235
QTimerActiveObject::QTimerActiveObject(QEventDispatcherSymbian *dispatcher, SymbianTimerInfo *timerInfo)
236236
: QActiveObject((timerInfo->interval) ? TIMER_PRIORITY : NULLTIMER_PRIORITY , dispatcher),
237-
m_timerInfo(timerInfo)
237+
m_timerInfo(timerInfo), m_expectedTimeSinceLastEvent(0)
238238
{
239+
// start the timeout timer to ensure initialisation
240+
m_timeoutTimer.start();
239241
}
240242

241243
QTimerActiveObject::~QTimerActiveObject()
@@ -279,10 +281,23 @@ void QTimerActiveObject::StartTimer()
279281
m_rTimer.After(iStatus, MAX_SYMBIAN_TIMEOUT_MS * 1000);
280282
m_timerInfo->msLeft -= MAX_SYMBIAN_TIMEOUT_MS;
281283
} else {
282-
//HighRes gives the 1ms accuracy expected by Qt, the +1 is to ensure that
283-
//"Timers will never time out earlier than the specified timeout value"
284-
//condition is always met.
285-
m_rTimer.HighRes(iStatus, (m_timerInfo->msLeft + 1) * 1000);
284+
// this algorithm implements drift correction for repeating timers
285+
// calculate how late we are for this event
286+
int timeSinceLastEvent = m_timeoutTimer.restart();
287+
int overshoot = timeSinceLastEvent - m_expectedTimeSinceLastEvent;
288+
if (overshoot > m_timerInfo->msLeft) {
289+
// we skipped a whole timeout, restart from here
290+
overshoot = 0;
291+
}
292+
// calculate when the next event should happen
293+
int waitTime = m_timerInfo->msLeft - overshoot;
294+
m_expectedTimeSinceLastEvent = waitTime;
295+
// limit the actual ms wait time to avoid wild corrections
296+
// this will cause the real event time to slowly drift back to the expected event time
297+
// measurements show that Symbian timers always fire 1 or 2 ms late
298+
const int limit = 4;
299+
waitTime = qMax(m_timerInfo->msLeft - limit, waitTime);
300+
m_rTimer.HighRes(iStatus, waitTime * 1000);
286301
m_timerInfo->msLeft = 0;
287302
}
288303
SetActive();
@@ -329,6 +344,8 @@ void QTimerActiveObject::Start()
329344
if (!m_rTimer.Handle()) {
330345
qt_symbian_throwIfError(m_rTimer.CreateLocal());
331346
}
347+
m_timeoutTimer.start();
348+
m_expectedTimeSinceLastEvent = 0;
332349
StartTimer();
333350
} else {
334351
iStatus = KRequestPending;

src/corelib/kernel/qeventdispatcher_symbian_p.h

+2
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ class QTimerActiveObject : public QActiveObject
150150

151151
private:
152152
SymbianTimerInfo *m_timerInfo;
153+
QElapsedTimer m_timeoutTimer;
154+
int m_expectedTimeSinceLastEvent;
153155
RTimer m_rTimer;
154156
};
155157

src/declarative/debugger/qdeclarativedebugserver.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance()
202202
connection->setServer(server);
203203
connection->setPort(port, block);
204204
} else {
205-
qWarning() << QString::fromAscii("QDeclarativeDebugServer: Ignoring\"-qmljsdebugger=%1\". "
205+
qWarning() << QString::fromAscii("QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". "
206206
"Remote debugger plugin has not been found.").arg(appD->qmljsDebugArgumentsString());
207207
}
208208

src/declarative/graphicsitems/qdeclarativemousearea.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,9 @@ void QDeclarativeMouseArea::mousePressEvent(QGraphicsSceneMouseEvent *event)
496496
d->pressAndHoldTimer.start(PressAndHoldDelay, this);
497497
setKeepMouseGrab(d->stealMouse);
498498
event->setAccepted(setPressed(true));
499+
500+
if(!event->isAccepted() && d->forwardToList.count())
501+
d->forwardEvent(event);
499502
}
500503
}
501504

@@ -573,6 +576,9 @@ void QDeclarativeMouseArea::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
573576
me.setX(d->lastPos.x());
574577
me.setY(d->lastPos.y());
575578
emit positionChanged(&me);
579+
580+
if(!event->isAccepted() && d->forwardToList.count())
581+
d->forwardEvent(event);
576582
}
577583

578584

@@ -594,6 +600,9 @@ void QDeclarativeMouseArea::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
594600
if (s && s->mouseGrabberItem() == this)
595601
ungrabMouse();
596602
setKeepMouseGrab(false);
603+
604+
if(!event->isAccepted() && d->forwardToList.count())
605+
d->forwardEvent(event);
597606
}
598607
d->doubleClick = false;
599608
}
@@ -959,4 +968,11 @@ QDeclarativeDrag *QDeclarativeMouseArea::drag()
959968
960969
*/
961970

971+
QDeclarativeListProperty<QGraphicsObject> QDeclarativeMouseArea::forwardTo()
972+
{
973+
Q_D(QDeclarativeMouseArea);
974+
return d->forwardTo;
975+
}
976+
977+
962978
QT_END_NAMESPACE

src/declarative/graphicsitems/qdeclarativemousearea_p.h

+3
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeMouseArea : public QDeclarativeItem
130130
Q_PROPERTY(bool hoverEnabled READ hoverEnabled WRITE setHoverEnabled NOTIFY hoverEnabledChanged)
131131
Q_PROPERTY(QDeclarativeDrag *drag READ drag CONSTANT) //### add flicking to QDeclarativeDrag or add a QDeclarativeFlick ???
132132
Q_PROPERTY(bool preventStealing READ preventStealing WRITE setPreventStealing NOTIFY preventStealingChanged REVISION 1)
133+
Q_PROPERTY(QDeclarativeListProperty<QGraphicsObject> forwardTo READ forwardTo);
133134

134135
public:
135136
QDeclarativeMouseArea(QDeclarativeItem *parent=0);
@@ -157,6 +158,8 @@ class Q_AUTOTEST_EXPORT QDeclarativeMouseArea : public QDeclarativeItem
157158
bool preventStealing() const;
158159
void setPreventStealing(bool prevent);
159160

161+
QDeclarativeListProperty<QGraphicsObject> forwardTo();
162+
160163
Q_SIGNALS:
161164
void hoveredChanged();
162165
void pressedChanged();

src/declarative/graphicsitems/qdeclarativemousearea_p_p.h

+17
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ class QDeclarativeMouseAreaPrivate : public QDeclarativeItemPrivate
7070
: absorb(true), hovered(false), pressed(false), longPress(false),
7171
moved(false), stealMouse(false), doubleClick(false), preventStealing(false), drag(0)
7272
{
73+
Q_Q(QDeclarativeMouseArea);
74+
forwardTo = QDeclarativeListProperty<QGraphicsObject>(q, forwardToList);
7375
}
7476

7577
~QDeclarativeMouseAreaPrivate();
@@ -89,6 +91,18 @@ class QDeclarativeMouseAreaPrivate : public QDeclarativeItemPrivate
8991
lastModifiers = event->modifiers();
9092
}
9193

94+
void forwardEvent(QGraphicsSceneMouseEvent* event)
95+
{
96+
Q_Q(QDeclarativeMouseArea);
97+
for(int i=0; i < forwardToList.count(); i++){
98+
event->setPos(forwardToList[i]->mapFromScene(event->scenePos()));
99+
forwardToList[i]->scene()->sendEvent(forwardToList[i], event);
100+
if(event->isAccepted())
101+
break;
102+
}
103+
event->setPos(q->mapFromScene(event->scenePos()));
104+
}
105+
92106
bool isPressAndHoldConnected() {
93107
Q_Q(QDeclarativeMouseArea);
94108
static int idx = QObjectPrivate::get(q)->signalIndex("pressAndHold(QDeclarativeMouseEvent*)");
@@ -121,6 +135,9 @@ class QDeclarativeMouseAreaPrivate : public QDeclarativeItemPrivate
121135
Qt::MouseButtons lastButtons;
122136
Qt::KeyboardModifiers lastModifiers;
123137
QBasicTimer pressAndHoldTimer;
138+
139+
QDeclarativeListProperty<QGraphicsObject> forwardTo;
140+
QList<QGraphicsObject*> forwardToList;
124141
};
125142

126143
QT_END_NAMESPACE

src/declarative/qml/qdeclarativeenginedebug.cpp

+9-3
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,16 @@ void QDeclarativeEngineDebugServer::buildObjectDump(QDataStream &message,
249249
return;
250250
}
251251

252-
message << (object->metaObject()->propertyCount() + fakeProperties.count());
252+
QList<int> propertyIndexes;
253+
for (int ii = 0; ii < object->metaObject()->propertyCount(); ++ii) {
254+
if (object->metaObject()->property(ii).isScriptable())
255+
propertyIndexes << ii;
256+
}
257+
258+
message << propertyIndexes.size() + fakeProperties.count();
253259

254-
for (int ii = 0; ii < object->metaObject()->propertyCount(); ++ii)
255-
message << propertyData(object, ii);
260+
for (int ii = 0; ii < propertyIndexes.size(); ++ii)
261+
message << propertyData(object, propertyIndexes.at(ii));
256262

257263
for (int ii = 0; ii < fakeProperties.count(); ++ii)
258264
message << fakeProperties[ii];

src/gui/styles/qs60style.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,17 @@ bool QS60StylePrivate::isWidgetPressed(const QWidget *widget)
963963
return (widget && widget == m_pressedWidget);
964964
}
965965

966+
// Generates 1*1 white pixmap as a placeholder for real texture.
967+
// The actual theme texture is drawn in qt_s60_fill_background().
968+
QPixmap QS60StylePrivate::placeHolderTexture()
969+
{
970+
if (!m_placeHolderTexture) {
971+
m_placeHolderTexture = new QPixmap(1,1);
972+
m_placeHolderTexture->fill(Qt::green);
973+
}
974+
return *m_placeHolderTexture;
975+
}
976+
966977
/*!
967978
\class QS60Style
968979
\brief The QS60Style class provides a look and feel suitable for applications on S60.

src/gui/styles/qs60style_s60.cpp

-11
Original file line numberDiff line numberDiff line change
@@ -1432,17 +1432,6 @@ QPixmap QS60StylePrivate::backgroundTexture(bool skipCreation)
14321432
return *m_background;
14331433
}
14341434

1435-
// Generates 1*1 white pixmap as a placeholder for real texture.
1436-
// The actual theme texture is drawn in qt_s60_fill_background().
1437-
QPixmap QS60StylePrivate::placeHolderTexture()
1438-
{
1439-
if (!m_placeHolderTexture) {
1440-
m_placeHolderTexture = new QPixmap(1,1);
1441-
m_placeHolderTexture->fill(Qt::white);
1442-
}
1443-
return *m_placeHolderTexture;
1444-
}
1445-
14461435
QSize QS60StylePrivate::screenSize()
14471436
{
14481437
return QSize(S60->screenWidthInPixels, S60->screenHeightInPixels);

src/gui/widgets/qlinecontrol.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event)
435435
removeSelectedText();
436436
}
437437
if (!event->commitString().isEmpty()) {
438-
insert(event->commitString());
438+
internalInsert(event->commitString());
439439
cursorPositionChanged = true;
440440
}
441441

src/plugins/qmltooling/qmldbg_ost/qostdevice.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#ifndef QOSTDEVICE_H
4343
#define QOSTDEVICE_H
4444

45-
#include <qiodevice.h>
45+
#include <QtCore/QIODevice>
4646

4747
QT_BEGIN_NAMESPACE
4848

tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp

+18-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666

6767
Q_DECLARE_METATYPE(QDeclarativeDebugWatch::State)
6868

69-
7069
class tst_QDeclarativeDebug : public QObject
7170
{
7271
Q_OBJECT
@@ -119,6 +118,18 @@ private slots:
119118
void setBindingInStates();
120119
};
121120

121+
class NonScriptProperty : public QObject {
122+
Q_OBJECT
123+
Q_PROPERTY(int nonScriptProp READ nonScriptProp WRITE setNonScriptProp NOTIFY nonScriptPropChanged SCRIPTABLE false)
124+
public:
125+
int nonScriptProp() const { return 0; }
126+
void setNonScriptProp(int) {}
127+
signals:
128+
void nonScriptPropChanged();
129+
};
130+
QML_DECLARE_TYPE(NonScriptProperty)
131+
132+
122133
QDeclarativeDebugObjectReference tst_QDeclarativeDebug::findRootObject(int context, bool recursive)
123134
{
124135
QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this);
@@ -283,6 +294,7 @@ void tst_QDeclarativeDebug::compareProperties(const QDeclarativeDebugPropertyRef
283294
void tst_QDeclarativeDebug::initTestCase()
284295
{
285296
qRegisterMetaType<QDeclarativeDebugWatch::State>();
297+
qmlRegisterType<NonScriptProperty>("Test", 1, 0, "NonScriptPropertyElement");
286298

287299
QTest::ignoreMessage(QtWarningMsg, "Qml debugging is enabled. Only use this in a safe environment!");
288300
QDeclarativeDebugHelper::enableDebugging();
@@ -292,7 +304,8 @@ void tst_QDeclarativeDebug::initTestCase()
292304

293305
QList<QByteArray> qml;
294306
qml << "import QtQuick 1.0\n"
295-
"Item {"
307+
"import Test 1.0\n"
308+
"Item {"
296309
"id: root\n"
297310
"width: 10; height: 20; scale: blueRect.scale;"
298311
"Rectangle { id: blueRect; width: 500; height: 600; color: \"blue\"; }"
@@ -308,6 +321,8 @@ void tst_QDeclarativeDebug::initTestCase()
308321
"list[0] = blueRect;\n"
309322
"varObjList = list;\n"
310323
"}\n"
324+
"NonScriptPropertyElement {\n"
325+
"}\n"
311326
"}";
312327

313328
// add second component to test multiple root contexts
@@ -726,7 +741,7 @@ void tst_QDeclarativeDebug::queryObject()
726741
// check source as defined in main()
727742
QDeclarativeDebugFileReference source = obj.source();
728743
QCOMPARE(source.url(), QUrl::fromLocalFile(""));
729-
QCOMPARE(source.lineNumber(), 2);
744+
QCOMPARE(source.lineNumber(), 3);
730745
QCOMPARE(source.columnNumber(), 1);
731746

732747
// generically test all properties, children and childrens' properties

tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -2285,6 +2285,20 @@ void tst_qdeclarativetextinput::preeditAutoScroll()
22852285
ic.sendPreeditText(preeditText.mid(0, 3), 1);
22862286
QCOMPARE(input.positionAt(0), 0);
22872287
QCOMPARE(input.positionAt(input.width()), 5);
2288+
2289+
ic.sendEvent(QInputMethodEvent());
2290+
input.setAutoScroll(true);
2291+
// Test committing pre-edit text at the start of the string. QTBUG-18789
2292+
input.setCursorPosition(0);
2293+
ic.sendPreeditText(input.text(), 5);
2294+
QCOMPARE(input.positionAt(0), 0);
2295+
2296+
QInputMethodEvent event;
2297+
event.setCommitString(input.text());
2298+
ic.sendEvent(event);
2299+
2300+
QCOMPARE(input.positionAt(0), 0);
2301+
QCOMPARE(input.positionAt(input.width()), 5);
22882302
}
22892303

22902304
void tst_qdeclarativetextinput::preeditMicroFocus()

tools/qml/startup/startup.qml

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Rectangle {
9090
NumberAnimation on rotation {
9191
from: 0
9292
to: 360
93-
loops: NumberAnimation.Infinite
93+
loops: 3
9494
running: true
9595
duration: 2000
9696
}

translations/assistant_cs.ts

100755100644
File mode changed.

0 commit comments

Comments
 (0)