Skip to content

Instantly share code, notes, and snippets.

View echostorm's full-sized avatar
💭
Sudo like me.

echostorm

💭
Sudo like me.
View GitHub Profile
@echostorm
echostorm / Qt 5 Dark Fusion Palette
Created March 10, 2016 18:07 — forked from QuantumCD/Qt 5 Dark Fusion Palette
This is a complete (I think) dark color palette for the Qt 5 Fusion theme, as well as a nice style sheet for the tool tips that make them blend better with the rest of the theme. To have immediate effect, be sure to put this in your main function before showing the parent window. Child windows should automatically inherit the palette unless you …
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);
@echostorm
echostorm / mainwindow.cpp
Created March 10, 2016 18:06 — forked from QuantumCD/mainwindow.cpp
Skeleton to switch a QMainWindow's palette, as well as all the child widgets' palette (can be used for dynamic theming)
// The button clicked events can be replaced with any slots, and/or you can define the
// switchPalette() to be a slot to use with QObject::connect()
// Dark Palette push button
void MainWindow::on_switchToDarkTheme_clicked()
{
this->switchPalette(darkPalette);
}
// Light palette push button