From ccba80ee3e7c13844a769e5cd2213f34842c674b Mon Sep 17 00:00:00 2001 From: Josh Faust Date: Wed, 20 Feb 2013 11:42:56 -0800 Subject: Fix headers without Qt module directory name in their includes Fixed headers to include the Qt module directory in their #include directives, e.g. instead of . QTBUG-29797 Change-Id: I6f61973deb4e48158d3eff896afd81ca4b8ae960 Reviewed-by: Gunnar Sletta --- src/quick/scenegraph/coreapi/qsggeometry.h | 2 +- src/quick/scenegraph/coreapi/qsgmaterial.h | 2 +- src/quick/scenegraph/util/qsgflatcolormaterial.h | 2 +- src/quick/scenegraph/util/qsgtexture.h | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/quick') diff --git a/src/quick/scenegraph/coreapi/qsggeometry.h b/src/quick/scenegraph/coreapi/qsggeometry.h index c9b44e86b0..cfed30cb36 100644 --- a/src/quick/scenegraph/coreapi/qsggeometry.h +++ b/src/quick/scenegraph/coreapi/qsggeometry.h @@ -44,7 +44,7 @@ #include #include -#include +#include QT_BEGIN_HEADER diff --git a/src/quick/scenegraph/coreapi/qsgmaterial.h b/src/quick/scenegraph/coreapi/qsgmaterial.h index 062311e2e3..56109d32a0 100644 --- a/src/quick/scenegraph/coreapi/qsgmaterial.h +++ b/src/quick/scenegraph/coreapi/qsgmaterial.h @@ -43,7 +43,7 @@ #define MATERIAL_H #include -#include +#include QT_BEGIN_HEADER diff --git a/src/quick/scenegraph/util/qsgflatcolormaterial.h b/src/quick/scenegraph/util/qsgflatcolormaterial.h index 97b8c14a9b..b24e5e7205 100644 --- a/src/quick/scenegraph/util/qsgflatcolormaterial.h +++ b/src/quick/scenegraph/util/qsgflatcolormaterial.h @@ -43,7 +43,7 @@ #define FLATCOLORMATERIAL_H #include -#include +#include QT_BEGIN_HEADER diff --git a/src/quick/scenegraph/util/qsgtexture.h b/src/quick/scenegraph/util/qsgtexture.h index 9d91d4e81c..4dcea63175 100644 --- a/src/quick/scenegraph/util/qsgtexture.h +++ b/src/quick/scenegraph/util/qsgtexture.h @@ -43,8 +43,8 @@ #define QSGTEXTURE_H #include -#include -#include +#include +#include QT_BEGIN_HEADER -- cgit v1.2.3 From fd9d0ea8803630c1375ab897c4df6c65eaa4fd31 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 26 Feb 2013 18:20:17 +0100 Subject: GridView: fix resetColumns() to calculate the amount of columns right Task-number: QTBUG-29822 Change-Id: I3649398f3d283bc2781daa6b3071538414653e6d Reviewed-by: Gabriel de Dietrich --- src/quick/items/qquickgridview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quick') diff --git a/src/quick/items/qquickgridview.cpp b/src/quick/items/qquickgridview.cpp index fd9ce9ffcd..c376f01c46 100644 --- a/src/quick/items/qquickgridview.cpp +++ b/src/quick/items/qquickgridview.cpp @@ -463,7 +463,7 @@ void QQuickGridViewPrivate::resetColumns() { Q_Q(QQuickGridView); qreal length = flow == QQuickGridView::FlowLeftToRight ? q->width() : q->height(); - columns = (int)qMax((length + colSize()/2) / colSize(), qreal(1.)); + columns = qMax(1, qFloor(length / colSize())); } FxViewItem *QQuickGridViewPrivate::newViewItem(int modelIndex, QQuickItem *item) -- cgit v1.2.3 From 1853d1ad33644bdbfe933a01c6df0c4840fdb9d9 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 1 Mar 2013 13:26:50 +0100 Subject: Fix TextEdit::persistentSelection docs (false by default) Change-Id: I3576e08b2bf159250a163466f1402952c7520e8b Reviewed-by: Caroline Chao --- src/quick/items/qquicktextedit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quick') diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp index d543b6bd41..d087a1b8f3 100644 --- a/src/quick/items/qquicktextedit.cpp +++ b/src/quick/items/qquicktextedit.cpp @@ -1089,7 +1089,7 @@ void QQuickTextEdit::setFocusOnPress(bool on) \qmlproperty bool QtQuick2::TextEdit::persistentSelection Whether the TextEdit should keep the selection visible when it loses active focus to another - item in the scene. By default this is set to true; + item in the scene. By default this is set to false. */ bool QQuickTextEdit::persistentSelection() const { -- cgit v1.2.3 From f07525183c2a9fd947dffd3c4503546b24d4519a Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Wed, 6 Mar 2013 18:24:19 +0100 Subject: Simplify function with early return. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic0e1a32f6c586e75fb7389ef8009e56881942cf1 Reviewed-by: Laszlo Papp Reviewed-by: Jędrzej Nowacki --- src/quick/items/qquickloader.cpp | 61 ++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 30 deletions(-) (limited to 'src/quick') diff --git a/src/quick/items/qquickloader.cpp b/src/quick/items/qquickloader.cpp index 61f9a27d3b..0434c2af41 100644 --- a/src/quick/items/qquickloader.cpp +++ b/src/quick/items/qquickloader.cpp @@ -335,41 +335,42 @@ bool QQuickLoader::active() const void QQuickLoader::setActive(bool newVal) { Q_D(QQuickLoader); - if (d->active != newVal) { - d->active = newVal; - if (newVal == true) { - if (d->loadingFromSource) { - loadFromSource(); - } else { - loadFromSourceComponent(); - } + if (d->active == newVal) + return; + + d->active = newVal; + if (newVal == true) { + if (d->loadingFromSource) { + loadFromSource(); } else { - // cancel any current incubation - if (d->incubator) { - d->incubator->clear(); - delete d->itemContext; - d->itemContext = 0; - } + loadFromSourceComponent(); + } + } else { + // cancel any current incubation + if (d->incubator) { + d->incubator->clear(); + delete d->itemContext; + d->itemContext = 0; + } - if (d->item) { - QQuickItemPrivate *p = QQuickItemPrivate::get(d->item); - p->removeItemChangeListener(d, watchedChanges); + if (d->item) { + QQuickItemPrivate *p = QQuickItemPrivate::get(d->item); + p->removeItemChangeListener(d, watchedChanges); - // We can't delete immediately because our item may have triggered - // the Loader to load a different item. - d->item->setParentItem(0); - d->item->setVisible(false); - d->item = 0; - } - if (d->object) { - d->object->deleteLater(); - d->object = 0; - emit itemChanged(); - } - emit statusChanged(); + // We can't delete immediately because our item may have triggered + // the Loader to load a different item. + d->item->setParentItem(0); + d->item->setVisible(false); + d->item = 0; + } + if (d->object) { + d->object->deleteLater(); + d->object = 0; + emit itemChanged(); } - emit activeChanged(); + emit statusChanged(); } + emit activeChanged(); } -- cgit v1.2.3 From 1f6d469df21352eedb01e265eecb0b98b0148d3a Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Tue, 5 Mar 2013 17:56:21 +1000 Subject: Improve the ordering of Flickable dragging and moving property updates. Move the contentItem after the dragging and moving properties have been updated so they return the correct values from the onContentYChanged and onContentXChanged handlers. Task-number: QTBUG-30032 Change-Id: I15716dc8eee4d9836f96362a8b49f1d0c404b0c2 Reviewed-by: Alan Alpert --- src/quick/items/qquickflickable.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/quick') diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index 3482db0dfe..9346c79847 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -1014,6 +1014,12 @@ void QQuickFlickablePrivate::handleMouseMoveEvent(QMouseEvent *event) bool prevHMoved = hMoved; bool prevVMoved = vMoved; + bool moveY = false; + bool moveX = false; + + qreal newY = 0; + qreal newX = 0; + qint64 elapsedSincePress = computeCurrentTime(event) - lastPressTime; if (q->yflick()) { qreal dy = event->localPos().y() - pressPos.y(); @@ -1021,7 +1027,7 @@ void QQuickFlickablePrivate::handleMouseMoveEvent(QMouseEvent *event) if (vData.dragStartOffset == 0) vData.dragStartOffset = dy; if (overThreshold || elapsedSincePress > 200) { - qreal newY = dy + vData.pressPos - vData.dragStartOffset; + newY = dy + vData.pressPos - vData.dragStartOffset; // Recalculate bounds in case margins have changed, but use the content // size estimate taken at the start of the drag in case the drag causes // the estimate to be altered @@ -1041,8 +1047,8 @@ void QQuickFlickablePrivate::handleMouseMoveEvent(QMouseEvent *event) } if (!rejectY && stealMouse && dy != 0.0) { clearTimeline(); - vData.move.setValue(newY); vMoved = true; + moveY = true; } if (!rejectY && overThreshold) stealY = true; @@ -1055,7 +1061,7 @@ void QQuickFlickablePrivate::handleMouseMoveEvent(QMouseEvent *event) if (hData.dragStartOffset == 0) hData.dragStartOffset = dx; if (overThreshold || elapsedSincePress > 200) { - qreal newX = dx + hData.pressPos - hData.dragStartOffset; + newX = dx + hData.pressPos - hData.dragStartOffset; const qreal minX = hData.dragMinBound + hData.startMargin; const qreal maxX = hData.dragMaxBound - hData.endMargin; if (newX > minX) @@ -1073,8 +1079,8 @@ void QQuickFlickablePrivate::handleMouseMoveEvent(QMouseEvent *event) if (!rejectX && stealMouse && dx != 0.0) { clearTimeline(); - hData.move.setValue(newX); hMoved = true; + moveX = true; } if (!rejectX && overThreshold) @@ -1102,6 +1108,11 @@ void QQuickFlickablePrivate::handleMouseMoveEvent(QMouseEvent *event) q->movementStarting(); } + if (moveY) + vData.move.setValue(newY); + if (moveX) + hData.move.setValue(newX); + qint64 currentTimestamp = computeCurrentTime(event); qreal elapsed = qreal(currentTimestamp - (lastPos.isNull() ? lastPressTime : lastPosTime)) / 1000.; if (elapsed <= 0) -- cgit v1.2.3 From c284672e5d51def2dfa63343ca84ebc9ce02aa2d Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Tue, 12 Mar 2013 12:57:39 +0100 Subject: Fixed text opacity when using Text.NativeRendering. Change-Id: I76922074c02c368f8a8a6998c478a33537e9a6e8 Reviewed-by: Gunnar Sletta --- src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quick') diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp index 6b8f9927c4..210e9f23f5 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp @@ -96,7 +96,7 @@ const char *QSGTextMaskMaterialData::fragmentShader() const { "uniform sampler2D texture; \n" "uniform lowp vec4 color; \n" "void main() { \n" - " gl_FragColor = vec4(texture2D(texture, sampleCoord).rgb, 1.0); \n" + " gl_FragColor = vec4(texture2D(texture, sampleCoord).rgb * color.a, 1.0); \n" "}"; } -- cgit v1.2.3 From 18f7c187697db224ca412e969663c5e4470cf104 Mon Sep 17 00:00:00 2001 From: Thomas Kristensen Date: Mon, 11 Mar 2013 12:54:56 +0100 Subject: Makes QSmoothedAnimation respect zero duration. In automated GUI test scenarios it often desired not to wait for animations before verifying a result, so setting the duration to zero should accomplish this, before this patch; if duration was set to zero QSmoothedAnimation would treat it as if duration was not set, and used velocity to calculate animation speed. Change-Id: Ia57f1c9ffdd2056ac7c85d1cb94dbd3835fcbb7a Reviewed-by: Andreas Aardal Hanssen --- src/quick/util/qquicksmoothedanimation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/quick') diff --git a/src/quick/util/qquicksmoothedanimation.cpp b/src/quick/util/qquicksmoothedanimation.cpp index 021ff75f03..9dd9aa2e6d 100644 --- a/src/quick/util/qquicksmoothedanimation.cpp +++ b/src/quick/util/qquicksmoothedanimation.cpp @@ -153,10 +153,10 @@ bool QSmoothedAnimation::recalc() s = (invert? -1.0: 1.0) * s; - if (userDuration > 0 && velocity > 0) { + if (userDuration >= 0 && velocity > 0) { tf = s / velocity; if (tf > (userDuration / 1000.)) tf = (userDuration / 1000.); - } else if (userDuration > 0) { + } else if (userDuration >= 0) { tf = userDuration / 1000.; } else if (velocity > 0) { tf = s / velocity; -- cgit v1.2.3