From: Manuel Nickschas Date: Wed, 29 Jul 2009 21:50:05 +0000 (+0200) Subject: Don't reset FontSelector font on style change X-Git-Tag: 0.5-rc1~110 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=7a30024fa1fe4e09902f2fd7fc9022b427376dd4 Don't reset FontSelector font on style change Qt resets the font of all widgets if the application stylesheet is set. Thus, we intercept the ChangeEvent and restore the custom font for FontSelector. --- diff --git a/src/uisupport/fontselector.cpp b/src/uisupport/fontselector.cpp index 6330693e..8a53551b 100644 --- a/src/uisupport/fontselector.cpp +++ b/src/uisupport/fontselector.cpp @@ -18,8 +18,9 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include +#include #include +#include #include #include @@ -68,3 +69,10 @@ void FontSelector::chooseFont() { } } +void FontSelector::changeEvent(QEvent *e) { + if(e->type() == QEvent::StyleChange) { + _demo->setFont(_font); + } +} + + diff --git a/src/uisupport/fontselector.h b/src/uisupport/fontselector.h index d7ca9e18..60d27776 100644 --- a/src/uisupport/fontselector.h +++ b/src/uisupport/fontselector.h @@ -43,6 +43,9 @@ public slots: signals: void fontChanged(const QFont &); +protected: + void changeEvent(QEvent *e); + protected slots: void chooseFont();