Results 1 to 4 of 4

Thread: QMenu Stylesheet Problem

  1. #1
    Join Date
    Mar 2014
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default QMenu Stylesheet Problem

    Hi, I am new to Qt and got stuck in QMenu stylesheet, when I use QMenu:item{} it shows error
    " 'item' is not a member of 'QMenu'."
    Please help me, I know I am missing something very basic...

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QMenu Stylesheet Problem

    Qt style sheets are not C++ code and it looks like you have fed it to the C++ compiler. Are you missing some double quotes?

  3. #3
    Join Date
    Mar 2014
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QMenu Stylesheet Problem

    Thanks Chris this might be the problem, I am using MinGW Compiler if I am not wrong its C++ compiler, please guide me which compiler should I use?

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QMenu Stylesheet Problem

    You should be using a C++ compiler but the stylesheet text is not C++ code. If the style sheet text appears in the source code outside of a quoted string then that is your error. I am only guessing because I cannot see your actual code. If you cannot work it out post the area of code around where the error was reported and the exact text of the first error message(s).
    "We can't solve problems by using the same kind of thinking we used when we created them." -- Einstein
    If you are posting code then please use [code] [/code] tags around it - makes addressing the problem easier.

Similar Threads

  1. Problems when styling QMenu with Qt Stylesheet
    By NoRulez in forum Qt Programming
    Replies: 0
    Last Post: 14th May 2011, 14:34
  2. QMenu stylesheet and alpha coloring
    By StaticPhilly in forum Newbie
    Replies: 1
    Last Post: 11th October 2010, 16:38
  3. Replies: 1
    Last Post: 28th July 2010, 17:37
  4. QMenu::Scroller StyleSheet
    By AmolShinde_8 in forum Qt Programming
    Replies: 3
    Last Post: 4th March 2010, 08:46
  5. Help with QMenu item stylesheet
    By Sufu in forum Qt Programming
    Replies: 11
    Last Post: 9th May 2009, 06:58

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
  •  
Qt is a trademark of The Qt Company.