简体   繁体   中英

Qt MainWindow Dark theme

I'm learning Qt and do you know to set black theme for mainwindow at Qt? I think that it's doing by css stylesheet or anything like this. I hope at your help. Sorry for bad English!

You can change it from its stylesheet.

QMainWindow{
     background-color: rgb(0, 0, 0) 
}

Just add this styling in your stylesheet, and it will work.

You can do it:

QApplication::setStyle(const QString & style);

You may do it on qss stylesheet (it's like css) For create your style file read more on Qt docs: http://doc.qt.io/Qt-5/stylesheet-reference.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM