summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2009-10-28 14:50:04 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2009-10-29 16:00:14 (GMT)
commit9c681ddc3a70b220de5d38de498ab1804ec12d4a (patch)
tree703450a3b4e7eb02a64f668be81ae2434d575fe1 /src
parent23b6599324bc62666d4303ca108ed372e8d7c490 (diff)
downloadQt-9c681ddc3a70b220de5d38de498ab1804ec12d4a.zip
Qt-9c681ddc3a70b220de5d38de498ab1804ec12d4a.tar.gz
Qt-9c681ddc3a70b220de5d38de498ab1804ec12d4a.tar.bz2
Fix GRAPHICSVIEW
Reviewed-by: tom
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qevent.cpp2
-rw-r--r--src/gui/kernel/qevent.h2
-rw-r--r--src/gui/kernel/qgesturemanager.cpp2
-rw-r--r--src/gui/kernel/qgesturemanager_p.h2
-rw-r--r--src/gui/kernel/qwidget.cpp40
-rw-r--r--src/gui/painting/qbackingstore.cpp4
-rw-r--r--src/gui/painting/qwindowsurface_qws.cpp2
7 files changed, 41 insertions, 13 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 065bd09..bf9479f 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -4345,6 +4345,7 @@ QWidget *QGestureEvent::widget() const
return d_func()->widget;
}
+#ifndef QT_NO_GRAPHICSVIEW
/*!
Returns the scene-local coordinates if the \a gesturePoint is inside a graphics view.
@@ -4361,6 +4362,7 @@ QPointF QGestureEvent::mapToScene(const QPointF &gesturePoint) const
}
return QPointF();
}
+#endif //QT_NO_GRAPHICSVIEW
/*!
\internal
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index b7370fd..d6b1dc1 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -854,7 +854,9 @@ public:
void setWidget(QWidget *widget);
QWidget *widget() const;
+#ifndef QT_NO_GRAPHICSVIEW
QPointF mapToScene(const QPointF &gesturePoint) const;
+#endif
private:
QGestureEventPrivate *d_func();
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index ed8e744..5ad607b 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -331,6 +331,7 @@ bool QGestureManager::filterEvent(QWidget *receiver, QEvent *event)
return filterEventThroughContexts(contexts, event);
}
+#ifndef QT_NO_GRAPHICSVIEW
bool QGestureManager::filterEvent(QGraphicsObject *receiver, QEvent *event)
{
QSet<Qt::GestureType> types;
@@ -360,6 +361,7 @@ bool QGestureManager::filterEvent(QGraphicsObject *receiver, QEvent *event)
}
return filterEventThroughContexts(contexts, event);
}
+#endif
bool QGestureManager::filterEvent(QGesture *state, QEvent *event)
{
diff --git a/src/gui/kernel/qgesturemanager_p.h b/src/gui/kernel/qgesturemanager_p.h
index f0e7225..8199e02 100644
--- a/src/gui/kernel/qgesturemanager_p.h
+++ b/src/gui/kernel/qgesturemanager_p.h
@@ -74,7 +74,9 @@ public:
bool filterEvent(QWidget *receiver, QEvent *event);
bool filterEvent(QGesture *receiver, QEvent *event);
+#ifndef QT_NO_GRAPHICSVIEW
bool filterEvent(QGraphicsObject *receiver, QEvent *event);
+#endif //QT_NO_GRAPHICSVIEW
// declared in qapplication.cpp
static QGestureManager* instance();
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 916ae8b..62cfd12 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -1549,7 +1549,9 @@ void QWidgetPrivate::createExtra()
extra = new QWExtra;
extra->glContext = 0;
extra->topextra = 0;
+#ifndef QT_NO_GRAPHICSVIEW
extra->proxyWidget = 0;
+#endif
#ifndef QT_NO_CURSOR
extra->curs = 0;
#endif
@@ -1699,12 +1701,13 @@ void QWidgetPrivate::propagatePaletteChange()
{
Q_Q(QWidget);
// Propagate a new inherited mask to all children.
- if (!q->parentWidget() && extra && extra->proxyWidget) {
#ifndef QT_NO_GRAPHICSVIEW
+ if (!q->parentWidget() && extra && extra->proxyWidget) {
QGraphicsProxyWidget *p = extra->proxyWidget;
inheritedPaletteResolveMask = p->d_func()->inheritedPaletteResolveMask | p->palette().resolve();
+ } else
#endif //QT_NO_GRAPHICSVIEW
- } else if (q->isWindow() && !q->testAttribute(Qt::WA_WindowPropagation)) {
+ if (q->isWindow() && !q->testAttribute(Qt::WA_WindowPropagation)) {
inheritedPaletteResolveMask = 0;
}
int mask = data.pal.resolve() | inheritedPaletteResolveMask;
@@ -4381,7 +4384,11 @@ QPalette QWidgetPrivate::naturalWidgetPalette(uint inheritedMask) const
Q_Q(const QWidget);
QPalette naturalPalette = QApplication::palette(q);
if (!q->testAttribute(Qt::WA_StyleSheet)
- && (!q->isWindow() || q->testAttribute(Qt::WA_WindowPropagation) || (extra && extra->proxyWidget))) {
+ && (!q->isWindow() || q->testAttribute(Qt::WA_WindowPropagation)
+#ifndef QT_NO_GRAPHICSVIEW
+ || (extra && extra->proxyWidget)
+#endif //QT_NO_GRAPHICSVIEW
+ )) {
if (QWidget *p = q->parentWidget()) {
if (!p->testAttribute(Qt::WA_StyleSheet)) {
if (!naturalPalette.isCopyOf(QApplication::palette())) {
@@ -4392,13 +4399,14 @@ QPalette QWidgetPrivate::naturalWidgetPalette(uint inheritedMask) const
naturalPalette = p->palette();
}
}
- } else if (extra && extra->proxyWidget) {
+ }
#ifndef QT_NO_GRAPHICSVIEW
+ else if (extra && extra->proxyWidget) {
QPalette inheritedPalette = extra->proxyWidget->palette();
inheritedPalette.resolve(inheritedMask);
naturalPalette = inheritedPalette.resolve(naturalPalette);
-#endif //QT_NO_GRAPHICSVIEW
}
+#endif //QT_NO_GRAPHICSVIEW
}
naturalPalette.resolve(0);
return naturalPalette;
@@ -4516,7 +4524,11 @@ QFont QWidgetPrivate::naturalWidgetFont(uint inheritedMask) const
Q_Q(const QWidget);
QFont naturalFont = QApplication::font(q);
if (!q->testAttribute(Qt::WA_StyleSheet)
- && (!q->isWindow() || q->testAttribute(Qt::WA_WindowPropagation) || (extra && extra->proxyWidget))) {
+ && (!q->isWindow() || q->testAttribute(Qt::WA_WindowPropagation)
+#ifndef QT_NO_GRAPHICSVIEW
+ || (extra && extra->proxyWidget)
+#endif //QT_NO_GRAPHICSVIEW
+ )) {
if (QWidget *p = q->parentWidget()) {
if (!p->testAttribute(Qt::WA_StyleSheet)) {
if (!naturalFont.isCopyOf(QApplication::font())) {
@@ -4527,13 +4539,14 @@ QFont QWidgetPrivate::naturalWidgetFont(uint inheritedMask) const
naturalFont = p->font();
}
}
- } else if (extra && extra->proxyWidget) {
+ }
#ifndef QT_NO_GRAPHICSVIEW
+ else if (extra && extra->proxyWidget) {
QFont inheritedFont = extra->proxyWidget->font();
inheritedFont.resolve(inheritedMask);
naturalFont = inheritedFont.resolve(naturalFont);
-#endif //QT_NO_GRAPHICSVIEW
}
+#endif //QT_NO_GRAPHICSVIEW
}
naturalFont.resolve(0);
return naturalFont;
@@ -4580,12 +4593,13 @@ void QWidgetPrivate::updateFont(const QFont &font)
data.fnt.x11SetScreen(xinfo.screen());
#endif
// Combine new mask with natural mask and propagate to children.
- if (!q->parentWidget() && extra && extra->proxyWidget) {
#ifndef QT_NO_GRAPHICSVIEW
+ if (!q->parentWidget() && extra && extra->proxyWidget) {
QGraphicsProxyWidget *p = extra->proxyWidget;
inheritedFontResolveMask = p->d_func()->inheritedFontResolveMask | p->font().resolve();
+ } else
#endif //QT_NO_GRAPHICSVIEW
- } else if (q->isWindow() && !q->testAttribute(Qt::WA_WindowPropagation)) {
+ if (q->isWindow() && !q->testAttribute(Qt::WA_WindowPropagation)) {
inheritedFontResolveMask = 0;
}
uint newMask = data.fnt.resolve() | inheritedFontResolveMask;
@@ -5396,7 +5410,11 @@ void QWidgetPrivate::paintSiblingsRecursive(QPaintDevice *pdev, const QObjectLis
, sharedPainter, backingStore);
}
- if (w->updatesEnabled() && (!w->d_func()->extra || !w->d_func()->extra->proxyWidget)) {
+ if (w->updatesEnabled()
+#ifndef QT_NO_GRAPHICSVIEW
+ && (!w->d_func()->extra || !w->d_func()->extra->proxyWidget)
+#endif //QT_NO_GRAPHICSVIEW
+ ) {
QRegion wRegion(rgn);
wRegion &= wd->effectiveRectFor(w->data->crect);
wRegion.translate(-widgetPos);
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp
index 3cd1402..de97302 100644
--- a/src/gui/painting/qbackingstore.cpp
+++ b/src/gui/painting/qbackingstore.cpp
@@ -891,7 +891,7 @@ void QWidgetPrivate::moveRect(const QRect &rect, int dx, int dy)
const QRect parentRect(rect & clipR);
bool accelerateMove = accelEnv && isOpaque
-#ifndef QT_NO_GRAPHICSCVIEW
+#ifndef QT_NO_GRAPHICSVIEW
// No accelerate move for proxy widgets.
&& !tlw->d_func()->extra->proxyWidget
#endif
@@ -1189,7 +1189,7 @@ void QWidgetBackingStore::sync()
: wd->dirty);
toClean += widgetDirty;
-#ifndef QT_NO_GRAPHICSCVIEW
+#ifndef QT_NO_GRAPHICSVIEW
if (tlw->d_func()->extra->proxyWidget) {
resetWidget(w);
continue;
diff --git a/src/gui/painting/qwindowsurface_qws.cpp b/src/gui/painting/qwindowsurface_qws.cpp
index 4f489c4..fa0c80e 100644
--- a/src/gui/painting/qwindowsurface_qws.cpp
+++ b/src/gui/painting/qwindowsurface_qws.cpp
@@ -668,9 +668,11 @@ void QWSWindowSurface::flush(QWidget *widget, const QRegion &region,
if (!win)
return;
+#ifndef QT_NO_GRAPHICSVIEW
QWExtra *extra = win->d_func()->extra;
if (extra && extra->proxyWidget)
return;
+#endif //QT_NO_GRAPHICSVIEW
Q_UNUSED(offset);