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. Don't apply App stylesheet to one window
Qt 6.11 is out! See what's new in the release blog

Don't apply App stylesheet to one window

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 569 Views 3 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.
  • T Offline
    T Offline
    Taytoo
    wrote on last edited by
    #1

    I have app level stylesheet that I use in my application. The stylesheet contains styles for 9 controls (and multiple states for each one, so quite a big stylesheet). I don't want to apply it to Settings & couple of other window of my app - so that they have native look. Can't figure out how to Not apply that Application stylesheet to the Settings etc windows and its controls.

    Tried calling

    setStylesheet("");
    

    on window and its controls but that didn't work. Any ideas? Is it possible to apply default stylesheet to Settings window/child widgets somehow?

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

      Hi,

      The most simple would be to ensure your stylesheet only concerns the exact widget types you want to style by being precise.

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

      T 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        The most simple would be to ensure your stylesheet only concerns the exact widget types you want to style by being precise.

        T Offline
        T Offline
        Taytoo
        wrote on last edited by
        #3

        @SGaist said in Don't apply App stylesheet to one window:

        Hi,

        The most simple would be to ensure your stylesheet only concerns the exact widget types you want to style by being precise.

        Thats the issue, I have so many widgets on multipole windows. It'll be too rigid of a solution to specify exact widgets - prone to breakage if I add/remove widgets or make changes to stylesheet. Is there anyother way?

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

          You could use a dynamic property.

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

          T 1 Reply Last reply
          1
          • SGaistS SGaist

            You could use a dynamic property.

            T Offline
            T Offline
            Taytoo
            wrote on last edited by
            #5

            @SGaist said in Don't apply App stylesheet to one window:

            You could use a dynamic property.

            Already using that to separate different styles of Labels

            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