Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7
Browse files Browse the repository at this point in the history
Conflicts:
	src/plugins/qmltooling/qmldbg_ost/qostdevice.h
  • Loading branch information
ogoffart committed Apr 21, 2011
2 parents a334ad3 + 43bce78 commit 1b95c4e
Show file tree
Hide file tree
Showing 27 changed files with 21,406 additions and 27 deletions.
4 changes: 3 additions & 1 deletion bin/syncqt
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,9 @@ sub syncHeader {
open HEADER, ">$header" || die "Could not open $header for writing!\n";
print HEADER "#include \"$iheader_out\"\n";
close HEADER;
utime(time, $ts, $header) or die "$iheader, $header";
if(defined($ts)) {
utime(time, $ts, $header) or die "$iheader, $header";
}
return 1;
}
return 0;
Expand Down
27 changes: 22 additions & 5 deletions src/corelib/kernel/qeventdispatcher_symbian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,10 @@ void QWakeUpActiveObject::RunL()

QTimerActiveObject::QTimerActiveObject(QEventDispatcherSymbian *dispatcher, SymbianTimerInfo *timerInfo)
: QActiveObject((timerInfo->interval) ? TIMER_PRIORITY : NULLTIMER_PRIORITY , dispatcher),
m_timerInfo(timerInfo)
m_timerInfo(timerInfo), m_expectedTimeSinceLastEvent(0)
{
// start the timeout timer to ensure initialisation
m_timeoutTimer.start();
}

QTimerActiveObject::~QTimerActiveObject()
Expand Down Expand Up @@ -279,10 +281,23 @@ void QTimerActiveObject::StartTimer()
m_rTimer.After(iStatus, MAX_SYMBIAN_TIMEOUT_MS * 1000);
m_timerInfo->msLeft -= MAX_SYMBIAN_TIMEOUT_MS;
} else {
//HighRes gives the 1ms accuracy expected by Qt, the +1 is to ensure that
//"Timers will never time out earlier than the specified timeout value"
//condition is always met.
m_rTimer.HighRes(iStatus, (m_timerInfo->msLeft + 1) * 1000);
// this algorithm implements drift correction for repeating timers
// calculate how late we are for this event
int timeSinceLastEvent = m_timeoutTimer.restart();
int overshoot = timeSinceLastEvent - m_expectedTimeSinceLastEvent;
if (overshoot > m_timerInfo->msLeft) {
// we skipped a whole timeout, restart from here
overshoot = 0;
}
// calculate when the next event should happen
int waitTime = m_timerInfo->msLeft - overshoot;
m_expectedTimeSinceLastEvent = waitTime;
// limit the actual ms wait time to avoid wild corrections
// this will cause the real event time to slowly drift back to the expected event time
// measurements show that Symbian timers always fire 1 or 2 ms late
const int limit = 4;
waitTime = qMax(m_timerInfo->msLeft - limit, waitTime);
m_rTimer.HighRes(iStatus, waitTime * 1000);
m_timerInfo->msLeft = 0;
}
SetActive();
Expand Down Expand Up @@ -329,6 +344,8 @@ void QTimerActiveObject::Start()
if (!m_rTimer.Handle()) {
qt_symbian_throwIfError(m_rTimer.CreateLocal());
}
m_timeoutTimer.start();
m_expectedTimeSinceLastEvent = 0;
StartTimer();
} else {
iStatus = KRequestPending;
Expand Down
2 changes: 2 additions & 0 deletions src/corelib/kernel/qeventdispatcher_symbian_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ class QTimerActiveObject : public QActiveObject

private:
SymbianTimerInfo *m_timerInfo;
QElapsedTimer m_timeoutTimer;
int m_expectedTimeSinceLastEvent;
RTimer m_rTimer;
};

Expand Down
2 changes: 1 addition & 1 deletion src/declarative/debugger/qdeclarativedebugserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance()
connection->setServer(server);
connection->setPort(port, block);
} else {
qWarning() << QString::fromAscii("QDeclarativeDebugServer: Ignoring\"-qmljsdebugger=%1\". "
qWarning() << QString::fromAscii("QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". "
"Remote debugger plugin has not been found.").arg(appD->qmljsDebugArgumentsString());
}

Expand Down
16 changes: 16 additions & 0 deletions src/declarative/graphicsitems/qdeclarativemousearea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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);
}


Expand All @@ -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;
}
Expand Down Expand Up @@ -959,4 +968,11 @@ QDeclarativeDrag *QDeclarativeMouseArea::drag()
*/

QDeclarativeListProperty<QGraphicsObject> QDeclarativeMouseArea::forwardTo()
{
Q_D(QDeclarativeMouseArea);
return d->forwardTo;
}


QT_END_NAMESPACE
3 changes: 3 additions & 0 deletions src/declarative/graphicsitems/qdeclarativemousearea_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -157,6 +158,8 @@ class Q_AUTOTEST_EXPORT QDeclarativeMouseArea : public QDeclarativeItem
bool preventStealing() const;
void setPreventStealing(bool prevent);

QDeclarativeListProperty<QGraphicsObject> forwardTo();

Q_SIGNALS:
void hoveredChanged();
void pressedChanged();
Expand Down
17 changes: 17 additions & 0 deletions src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ class QDeclarativeMouseAreaPrivate : public QDeclarativeItemPrivate
: 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();
Expand All @@ -89,6 +91,18 @@ class QDeclarativeMouseAreaPrivate : public QDeclarativeItemPrivate
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*)");
Expand Down Expand Up @@ -121,6 +135,9 @@ class QDeclarativeMouseAreaPrivate : public QDeclarativeItemPrivate
Qt::MouseButtons lastButtons;
Qt::KeyboardModifiers lastModifiers;
QBasicTimer pressAndHoldTimer;

QDeclarativeListProperty<QGraphicsObject> forwardTo;
QList<QGraphicsObject*> forwardToList;
};

QT_END_NAMESPACE
Expand Down
12 changes: 9 additions & 3 deletions src/declarative/qml/qdeclarativeenginedebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
11 changes: 11 additions & 0 deletions src/gui/styles/qs60style.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,17 @@ bool QS60StylePrivate::isWidgetPressed(const QWidget *widget)
return (widget && widget == m_pressedWidget);
}

// Generates 1*1 white pixmap as a placeholder for real texture.
// The actual theme texture is drawn in qt_s60_fill_background().
QPixmap QS60StylePrivate::placeHolderTexture()
{
if (!m_placeHolderTexture) {
m_placeHolderTexture = new QPixmap(1,1);
m_placeHolderTexture->fill(Qt::green);
}
return *m_placeHolderTexture;
}

/*!
\class QS60Style
\brief The QS60Style class provides a look and feel suitable for applications on S60.
Expand Down
11 changes: 0 additions & 11 deletions src/gui/styles/qs60style_s60.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1432,17 +1432,6 @@ QPixmap QS60StylePrivate::backgroundTexture(bool skipCreation)
return *m_background;
}

// Generates 1*1 white pixmap as a placeholder for real texture.
// The actual theme texture is drawn in qt_s60_fill_background().
QPixmap QS60StylePrivate::placeHolderTexture()
{
if (!m_placeHolderTexture) {
m_placeHolderTexture = new QPixmap(1,1);
m_placeHolderTexture->fill(Qt::white);
}
return *m_placeHolderTexture;
}

QSize QS60StylePrivate::screenSize()
{
return QSize(S60->screenWidthInPixels, S60->screenHeightInPixels);
Expand Down
2 changes: 1 addition & 1 deletion src/gui/widgets/qlinecontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event)
removeSelectedText();
}
if (!event->commitString().isEmpty()) {
insert(event->commitString());
internalInsert(event->commitString());
cursorPositionChanged = true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/qmltooling/qmldbg_ost/qostdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#ifndef QOSTDEVICE_H
#define QOSTDEVICE_H

#include <qiodevice.h>
#include <QtCore/QIODevice>

QT_BEGIN_NAMESPACE

Expand Down
21 changes: 18 additions & 3 deletions tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@

Q_DECLARE_METATYPE(QDeclarativeDebugWatch::State)


class tst_QDeclarativeDebug : public QObject
{
Q_OBJECT
Expand Down Expand Up @@ -119,6 +118,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);
Expand Down Expand Up @@ -283,6 +294,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();
Expand All @@ -292,7 +304,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\"; }"
Expand All @@ -308,6 +321,8 @@ void tst_QDeclarativeDebug::initTestCase()
"list[0] = blueRect;\n"
"varObjList = list;\n"
"}\n"
"NonScriptPropertyElement {\n"
"}\n"
"}";

// add second component to test multiple root contexts
Expand Down Expand Up @@ -726,7 +741,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion tools/qml/startup/startup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Rectangle {
NumberAnimation on rotation {
from: 0
to: 360
loops: NumberAnimation.Infinite
loops: 3
running: true
duration: 2000
}
Expand Down
Empty file modified translations/assistant_cs.ts
100755 → 100644
Empty file.
Loading

0 comments on commit 1b95c4e

Please sign in to comment.