Results 1 to 4 of 4

Thread: QMenu without shadow

  1. #1
    Join Date
    Aug 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default QMenu without shadow

    Good day.

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

    Qt Code:
    1. QPushButton button;
    2. QMenu *menu = new QMenu(button);
    3.  
    4. QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect();
    5. effect->setBlurRadius(100);
    6. effect->setXOffset(100);
    7. menu->setGraphicsEffect(effect);
    8.  
    9. button->setMenu(menu);
    To copy to clipboard, switch view to plain text mode 

    Any ideas?

  2. #2
    Join Date
    Mar 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QMenu without shadow

    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

  3. #3
    Join Date
    Jul 2007
    Location
    California, USA
    Posts
    62
    Thanks
    17
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QMenu without shadow

    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.

  4. #4
    Join Date
    Jan 2013
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMenu without shadow

    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 :

    Qt Code:
    1. myMenu->setMask(QRegion(0,0,400,800));
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. How to detect shadow building in qmake?
    By Fazer in forum Qt Programming
    Replies: 1
    Last Post: 11th August 2010, 19:16
  2. About QTreeView's shadow.
    By yangyunzhao in forum Qt Programming
    Replies: 3
    Last Post: 19th August 2009, 08:52
  3. A Shadow of my groupBox
    By baray98 in forum Qt Programming
    Replies: 1
    Last Post: 28th June 2008, 21:41
  4. Desktop application shadow?
    By gfunk in forum Qt Programming
    Replies: 2
    Last Post: 18th November 2006, 02:42
  5. drawing shadow effect
    By vijay anandh in forum Qt Programming
    Replies: 1
    Last Post: 25th May 2006, 15:41

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.