Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    [Solved] Main menu does not respond to the style sheet

    General and Desktop
    2
    3
    1205
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      ChanchoCiego last edited by

      Hello, good afternoon,

      [English made Bing, sorry]

      I have an application with a style sheet that works well except in the main menu.

      When I run the application, the main menu looks like in the following picture:

      !http://sddsoft.com.ar/imagenes/menu.png(MainMenu)!

      Draws a gradient style Windows, apparently unresponsive to the style sheet. The menu css is as follows:

      @
      QMenuBar
      {
      background-color: rgb(248, 248, 248);
      }

      QMenu
      {
      border-top: 1px solid rgb(0, 0, 0);
      background-color: rgb(240, 240, 240);
      }

      QMenu:selected
      {
      color: rgb(0, 0, 0);
      background-color: rgb(224, 224, 224);
      }

      QAction
      {
      background-color: rgb(240, 240, 240);
      }
      @

      What I am doing wrong?

      Thanks a lot.

      Dario.

      P.D.: In some cases I noticed that CSS should add a space at the end of the Declaration of the widget so that Qt does not ignore it, but that is another topic.

      1 Reply Last reply Reply Quote 0
      • J
        Jake007 last edited by

        Hi!

        If you take a look at the docs "here":http://doc.qt.digia.com/qt/stylesheet-examples.html#customizing-qmenubar

        You'll notice that there are two colons(:) for some items , and its QMenu::item:selected, QMenuBar::item:selected etc...


        Code is poetry

        1 Reply Last reply Reply Quote 0
        • C
          ChanchoCiego last edited by

          Thank you very much, sorry for the mistake

          1 Reply Last reply Reply Quote 0
          • First post
            Last post