Results 1 to 3 of 3

Thread: Styling the tear-off handle of a QMenu?

  1. #1
    Join Date
    Dec 2009
    Posts
    49
    Thanks
    3
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Styling the tear-off handle of a QMenu?

    Is it actually possible to customize the look of the "tear-off" handle of a QMenu with stylesheets? The documentation (http://doc.qt.nokia.com/4.6/stylesheet-reference.html) seems to indicate it's possible: "The tear-off is styled using the ::tear-off" (on styling QMenu).

    Here's what I've tried:

    Qt Code:
    1. QMenu::tear-off
    2. {
    3. background-color: green;
    4. color: red;
    5. border: 10px solid yellow;
    6. }
    To copy to clipboard, switch view to plain text mode 

    However this has no effect whatsoever, neither on Windows (Vista) nor on Mac OS X (10.4). I also tried "QMenu::tear-off::item".

    I'm using Qt 4.6.2, latest stable.

    Cheers,
    Franz

  2. #2
    Join Date
    Dec 2009
    Posts
    49
    Thanks
    3
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Styling the tear-off handle of a QMenu?

    I opened a bug for this issue: http://bugreports.qt.nokia.com/browse/QTBUG-12553.

    Cheers,
    Franz

  3. #3
    Join Date
    Dec 2009
    Posts
    49
    Thanks
    3
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Styling the tear-off handle of a QMenu?

    It appears that the documentation was wrong, the correct name of the subcontrol is "tearoff", not "tear-off".

    For more details, see this bug: http://bugreports.qt.nokia.com/browse/QTBUG-12553.

    Cheers,
    Franz

Similar Threads

  1. Tear-off Tabs
    By Max Yaffe in forum Qt Programming
    Replies: 7
    Last Post: 21st October 2016, 22:48
  2. QMenu: want a QListView in submenu to handle lots of options
    By chezifresh in forum Qt Programming
    Replies: 1
    Last Post: 12th November 2009, 23:55
  3. Styling QMenubar???
    By anupamgee in forum Qt Programming
    Replies: 5
    Last Post: 29th April 2009, 10:01
  4. Tear off QMenu
    By sebastian in forum Qt Programming
    Replies: 5
    Last Post: 27th June 2008, 07:45
  5. QComboBox styling
    By Oleg in forum Qt Programming
    Replies: 3
    Last Post: 25th November 2007, 23:48

Tags for this Thread

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.