Results 1 to 3 of 3

Thread: OSX - QMenu vs QWidgetAction paints with transparent bg

  1. #1
    Join Date
    Apr 2011
    Posts
    132
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default OSX - QMenu vs QWidgetAction paints with transparent bg

    Hi

    Some reason below code paints a menu with transparent background. So the check box and label next to it has no background.

    Any ideas why ?


    Qt Code:
    1. QMenu *menuOther = new QMenu(tr("&Other"), this);
    2.  
    3. QCheckBox *checkbox = new QCheckBox(tr("Test"), this);
    4. connect(checkbox, SIGNAL(toggled(bool)), parent, SLOT(button(bool)));
    5.  
    6. QWidgetAction *action = new QWidgetAction(menuOther);
    7. action->setDefaultWidget(checkbox);
    8.  
    9. menuOther->addAction(action);
    10. addMenu(menuOther);
    To copy to clipboard, switch view to plain text mode 

    $ uname -a
    Darwin Mac-mini.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386

    Thanks for looking

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: OSX - QMenu vs QWidgetAction paints with transparent bg

    Check parent style, maybe it has transparent background set.

  3. #3
    Join Date
    Apr 2011
    Posts
    132
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: OSX - QMenu vs QWidgetAction paints with transparent bg

    I don't set styling anywhere.

    I have the same set Else where, QMenu inside QMenu but I don't use checkboxes there with QWidgetAction. The QWidgetAction causes this transparency but no idea how to fix it.

    https://bugreports.qt-project.org/br...s:all-tabpanel

    Looks like a bug. But what is the hack to fix it ?

    I use QT 4.7.4 no idea what is the carbon vesion.

Similar Threads

  1. QWidgetAction resize in QMenu
    By stburton in forum Qt Programming
    Replies: 7
    Last Post: 11th January 2018, 14:27
  2. How to make QMenu.exec() return a QWidgetAction
    By gregsan in forum Qt Programming
    Replies: 5
    Last Post: 15th April 2010, 00:04
  3. Replies: 0
    Last Post: 16th March 2010, 12:24
  4. QWidgetAction: A QTreeWidget in a QMenu
    By chezifresh in forum Qt Programming
    Replies: 1
    Last Post: 16th October 2009, 03:49
  5. QTableView paints too much
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2006, 18:42

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.