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. is it possible to append stylesheet into existing stylesheet?
QtWS25 Last Chance

is it possible to append stylesheet into existing stylesheet?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 815 Views
  • 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.
  • S Offline
    S Offline
    saeid0034
    wrote on last edited by
    #1

    Hey guys can I use stylesheet like this?

    .
    └── centralWidget
        └── child_widget
            ├── ...
            ├── ...
            └── frame
    

    in centralWidget put something like

    #frame {
      background-color: #ffffff;
    }
    

    and in child_widget something like

    #frame {
      border-radius: 10;
    }
    

    does it work and the targeted widget will have both background-color and border-radius or it will be replaced with the new stylesheet?

    Pl45m4P 1 Reply Last reply
    0
    • S saeid0034

      Hey guys can I use stylesheet like this?

      .
      └── centralWidget
          └── child_widget
              ├── ...
              ├── ...
              └── frame
      

      in centralWidget put something like

      #frame {
        background-color: #ffffff;
      }
      

      and in child_widget something like

      #frame {
        border-radius: 10;
      }
      

      does it work and the targeted widget will have both background-color and border-radius or it will be replaced with the new stylesheet?

      Pl45m4P Online
      Pl45m4P Online
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @saeid0034 said in is it possible to append stylesheet into existing stylesheet?:

      it will be replaced with the new stylesheet?

      The function to set a stylesheet explicitly is called setStylesheet... It sets the given style... previous styles (style changes) are lost.

      But there are inherited styles (cascading by parent). Read here:

      • https://doc.qt.io/qt-5/stylesheet-syntax.html#cascading
        and here:
      • https://doc.qt.io/qt-5/stylesheet-syntax.html#inheritance

      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      3

      • Login

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