diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-05-11 22:33:11 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-05-11 22:33:11 (GMT) |
commit | 1a60fdf2a97e922e8d4dcb0158649e5b285ce066 (patch) | |
tree | ef5787ba32e367b65865984b7447f165ae2cead4 /src/declarative | |
parent | c4bb04a6154931570dee72b3a1ed34af31814d17 (diff) | |
parent | 952ab3f97a77c1f15b526df13c96602f6501f8ea (diff) | |
download | Qt-1a60fdf2a97e922e8d4dcb0158649e5b285ce066.zip Qt-1a60fdf2a97e922e8d4dcb0158649e5b285ce066.tar.gz Qt-1a60fdf2a97e922e8d4dcb0158649e5b285ce066.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeflipable.cpp | 15 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetextedit.cpp | 4 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativepropertychanges.cpp | 35 |
3 files changed, 40 insertions, 14 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeflipable.cpp b/src/declarative/graphicsitems/qdeclarativeflipable.cpp index e2fc809..d926119 100644 --- a/src/declarative/graphicsitems/qdeclarativeflipable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflipable.cpp @@ -190,12 +190,15 @@ void QDeclarativeFlipablePrivate::updateSceneTransformFromParent() QPointF p2(1, 0); QPointF p3(1, 1); - p1 = sceneTransform.map(p1); - p2 = sceneTransform.map(p2); - p3 = sceneTransform.map(p3); - - qreal cross = (p1.x() - p2.x()) * (p3.y() - p2.y()) - - (p1.y() - p2.y()) * (p3.x() - p2.x()); + QPointF scenep1 = sceneTransform.map(p1); + QPointF scenep2 = sceneTransform.map(p2); + QPointF scenep3 = sceneTransform.map(p3); + p1 = q->mapToParent(p1); + p2 = q->mapToParent(p2); + p3 = q->mapToParent(p3); + + qreal cross = (scenep1.x() - scenep2.x()) * (scenep3.y() - scenep2.y()) - + (scenep1.y() - scenep2.y()) * (scenep3.x() - scenep2.x()); wantBackYFlipped = p1.x() >= p2.x(); wantBackXFlipped = p2.y() >= p3.y(); diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index d095dbe..6d86e58 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -46,6 +46,8 @@ #include <private/qdeclarativeglobal_p.h> #include <qdeclarativeinfo.h> +#include <QtCore/qmath.h> + #include <QTextLayout> #include <QTextLine> #include <QTextDocument> @@ -1107,7 +1109,7 @@ void QDeclarativeTextEdit::updateSize() setBaselineOffset(fm.ascent() + yoff + d->textMargin); //### need to comfirm cost of always setting these - int newWidth = (int)d->document->idealWidth(); + int newWidth = qCeil(d->document->idealWidth()); d->document->setTextWidth(newWidth); // ### QTextDoc> Alignment will not work unless textWidth is set. Does Text need this line as well? int cursorWidth = 1; if(d->cursor) diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp index 6e88259..94780c4 100644 --- a/src/declarative/util/qdeclarativepropertychanges.cpp +++ b/src/declarative/util/qdeclarativepropertychanges.cpp @@ -161,15 +161,22 @@ public: QDeclarativeExpression *rewindExpression; QDeclarativeGuard<QDeclarativeExpression> ownedExpression; + virtual bool changesBindings() { return true; } + virtual void clearBindings() { + ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, 0); + } + virtual void execute(Reason) { - ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, expression); - Q_ASSERT(expression != ownedExpression); + QDeclarativePropertyPrivate::setSignalExpression(property, expression); + if (ownedExpression == expression) + ownedExpression = 0; } virtual bool isReversable() { return true; } virtual void reverse(Reason) { - ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, reverseExpression); - Q_ASSERT(reverseExpression != ownedExpression); + QDeclarativePropertyPrivate::setSignalExpression(property, reverseExpression); + if (ownedExpression == reverseExpression) + ownedExpression = 0; } virtual void saveOriginals() { @@ -177,12 +184,26 @@ public: reverseExpression = rewindExpression; } + virtual void copyOriginals(QDeclarativeActionEvent *other) + { + QDeclarativeReplaceSignalHandler *rsh = static_cast<QDeclarativeReplaceSignalHandler*>(other); + saveCurrentValues(); + if (rsh == this) + return; + reverseExpression = rsh->reverseExpression; + if (rsh->ownedExpression == reverseExpression) { + ownedExpression = rsh->ownedExpression; + rsh->ownedExpression = 0; + } + } + virtual void rewind() { - ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, rewindExpression); - Q_ASSERT(rewindExpression != ownedExpression); + QDeclarativePropertyPrivate::setSignalExpression(property, rewindExpression); + if (ownedExpression == rewindExpression) + ownedExpression = 0; } virtual void saveCurrentValues() { - rewindExpression = QDeclarativePropertyPrivate::signalExpression(property); + rewindExpression = QDeclarativePropertyPrivate::signalExpression(property); } virtual bool override(QDeclarativeActionEvent*other) { |