From 708fcbe457304ac8035c20302e6dc6628a0f6aa4 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Thu, 12 May 2011 13:54:46 +0300 Subject: Fix for rounded corners bug in QMenu Currently QMenus have opaque black corners in cases where theme supports rounded corners. This patch fixes it by setting WA_TranslucentBackground flag to QMenu widget. Task-number: QTBUG-16857 Reviewed-by: Sami Merila --- src/gui/widgets/qmenu.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 2f4bb4b..d573ebf 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -82,6 +82,10 @@ # include #endif +#ifdef Q_WS_S60 +# include "private/qt_s60_p.h" +#endif + QT_BEGIN_NAMESPACE @@ -172,6 +176,14 @@ void QMenuPrivate::init() q->addAction(selectAction); q->addAction(cancelAction); #endif + +#ifdef Q_WS_S60 + if (S60->avkonComponentsSupportTransparency) { + bool noSystemBackground = q->testAttribute(Qt::WA_NoSystemBackground); + q->setAttribute(Qt::WA_TranslucentBackground); // also sets WA_NoSystemBackground + q->setAttribute(Qt::WA_NoSystemBackground, noSystemBackground); // restore system background attribute + } +#endif } int QMenuPrivate::scrollerHeight() const -- cgit v0.12