Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Main menu does not respond to the style sheet
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.5k Views 1 Watching
  • 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 Offline
    C Offline
    ChanchoCiego
    wrote on last edited by
    #1

    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
    0
    • J Offline
      J Offline
      Jake007
      wrote on last edited by
      #2

      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
      0
      • C Offline
        C Offline
        ChanchoCiego
        wrote on last edited by
        #3

        Thank you very much, sorry for the mistake

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved