diff options
author | axis <qt-info@nokia.com> | 2009-11-05 10:32:55 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-11-05 10:32:55 (GMT) |
commit | dd6a230f812b957137a2711c772284ee77ffccf4 (patch) | |
tree | a1f46718a295964ddaa9ab04c8222f6db3b19057 /src/gui/kernel | |
parent | f1a56f4db2f6d6c395ac6e7023b6e9184140d571 (diff) | |
parent | eb75d1d6acf121fc08a591b4d6b34f1f39283bc2 (diff) | |
download | Qt-dd6a230f812b957137a2711c772284ee77ffccf4.zip Qt-dd6a230f812b957137a2711c772284ee77ffccf4.tar.gz Qt-dd6a230f812b957137a2711c772284ee77ffccf4.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6-s60
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qevent.cpp | 6 | ||||
-rw-r--r-- | src/gui/kernel/qgesture.cpp | 21 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 19 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 6 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_p.h | 6 |
6 files changed, 47 insertions, 13 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index bcebe06..ad68aea 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -4345,9 +4345,9 @@ bool QGestureEvent::isAccepted(QGesture *gesture) const Sets the accept flag of the given \a gestureType object to the specified \a value. - Setting the accept flag indicates that the event receiver wants the gesture - of type \a gestureType. Unwanted gestures may be propagated to the parent - widget. + Setting the accept flag indicates that the event receiver wants to receive + gestures of the specified type, \a gestureType. Unwanted gestures may be + propagated to the parent widget. By default, gestures in events of type QEvent::Gesture are accepted, and gestures in QEvent::GestureOverride events are ignored. diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp index e322af2..4edf8a9 100644 --- a/src/gui/kernel/qgesture.cpp +++ b/src/gui/kernel/qgesture.cpp @@ -174,6 +174,16 @@ void QGesture::unsetHotSpot() } /*! + \property QGesture::gestureCancelPolicy + \brief the policy for deciding what happens on accepting a gesture + + On accepting one gesture Qt can automatically cancel other gestures + that belong to other targets. The policy is normally set to not cancel + any other gestures and can be set to cancel all active gestures in the + context. For example for all child widgets. +*/ + +/*! \enum QGesture::GestureCancelPolicy This enum describes how accepting a gesture can cancel other gestures @@ -210,13 +220,12 @@ QGesture::GestureCancelPolicy QGesture::gestureCancelPolicy() const */ /*! - \property QGesture::gestureCancelPolicy - \brief the policy for deciding what happens on accepting a gesture + \property QPanGesture::totalOffset + \brief the total offset from the first input position to the current input + position - On accepting one gesture Qt can automatically cancel other gestures - that belong to other targets. The policy is normally set to not cancel - any other gestures and can be set to cancel all active gestures in the - context. For example for all child widgets. + The total offset measures the total change in position of the user's input + covered by the gesture on the input device. */ /*! diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 6a72cfa..386bf71 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -230,7 +230,9 @@ QWidgetPrivate::~QWidgetPrivate() if (extra) deleteExtra(); +#ifndef QT_NO_GRAPHICSEFFECT delete graphicsEffect; +#endif //QT_NO_GRAPHICSEFFECT } QWindowSurface *QWidgetPrivate::createDefaultWindowSurface() @@ -1793,6 +1795,7 @@ QRegion QWidgetPrivate::clipRegion() const return r; } +#ifndef QT_NO_GRAPHICSEFFECT void QWidgetPrivate::invalidateGraphicsEffectsRecursively() { Q_Q(QWidget); @@ -1807,6 +1810,7 @@ void QWidgetPrivate::invalidateGraphicsEffectsRecursively() w = w->parentWidget(); } while (w); } +#endif //QT_NO_GRAPHICSEFFECT void QWidgetPrivate::setDirtyOpaqueRegion() { @@ -1814,7 +1818,9 @@ void QWidgetPrivate::setDirtyOpaqueRegion() dirtyOpaqueChildren = true; +#ifndef QT_NO_GRAPHICSEFFECT invalidateGraphicsEffectsRecursively(); +#endif //QT_NO_GRAPHICSEFFECT if (q->isWindow()) return; @@ -1963,10 +1969,12 @@ void QWidgetPrivate::clipToEffectiveMask(QRegion ®ion) const const QWidget *w = q; QPoint offset; +#ifndef QT_NO_GRAPHICSEFFECT if (graphicsEffect) { w = q->parentWidget(); offset -= data.crect.topLeft(); } +#endif //QT_NO_GRAPHICSEFFECT while (w) { const QWidgetPrivate *wd = w->d_func(); @@ -2001,11 +2009,13 @@ void QWidgetPrivate::updateIsOpaque() // hw: todo: only needed if opacity actually changed setDirtyOpaqueRegion(); +#ifndef QT_NO_GRAPHICSEFFECT if (graphicsEffect) { // ### We should probably add QGraphicsEffect::isOpaque at some point. setOpaque(false); return; } +#endif //QT_NO_GRAPHICSEFFECT Q_Q(QWidget); #ifdef Q_WS_X11 @@ -5013,11 +5023,13 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset, \sa setGraphicsEffect() */ +#ifndef QT_NO_GRAPHICSEFFECT QGraphicsEffect *QWidget::graphicsEffect() const { Q_D(const QWidget); return d->graphicsEffect; } +#endif //QT_NO_GRAPHICSEFFECT /*! @@ -5036,6 +5048,7 @@ QGraphicsEffect *QWidget::graphicsEffect() const \sa graphicsEffect() */ +#ifndef QT_NO_GRAPHICSEFFECT void QWidget::setGraphicsEffect(QGraphicsEffect *effect) { Q_D(QWidget); @@ -5065,6 +5078,7 @@ void QWidget::setGraphicsEffect(QGraphicsEffect *effect) d->updateIsOpaque(); update(); } +#endif //QT_NO_GRAPHICSEFFECT bool QWidgetPrivate::isAboutToShow() const { @@ -5211,6 +5225,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP return; Q_Q(QWidget); +#ifndef QT_NO_GRAPHICSEFFECT if (graphicsEffect && graphicsEffect->isEnabled()) { QGraphicsEffectSource *source = graphicsEffect->d_func()->source; QWidgetEffectSourcePrivate *sourced = static_cast<QWidgetEffectSourcePrivate *> @@ -5241,6 +5256,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP return; } } +#endif //QT_NO_GRAFFICSEFFECT const bool asRoot = flags & DrawAsRoot; const bool alsoOnScreen = flags & DrawPaintOnScreen; @@ -5395,7 +5411,6 @@ void QWidgetPrivate::paintSiblingsRecursive(QPaintDevice *pdev, const QObjectLis QWidgetPrivate *wd = w->d_func(); const QPoint widgetPos(w->data->crect.topLeft()); const bool hasMask = wd->extra && wd->extra->hasMask && !wd->graphicsEffect; - if (index > 0) { QRegion wr(rgn); if (wd->isOpaque) @@ -5421,6 +5436,7 @@ void QWidgetPrivate::paintSiblingsRecursive(QPaintDevice *pdev, const QObjectLis } } +#ifndef QT_NO_GRAPHICSEFFECT QRectF QWidgetEffectSourcePrivate::boundingRect(Qt::CoordinateSystem system) const { if (system != Qt::DeviceCoordinates) @@ -5521,6 +5537,7 @@ QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint * m_widget->render(&pixmap, pixmapOffset); return pixmap; } +#endif //QT_NO_GRAPHICSEFFECT #ifndef QT_NO_GRAPHICSVIEW /*! diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h index 05f0069..b7c55f9 100644 --- a/src/gui/kernel/qwidget.h +++ b/src/gui/kernel/qwidget.h @@ -351,8 +351,10 @@ public: const QRegion &sourceRegion = QRegion(), RenderFlags renderFlags = RenderFlags(DrawWindowBackground | DrawChildren)); +#ifndef QT_NO_GRAPHICSEFFECT QGraphicsEffect *graphicsEffect() const; void setGraphicsEffect(QGraphicsEffect *effect); +#endif //QT_NO_GRAPHICSEFFECT void grabGesture(Qt::GestureType type, Qt::GestureFlags flags = Qt::GestureFlags()); void ungrabGesture(Qt::GestureType type); diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 9270220..278bd80 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -3787,7 +3787,7 @@ void QWidgetPrivate::stackUnder_sys(QWidget *w) /* Modifies the bounds for a widgets backing HIView during moves and resizes. Also updates the widget, either by scrolling its contents or repainting, depending on the WA_StaticContents - and QWidgetPrivate::isOpaque flags. + flag */ static void qt_mac_update_widget_posisiton(QWidget *q, QRect oldRect, QRect newRect) { @@ -3804,8 +3804,8 @@ static void qt_mac_update_widget_posisiton(QWidget *q, QRect oldRect, QRect newR // Perform a normal (complete repaint) update in some cases: if ( - // move-by-scroll requires QWidgetPrivate::isOpaque set - (isMove && q->testAttribute(Qt::WA_OpaquePaintEvent) == false) || + // always repaint on move. + (isMove) || // limited update on resize requires WA_StaticContents. (isResize && q->testAttribute(Qt::WA_StaticContents) == false) || diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 8b03a85..151b90a 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -384,7 +384,9 @@ public: void setOpaque(bool opaque); void updateIsTranslucent(); bool paintOnScreen() const; +#ifndef QT_NO_GRAPHICSEFFECT void invalidateGraphicsEffectsRecursively(); +#endif //QT_NO_GRAPHICSEFFECT const QRegion &getOpaqueChildren() const; void setDirtyOpaqueRegion(); @@ -530,8 +532,10 @@ public: inline QRect effectiveRectFor(const QRect &rect) const { +#ifndef QT_NO_GRAPHICSEFFECT if (graphicsEffect && graphicsEffect->isEnabled()) return graphicsEffect->boundingRectFor(rect).toAlignedRect(); +#endif //QT_NO_GRAPHICSEFFECT return rect; } @@ -774,6 +778,7 @@ struct QWidgetPaintContext QPainter *painter; }; +#ifndef QT_NO_GRAPHICSEFFECT class QWidgetEffectSourcePrivate : public QGraphicsEffectSourcePrivate { public: @@ -826,6 +831,7 @@ public: QTransform lastEffectTransform; bool updateDueToGraphicsEffect; }; +#endif //QT_NO_GRAPHICSEFFECT inline QWExtra *QWidgetPrivate::extraData() const { |