Skip to content

Instantly share code, notes, and snippets.

@codeyash
Forked from skyrpex/qt5-fusion-dark.cpp
Last active May 7, 2016 07:53
Show Gist options
  • Save codeyash/8b46c72162e7779bbfcda5a42fce998b to your computer and use it in GitHub Desktop.
Save codeyash/8b46c72162e7779bbfcda5a42fce998b to your computer and use it in GitHub Desktop.
Qt5 Fusion style (dark color palette)
qApp->setStyle(QStyleFactory::create("fusion"));
QPalette palette;
palette.setColor(QPalette::Window, QColor(53,53,53));
palette.setColor(QPalette::WindowText, Qt::white);
palette.setColor(QPalette::Base, QColor(15,15,15));
palette.setColor(QPalette::AlternateBase, QColor(53,53,53));
palette.setColor(QPalette::ToolTipBase, Qt::white);
palette.setColor(QPalette::ToolTipText, Qt::white);
palette.setColor(QPalette::Text, Qt::white);
palette.setColor(QPalette::Button, QColor(53,53,53));
palette.setColor(QPalette::ButtonText, Qt::white);
palette.setColor(QPalette::BrightText, Qt::red);
palette.setColor(QPalette::Highlight, QColor(142,45,197).lighter());
palette.setColor(QPalette::HighlightedText, Qt::black);
palette.setColor(QPalette::Disabled, QPalette::Text, Qt::darkGray);
palette.setColor(QPalette::Disabled, QPalette::ButtonText, Qt::darkGray);
qApp->setPalette(palette);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment