PDA

View Full Version : QMenu without shadow



furj
11th August 2010, 12:53
Good day.

How can I make context QMenu without shadow. The following code does not work:



QPushButton button;
QMenu *menu = new QMenu(button);

QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect();
effect->setBlurRadius(100);
effect->setXOffset(100);
menu->setGraphicsEffect(effect);

button->setMenu(menu);


Any ideas?

UrfinJuice
1st April 2011, 14:27
I also would like to know the answer to this question. As far as I understand, the shadow of QMenu is the matter of the style. But somehow I need to remove it. Would appreciate any help

ntp
1st December 2011, 01:44
I too would like to remove the drop shadow. Has anyone figured this out. I tried to subclass QMenu but it appears that the drop shadow drawing is controlled in the private part of the QMenu.

ikam
31st January 2013, 22:00
I have the same problem and found a simple trick, but it works only on xp :

set for the menu a mask region bigger than the popup window :


myMenu->setMask(QRegion(0,0,400,800));