Qt Forum

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

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Solved Using unic Stylesheet file and Qt Designer

    Tools
    stylesheet qtdesigner qss css
    2
    9
    4496
    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.
    • Romain C
      Romain C last edited by A Former User

      Hi everyone,
      I'm working from few days on a application based on Qt.
      This application have différents styles inside ui files and in the code so I decided to unified all this "style ressources" in one file named style.qss.
      After that, on the app instance I apply with setStyleSheet my file.

      Everything works fine, except that in Qt Designer style are not applied (seems logic, he don't know where to find this information).

      Is there a way to set this stylesheet information to Qt Designer?
      If no, can it be in the future an improvement of Qt Designer?

      Best regards,
      Romain

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        Hi
        As far as I found, there is no method to set a stylesheet globally in Creator.
        You can only set pr top widget, and it applies to all children.
        Like setting on MainWindow and all children is affected
        but it won't affect other UI files not having Mainwindow as parent.
        ( like parent less Dialog)
        (right click MainWindow and select Change stylesheet)

        • no, can it be in the future an improvement of QT Designer?
          Yes it could but we are user oriented forum and the Devs would not see such suggestions here.
          You could open a ticket on https://bugreports.qt.io and we can vote on it.
          Remember to flag it as Improvement.
        Romain C 1 Reply Last reply Reply Quote 0
        • Romain C
          Romain C @mrjj last edited by

          @mrjj Ok, so as you suggest I add a ticket at this adress: https://bugreports.qt.io/browse/QTCREATORBUG-17351
          I hope it will be considered on day.
          Thanks!

          mrjj 1 Reply Last reply Reply Quote 1
          • mrjj
            mrjj Lifetime Qt Champion @Romain C last edited by

            @Romain-C
            Hi, super.
            Maybe a slightly better description. ?

            Each widget do have a StyleSheet editor but you cannot tell
            Creator/Designer a global one so if you make a new UI files the stylesheet
            would already be there.

            So I assume what you are after is a global style sheet setting that show in Designer preview for
            all UI files without u setting the styleshett manually.

            Romain C 1 Reply Last reply Reply Quote 1
            • Romain C
              Romain C @mrjj last edited by

              @mrjj Hey! Tell me if it seem clearer to you! I have pick some of your comment!
              I'm a little bit in english, if you see some inexact terms....
              I put this topic as closed?

              mrjj 1 Reply Last reply Reply Quote 1
              • mrjj
                mrjj Lifetime Qt Champion @Romain C last edited by

                @Romain-C
                Yes it seems more clear.
                Your english is fine. It was just so there were enough details for the Dev to understand
                what it is about. :)
                Yes please do close it.

                mrjj 1 Reply Last reply Reply Quote 1
                • mrjj
                  mrjj Lifetime Qt Champion @mrjj last edited by mrjj

                  Oh, if u cannot find Solved.
                  Then in first Post u made. Click Topic Button. Then click "Ask as Question"
                  and then there is a mark as "Solved"
                  alt text

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

                    Thanks! Exactly what I'm trying to find! =D

                    mrjj 1 Reply Last reply Reply Quote 0
                    • mrjj
                      mrjj Lifetime Qt Champion @Romain C last edited by

                      @Romain-C
                      Well it still confused me sometimes :)

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