From 09ed33677124a81117a10f1f5a47d7fae1ef22a8 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 23 Jul 2013 11:19:33 +0200 Subject: Make buttons and tabs larger in QML examples and dialogs Task-number: QTBUG-32578 Change-Id: Ic89058abc55e5e079f44862986b2132114456147 Reviewed-by: Liang Qi --- src/imports/dialogs/qml/Button.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/imports/dialogs/qml/Button.qml b/src/imports/dialogs/qml/Button.qml index 4a0ec12cd3..26cc23a5be 100644 --- a/src/imports/dialogs/qml/Button.qml +++ b/src/imports/dialogs/qml/Button.qml @@ -49,8 +49,8 @@ Item { signal clicked property alias containsMouse: mouseArea.containsMouse property alias pressed: mouseArea.pressed - implicitHeight: buttonLabel.implicitHeight * 1.2 - implicitWidth: Math.max(Screen.logicalPixelDensity * 10, buttonLabel.implicitWidth * 1.2) + implicitHeight: Math.max(Screen.logicalPixelDensity * 7, buttonLabel.implicitHeight * 1.2) + implicitWidth: Math.max(Screen.logicalPixelDensity * 11, buttonLabel.implicitWidth * 1.3) height: implicitHeight width: implicitWidth @@ -65,7 +65,7 @@ Item { GradientStop { position: 1.0; color: Qt.darker(palette.button, 1.3) } } antialiasing: true - radius: height / 4 + radius: height / 6 border.color: Qt.darker(palette.button, 1.5) border.width: 1 } -- cgit v1.2.3 From 59170ef2f2bd58038bdefaaad26ce8f9e8ee1dfe Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 30 Jul 2013 15:02:36 +0200 Subject: QtQuick.Dialogs.ColorDialog: set current color in the QColorDialog It was a missing feature to set the current color programmatically, either before or after showing the dialog. Task-number: QTBUG-32621 Change-Id: I62a811f7c36eaab5356c5924bf3447deca55ada3 Reviewed-by: Liang Qi --- src/imports/dialogs/qquickabstractcolordialog.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/imports/dialogs/qquickabstractcolordialog.cpp b/src/imports/dialogs/qquickabstractcolordialog.cpp index 7cfd7ea692..d565352af6 100644 --- a/src/imports/dialogs/qquickabstractcolordialog.cpp +++ b/src/imports/dialogs/qquickabstractcolordialog.cpp @@ -66,6 +66,8 @@ void QQuickAbstractColorDialog::setVisible(bool v) { if (helper() && v) { m_dlgHelper->setOptions(m_options); + // Due to the fact that QColorDialogOptions doesn't have currentColor... + m_dlgHelper->setCurrentColor(m_color); } QQuickAbstractDialog::setVisible(v); } @@ -100,6 +102,9 @@ void QQuickAbstractColorDialog::setTitle(const QString &t) void QQuickAbstractColorDialog::setColor(QColor arg) { + if (m_dlgHelper) + m_dlgHelper->setCurrentColor(arg); + // m_options->setCustomColor or setStandardColor don't make sense here if (m_color != arg) { m_color = arg; emit colorChanged(); -- cgit v1.2.3 From b00a120d4d07d657f3226407cdae797395f63a16 Mon Sep 17 00:00:00 2001 From: Josh Faust Date: Thu, 1 Aug 2013 16:51:03 -0600 Subject: Fix hover event crash It was possible for a hover event to be sent to a QQuickItem that has already been scheduled to be deleted (through deleteLater()). This lead to an access on an already-freed object when the leave event is generated. This change ensures that the item is part of a scene before generating the hover enter event. Task-number: QTBUG-32771 Change-Id: I69adb6bbd0ae52c70a6bda4e6c918b7671549a4c Reviewed-by: Alan Alpert --- src/quick/items/qquickwindow.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 377228e6bf..525c3d1a0e 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -1414,6 +1414,7 @@ void QQuickWindow::mouseMoveEvent(QMouseEvent *event) bool QQuickWindowPrivate::deliverHoverEvent(QQuickItem *item, const QPointF &scenePos, const QPointF &lastScenePos, Qt::KeyboardModifiers modifiers, bool &accepted) { + Q_Q(QQuickWindow); QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item); if (itemPrivate->flags & QQuickItem::ItemClipsChildrenToShape) { @@ -1463,7 +1464,13 @@ bool QQuickWindowPrivate::deliverHoverEvent(QQuickItem *item, const QPointF &sce for (int i = startIdx; i >= 0; i--) { QQuickItem *itemToHover = itemsToHover[i]; - if (QQuickItemPrivate::get(itemToHover)->hoverEnabled) { + QQuickItemPrivate *itemToHoverPrivate = QQuickItemPrivate::get(itemToHover); + // The item may be about to be deleted or reparented to another window + // due to another hover event delivered in this function. If that is the + // case, sending a hover event here will cause a crash or other bad + // behavior when the leave event is generated. Checking + // itemToHoverPrivate->window here prevents that case. + if (itemToHoverPrivate->window == q && itemToHoverPrivate->hoverEnabled) { hoverItems.prepend(itemToHover); sendHoverEvent(QEvent::HoverEnter, itemToHover, scenePos, lastScenePos, modifiers, accepted); } -- cgit v1.2.3 From 430db1a845836e71074272727d6ab9411d24afd3 Mon Sep 17 00:00:00 2001 From: Daiwei Li Date: Fri, 9 Aug 2013 12:04:41 -0700 Subject: Unset the cursor when an Item is unparented It's possible for a cursor to get stuck if an item gets deleted. QQuickItemPrivate::derefWindow sets the cursorItem in QQuickWindowPrivate to 0, but doesn't unset the cursor. This causes the cursor to get stuck until the user hovers their mouse over an item that has a cursor set. Change-Id: I1d5d3ff13d69c76e4f8fe86b1f5b669bb714ecca Reviewed-by: Alan Alpert --- src/quick/items/qquickitem.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 5863c52e70..547b795cd8 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -2565,8 +2565,10 @@ void QQuickItemPrivate::derefWindow() if (c->mouseGrabberItem == q) c->mouseGrabberItem = 0; #ifndef QT_NO_CURSOR - if (c->cursorItem == q) + if (c->cursorItem == q) { c->cursorItem = 0; + window->unsetCursor(); + } #endif c->hoverItems.removeAll(q); if (itemNodeInstance) -- cgit v1.2.3 From 463524fac8942c5b81b6cccb6050d2b3db4ee0fa Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Thu, 15 Aug 2013 13:52:16 +0200 Subject: Make sure we propegate the filtering state to the internal texture. Change-Id: Id928cf35eba254270b29a34129eb977dab34db63 Reviewed-by: Mitch Curtis --- src/quick/items/context2d/qquickcontext2dtexture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/quick/items/context2d/qquickcontext2dtexture.cpp b/src/quick/items/context2d/qquickcontext2dtexture.cpp index 84ab5bb8fb..adba4b3059 100644 --- a/src/quick/items/context2d/qquickcontext2dtexture.cpp +++ b/src/quick/items/context2d/qquickcontext2dtexture.cpp @@ -585,8 +585,8 @@ QQuickCanvasItem::RenderTarget QQuickContext2DImageTexture::renderTarget() const void QQuickContext2DImageTexture::bind() { + imageTexture()->setFiltering(filtering()); imageTexture()->bind(); - updateBindOptions(); } bool QQuickContext2DImageTexture::updateTexture() -- cgit v1.2.3 From 97daddee7a3abde2aea7327422d9102129eb09e7 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 15 Aug 2013 15:04:01 +0200 Subject: Don't repaint the Canvas if it's just changing position. Task-number: QTBUG-33005 Change-Id: I94613c0a0e066798800e068aee7c6288fce54dbd Reviewed-by: Gunnar Sletta --- src/quick/items/context2d/qquickcanvasitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp index 8844eb91bb..7717c687f7 100644 --- a/src/quick/items/context2d/qquickcanvasitem.cpp +++ b/src/quick/items/context2d/qquickcanvasitem.cpp @@ -597,7 +597,7 @@ void QQuickCanvasItem::geometryChanged(const QRectF &newGeometry, const QRectF & emit canvasWindowChanged(); } - if (d->available) + if (d->available && newSize != oldGeometry.size()) requestPaint(); } -- cgit v1.2.3 From 290dc6caf65aeecaceb5a67b55cb33f0b059f98a Mon Sep 17 00:00:00 2001 From: Nils Jeisecke Date: Tue, 6 Aug 2013 13:58:15 +0200 Subject: Fix currentIndex in Qml itemView when assigning an empty model When assigning an empty model to e.g. a ListView after component initialization has been completed, currentIndex is now correctly set to -1. Change-Id: I540c034944009ccb8894bf84f400658ef9f0371f Task-number: QTBUG-32838 Reviewed-by: Alan Alpert --- src/quick/items/qquickitemview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp index f8f622a1b9..e19e780438 100644 --- a/src/quick/items/qquickitemview.cpp +++ b/src/quick/items/qquickitemview.cpp @@ -326,7 +326,7 @@ void QQuickItemView::setModel(const QVariant &model) d->updateSectionCriteria(); d->refill(); d->currentIndex = -1; - setCurrentIndex(0); + setCurrentIndex(d->model->count() > 0 ? 0 : -1); d->updateViewport(); if (d->transitioner && d->transitioner->populateTransition) { -- cgit v1.2.3 From 180180d19545665efbf0f939778845a44cb92003 Mon Sep 17 00:00:00 2001 From: Alan Alpert <416365416c@gmail.com> Date: Wed, 14 Aug 2013 15:06:50 -0700 Subject: Doc fix Grammar and word choice Change-Id: If736f1d7a6f6396101924c9357c5235605b80b43 Reviewed-by: Jerome Pasion --- src/qml/qml/qqmllist.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/qml/qml/qqmllist.cpp b/src/qml/qml/qqmllist.cpp index 91c9bc2416..d172c9a185 100644 --- a/src/qml/qml/qqmllist.cpp +++ b/src/qml/qml/qqmllist.cpp @@ -409,8 +409,9 @@ Construct a QQmlListProperty from a set of operation functions. An opaque \a da may be passed which can be accessed from within the operation functions. The list property remains valid while \a object exists. -You can pass a null pointer, but than the list will be not designable or changeable by the debugger. -So provide all function, except it is not possible. +Null pointers can be passed for any function. If any null pointers are passed in, the list +will be neither designable nor alterable by the debugger. It is recommended to provide valid +pointers for all functions. */ /*! -- cgit v1.2.3 From 566afc2d2e4156712ffec081715f12307cf46628 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 12 Aug 2013 13:28:17 +1000 Subject: Dragging MouseArea nested in Flickable does not work with touch to mouse A MouseArea with a drag target nested in a Flickable does not work. This is due to QQuickWindow calling childMouseEventFilter() twice - once in sendFilteredTouchEvent() and later in sendEvent(). Since childMouseEventFilter() has already been called, deliver the mouse event directly in sendFilteredTouchEvent(). Task-number: QTBUG-32920 Change-Id: I22acee3c66ee6c06e71c9c876fb02dbcb6119a8d Reviewed-by: Andrew den Exter --- src/quick/items/qquickflickable.cpp | 6 ++++-- src/quick/items/qquickwindow.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index 46f95f16cb..8fef1c941e 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -982,6 +982,7 @@ void QQuickFlickablePrivate::handleMousePressEvent(QMouseEvent *event) q->setKeepMouseGrab(stealMouse); clearDelayedPress(); pressed = true; + if (hData.transitionToBounds) hData.transitionToBounds->stopTransition(); if (vData.transitionToBounds) @@ -2095,7 +2096,8 @@ bool QQuickFlickable::sendMouseEvent(QQuickItem *item, QMouseEvent *event) d->lastPosTime = -1; returnToBounds(); } - if (event->type() == QEvent::MouseButtonRelease) { + if (event->type() == QEvent::MouseButtonRelease || (grabber && grabber->keepMouseGrab() && !grabberDisabled)) { + // mouse released, or another item has claimed the grab d->lastPosTime = -1; d->clearDelayedPress(); d->stealMouse = false; @@ -2108,7 +2110,7 @@ bool QQuickFlickable::sendMouseEvent(QQuickItem *item, QMouseEvent *event) bool QQuickFlickable::childMouseEventFilter(QQuickItem *i, QEvent *e) { Q_D(QQuickFlickable); - if (!isVisible() || !isEnabled()) + if (!isVisible() || !isEnabled() || !isInteractive()) return QQuickItem::childMouseEventFilter(i, e); switch (e->type()) { case QEvent::MouseButtonPress: diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 525c3d1a0e..0ab929f9a7 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -484,7 +484,7 @@ bool QQuickWindowPrivate::translateTouchToMouse(QQuickItem *item, QTouchEvent *e item->grabMouse(); item->grabTouchPoints(QVector() << touchMouseId); - q->sendEvent(item, mousePress.data()); + QQuickItemPrivate::get(item)->deliverMouseEvent(mousePress.data()); event->setAccepted(mousePress->isAccepted()); if (!mousePress->isAccepted()) { touchMouseId = -1; @@ -497,7 +497,7 @@ bool QQuickWindowPrivate::translateTouchToMouse(QQuickItem *item, QTouchEvent *e if (mousePress->isAccepted() && checkIfDoubleClicked(event->timestamp())) { QScopedPointer mouseDoubleClick(touchToMouseEvent(QEvent::MouseButtonDblClick, p, event, item)); - q->sendEvent(item, mouseDoubleClick.data()); + QQuickItemPrivate::get(item)->deliverMouseEvent(mouseDoubleClick.data()); event->setAccepted(mouseDoubleClick->isAccepted()); if (mouseDoubleClick->isAccepted()) { return true; @@ -518,7 +518,7 @@ bool QQuickWindowPrivate::translateTouchToMouse(QQuickItem *item, QTouchEvent *e if (p.state() & Qt::TouchPointMoved) { if (mouseGrabberItem) { QScopedPointer me(touchToMouseEvent(QEvent::MouseMove, p, event, mouseGrabberItem)); - q->sendEvent(mouseGrabberItem, me.data()); + QQuickItemPrivate::get(item)->deliverMouseEvent(me.data()); event->setAccepted(me->isAccepted()); if (me->isAccepted()) { itemForTouchPointId[p.id()] = mouseGrabberItem; // N.B. the mouseGrabberItem may be different after returning from sendEvent() @@ -548,7 +548,7 @@ bool QQuickWindowPrivate::translateTouchToMouse(QQuickItem *item, QTouchEvent *e touchMouseId = -1; if (mouseGrabberItem) { QScopedPointer me(touchToMouseEvent(QEvent::MouseButtonRelease, p, event, mouseGrabberItem)); - q->sendEvent(mouseGrabberItem, me.data()); + QQuickItemPrivate::get(item)->deliverMouseEvent(me.data()); if (mouseGrabberItem) // might have ungrabbed due to event mouseGrabberItem->ungrabMouse(); return me->isAccepted(); -- cgit v1.2.3