stylesheet problem

  • i use qt designer and i set mainwindow background...but every element i created after it take the same background even if i change stylesheet ....what can i do?

  • Lifetime Qt Champion

    Read the docs :)

    My guess is ( since you dont show the stylesheet )
    That you are using a too broad selector so all children of mainwindow
    is also affected. If its ONLY mainwindow u want,
    then use
    QMainwindow {
    background: xxxx
    Stylesheets are cascading. Meaning,
    it also affects children, that is any other widget you put on
    But you can use ClassType, and object name and more for saying which one you target.

  • @mrjj yes ,thats really what happend thanks alot for your time

Log in to reply

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