From kde-commits Tue Sep 30 22:05:37 2014 From: Christoph Feck Date: Tue, 30 Sep 2014 22:05:37 +0000 To: kde-commits Subject: [kcalc/frameworks] /: KF5 port: KGlobalSettings -> event() for font/palette changes Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=141211474712588 Git commit 9dc9ea633d2975a09c693d2e4095253c1e568aca by Christoph Feck. Committed on 24/09/2014 at 23:31. Pushed by cfeck into branch 'frameworks'. KF5 port: KGlobalSettings -> event() for font/palette changes M +19 -4 kcalc.cpp M +1 -0 kcalc.h http://commits.kde.org/kcalc/9dc9ea633d2975a09c693d2e4095253c1e568aca diff --git a/kcalc.cpp b/kcalc.cpp index a2b985b..8b450be 100644 --- a/kcalc.cpp +++ b/kcalc.cpp @@ -159,10 +159,6 @@ KCalculator::KCalculator(QWidget *parent) : setAngle(); setBase(); = - // connections - connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), SLOT(s= etColors())); - connect(KGlobalSettings::self(), SIGNAL(kdisplayFontChanged()), SLOT(setF= onts())); - calc_display->setFocus(); } = @@ -2151,6 +2147,25 @@ void KCalculator::setFonts() { } = //------------------------------------------------------------------------= ------ +// Name: event +// Desc: catch application's palette and font change events +//------------------------------------------------------------------------= ------ +bool KCalculator::event(QEvent *e) { + + switch (e->type()) { + case QEvent::ApplicationFontChange: + setFonts(); + break; + case QEvent::ApplicationPaletteChange: + setColors(); + break; + default: + break; + } + return KXmlGuiWindow::event(e); +} + +//------------------------------------------------------------------------= ------ // Name: setPrecision // Desc: set the precision of the display //------------------------------------------------------------------------= ------ diff --git a/kcalc.h b/kcalc.h index 1e6dc28..7841d72 100644 --- a/kcalc.h +++ b/kcalc.h @@ -116,6 +116,7 @@ public: = private: virtual bool eventFilter(QObject *o, QEvent *e); + virtual bool event(QEvent *e); void updateGeometry(); void setupMainActions(); void setupKeys();