aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates/qquickcontrol.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-12-03 13:23:27 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-12-03 17:18:26 +0000
commite3adcf27372e571f9ca032c736e2bb40a5346d49 (patch)
treea3a3e025d4252967a75a4cd2b654617458973831 /src/templates/qquickcontrol.cpp
parentc09b3365feab8434ffd45ad5d9882142ce57c830 (diff)
QQuickApplicationWindow: add font property
Change-Id: I6f946994f789704aa2efa94aaea0129d0d73d005 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/templates/qquickcontrol.cpp')
-rw-r--r--src/templates/qquickcontrol.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/templates/qquickcontrol.cpp b/src/templates/qquickcontrol.cpp
index 908abeda..0b8c3067 100644
--- a/src/templates/qquickcontrol.cpp
+++ b/src/templates/qquickcontrol.cpp
@@ -44,6 +44,7 @@
#include "qquicktextarea_p_p.h"
#include "qquicktextfield_p.h"
#include "qquicktextfield_p_p.h"
+#include "qquickapplicationwindow_p.h"
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/qpa/qplatformtheme.h>
@@ -218,15 +219,22 @@ QFont QQuickControlPrivate::naturalControlFont(const QQuickItem *q)
}
QQuickItem *p = q->parentItem();
+ bool found = false;
while (p) {
if (QQuickControl *qc = qobject_cast<QQuickControl *>(p)) {
naturalFont = qc->font();
+ found = true;
break;
}
p = p->parentItem();
}
+ if (!found) {
+ if (QQuickApplicationWindow *w = qobject_cast<QQuickApplicationWindow *>(q->window()))
+ naturalFont = w->font();
+ }
+
naturalFont.resolve(0);
return naturalFont;
}