diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2009-10-20 08:39:56 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@nokia.com> | 2009-10-20 08:45:47 (GMT) |
commit | a210a1efb3a255235ab22e618c61d0aaccba3d9f (patch) | |
tree | c6842a515fd54ecdcd961a6c4d49180fd0966267 /src/gui/kernel/qwidget.cpp | |
parent | 93550050f4fe4f411bfbd80d7b30ff5bc8a20df7 (diff) | |
download | Qt-a210a1efb3a255235ab22e618c61d0aaccba3d9f.zip Qt-a210a1efb3a255235ab22e618c61d0aaccba3d9f.tar.gz Qt-a210a1efb3a255235ab22e618c61d0aaccba3d9f.tar.bz2 |
QToolButton popup menu is shown at wrong position when embedded in a
QGraphicsView.
The main problem here is that QWidget assume that they are in the screen
somewhere, which means inside the available geometry provided by
QDesktopWidget. But in QGraphicsView the button can be in a position
that is way bigger than the screen resolution. Lot of widgets make
this assumption when positionning subpopups or submenus. Instead of
applying the same code on tons of QWidgets, it's better to have an
helper function in desktop widget which catch this case. It's not
pretty (since it has nothing to do with QDesktopWidget) but we don't
have better solution.
Task-number:QTBUG-3822
Reviewed-by:brad
Diffstat (limited to 'src/gui/kernel/qwidget.cpp')
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 7dc3ae9..e561aca 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -149,24 +149,6 @@ static inline bool hasBackingStoreSupport() #endif } -/*! - \internal - - Returns true if \a p or any of its parents enable the - Qt::BypassGraphicsProxyWidget window flag. Used in QWidget::show() and - QWidget::setParent() to determine whether it's necessary to embed the - widget into a QGraphicsProxyWidget or not. -*/ -static inline bool bypassGraphicsProxyWidget(QWidget *p) -{ - while (p) { - if (p->windowFlags() & Qt::BypassGraphicsProxyWidget) - return true; - p = p->parentWidget(); - } - return false; -} - #ifdef Q_WS_MAC # define QT_NO_PAINT_DEBUG #endif @@ -5473,6 +5455,7 @@ QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint * return pixmap; } +#ifndef QT_NO_GRAPHICSVIEW /*! \internal @@ -5481,7 +5464,7 @@ QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint * If successful, the function returns the proxy that embeds the widget, or 0 if no embedded widget was found. */ -QGraphicsProxyWidget * QWidgetPrivate::nearestGraphicsProxyWidget(QWidget *origin) +QGraphicsProxyWidget * QWidgetPrivate::nearestGraphicsProxyWidget(const QWidget *origin) { if (origin) { QWExtra *extra = origin->d_func()->extra; @@ -5491,6 +5474,7 @@ QGraphicsProxyWidget * QWidgetPrivate::nearestGraphicsProxyWidget(QWidget *origi } return 0; } +#endif /*! \property QWidget::locale |