Results 1 to 2 of 2

Thread: Changing color to the default context menu

  1. #1
    Join Date
    Mar 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Changing color to the default context menu

    Hi

    I would like to change the background color to the default context menu. I am referring to the DefaultContextMenu that appears when right-clicking on the QLineEdit.
    I tried changing the stylesheet as follow but it does not produce any changes.

    QLineEdit:ContextMenu {
    background-color: rgb( 224,224,224);
    }

    Is there a way to identify the context menu background color? (via style-sheet)

    thanks

    davide

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Changing color to the default context menu

    You can customize a QMenu - your context menu IS a QMenu - so that should work.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Replies: 1
    Last Post: 4th November 2011, 11:25
  2. Replies: 4
    Last Post: 8th September 2011, 08:22
  3. Qwt and context menu
    By giusepped in forum Qwt
    Replies: 1
    Last Post: 9th December 2008, 08:55
  4. Context Menu
    By RY in forum Newbie
    Replies: 1
    Last Post: 10th September 2008, 07:59
  5. context of opengl is changing on mac os x
    By Sandip in forum Qt Programming
    Replies: 1
    Last Post: 4th April 2008, 12:25

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.