Using unic Stylesheet file and Qt Designer

  • 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,

  • Lifetime Qt Champion

    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 and we can vote on it.
      Remember to flag it as Improvement.

  • @mrjj Ok, so as you suggest I add a ticket at this adress:
    I hope it will be considered on day.

  • Lifetime Qt Champion

    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.

  • @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?

  • Lifetime Qt Champion

    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.

  • Lifetime Qt Champion

    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

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

  • Lifetime Qt Champion

    Well it still confused me sometimes :)

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.