Skip to content

Instantly share code, notes, and snippets.

@xeyvezy
Forked from QuantumCD/Qt 5 Dark Fusion Palette
Last active May 14, 2018 17:24
Show Gist options
  • Select an option

  • Save xeyvezy/605e6403106c13a69bba65131edc126f to your computer and use it in GitHub Desktop.

Select an option

Save xeyvezy/605e6403106c13a69bba65131edc126f to your computer and use it in GitHub Desktop.
dark color palette for the Qt 5 Fusion theme, put in your main function before showing the parent window. Child windows should automatically inherit the palette unless you explicitly change this behavior.
qApp->setStyle(QStyleFactory::create("Fusion"));
QPalette darkPalette;
darkPalette.setColor(QPalette::Window, QColor(53,53,53));
darkPalette.setColor(QPalette::WindowText, Qt::white);
darkPalette.setColor(QPalette::Base, QColor(25,25,25));
darkPalette.setColor(QPalette::AlternateBase, QColor(53,53,53));
darkPalette.setColor(QPalette::ToolTipBase, Qt::white);
darkPalette.setColor(QPalette::ToolTipText, Qt::white);
darkPalette.setColor(QPalette::Text, Qt::white);
darkPalette.setColor(QPalette::Button, QColor(53,53,53));
darkPalette.setColor(QPalette::ButtonText, Qt::white);
darkPalette.setColor(QPalette::BrightText, Qt::red);
darkPalette.setColor(QPalette::Link, QColor(42, 130, 218));
darkPalette.setColor(QPalette::Highlight, QColor(42, 130, 218));
darkPalette.setColor(QPalette::HighlightedText, Qt::black);
qApp->setPalette(darkPalette);
qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment