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.
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#include <QHBoxLayout>
+#include <QEvent>
#include <QFontDialog>
+#include <QHBoxLayout>
#include <QLabel>
#include <QPushButton>
}
}
+void FontSelector::changeEvent(QEvent *e) {
+ if(e->type() == QEvent::StyleChange) {
+ _demo->setFont(_font);
+ }
+}
+
+
signals:
void fontChanged(const QFont &);
+protected:
+ void changeEvent(QEvent *e);
+
protected slots:
void chooseFont();