Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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);
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; }");
@dridk

This comment has been minimized.

Show comment Hide comment
@dridk

dridk Jun 14, 2014

Screenshot please!

dridk commented Jun 14, 2014

Screenshot please!

@ghost

This comment has been minimized.

Show comment Hide comment
@ghost

ghost Oct 5, 2014

Imgur

ghost commented Oct 5, 2014

Imgur

@solarkraft

This comment has been minimized.

Show comment Hide comment
@solarkraft

solarkraft Oct 11, 2014

Looks great!

Looks great!

@SebastienBloesch

This comment has been minimized.

Show comment Hide comment
@SebastienBloesch

SebastienBloesch Feb 22, 2015

Thank you

Thank you

@oaeide

This comment has been minimized.

Show comment Hide comment
@oaeide

oaeide Feb 28, 2015

Wow! This is great stuff. The only thing that isn't perfect out of the box is that deactivated buttons look the same as clickable ones. Otherwise - love it.

oaeide commented Feb 28, 2015

Wow! This is great stuff. The only thing that isn't perfect out of the box is that deactivated buttons look the same as clickable ones. Otherwise - love it.

@lschmierer

This comment has been minimized.

Show comment Hide comment
@ghost

This comment has been minimized.

Show comment Hide comment
@ghost

ghost Apr 23, 2015

beautiful :))

ghost commented Apr 23, 2015

beautiful :))

@obiwankennedy

This comment has been minimized.

Show comment Hide comment
@obiwankennedy

obiwankennedy Dec 4, 2015

darkPalette.setColor(QPalette::ToolTipBase, Qt::white);
darkPalette.setColor(QPalette::ToolTipText, Qt::white);

Why do you set both as white and then add qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }"); ?

darkPalette.setColor(QPalette::ToolTipBase, Qt::white);
darkPalette.setColor(QPalette::ToolTipText, Qt::white);

Why do you set both as white and then add qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }"); ?

@macdew

This comment has been minimized.

Show comment Hide comment
@macdew

macdew Apr 27, 2017

Very cool! One thing I spotted was that tab control are a bit black-on-black... Would be nice if the tabs themselves could be shaded a bit differently.

macdew commented Apr 27, 2017

Very cool! One thing I spotted was that tab control are a bit black-on-black... Would be nice if the tabs themselves could be shaded a bit differently.

@Jorgen-VikingGod

This comment has been minimized.

Show comment Hide comment
@Jorgen-VikingGod

Jorgen-VikingGod Aug 11, 2017

In my repo you can find similar palette and addition some stylesheets to make everything look dark, sexy and great 😃
https://github.com/Jorgen-VikingGod/Qt-Frameless-Window-DarkStyle

In my repo you can find similar palette and addition some stylesheets to make everything look dark, sexy and great 😃
https://github.com/Jorgen-VikingGod/Qt-Frameless-Window-DarkStyle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment