Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Inheritance of styleSheet

Inheritance of styleSheet

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 2 Posters 677 Views 2 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.
  • P Offline
    P Offline
    peter-70
    wrote on last edited by
    #1

    I set a styleSheet for my Application. The styleSheet is always pretty fine available.
    But when I generate a QMenu, with a QWidget as parent, the QMenu do not inherits the styleSheet. All other control do that! Just the QMenu do it not. Why?

    , ui(new Ui::Toolbar)
    , menu(new QMenu(this))
    

    {
    ui->setupUi(this)
    qDebug() << this->menu->styleSheet() ==> output is: ""

    1 Reply Last reply
    0
    • P Offline
      P Offline
      peter-70
      wrote on last edited by
      #2

      Ok, I think I know the reason. It may be because the menu is created before setupUI is called

      1 Reply Last reply
      0
      • P Offline
        P Offline
        peter-70
        wrote on last edited by
        #3

        Sorry, that was not the reason. So I still do not know it yet.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          Setting a stylesheet on your application will not call setStylesheet on each and every widget created. The styling will be applied, that's all.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1

          • Login

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