SVN commit 1030634 by mart: apparently if the label is hidden it doesn't receive font change events, so at show event i have to check if the font is different from QApplication::font() :/ now: is this the intended behaviour of qt or is a bug? CCMAIL:plasma-devel@kde.org
M +11 -1 label.cpp M +1 -0 label.h --- trunk/KDE/kdelibs/plasma/widgets/label.cpp #1030633:1030634 @@ -19,6 +19,7 @@ #include "label.h" +#include <QApplication> #include <QLabel> #include <QPainter> #include <QDir> @@ -293,7 +294,7 @@ void Label::changeEvent(QEvent *event) { - if (event->type() == QEvent::FontChange) { + if (event->type() == QEvent::FontChange && font() != QApplication::font()) { d->customFont = true; nativeWidget()->setFont(font()); } @@ -301,6 +302,15 @@ QGraphicsProxyWidget::changeEvent(event); } +bool Label::event(QEvent *event) +{ + if (event->type() == QEvent::Show && font() != QApplication::font()) { + d->customFont = true; + nativeWidget()->setFont(font()); + } + return QGraphicsProxyWidget::event(event); +} + } // namespace Plasma #include <label.moc> --- trunk/KDE/kdelibs/plasma/widgets/label.h #1030633:1030634 @@ -151,6 +151,7 @@ const QStyleOptionGraphicsItem *option, QWidget *widget); void changeEvent(QEvent *event); + bool event(QEvent *event); private: Q_PRIVATE_SLOT(d, void setPalette()) _______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel