aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquicktextarea.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-09-11 11:56:39 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-09-11 11:32:02 +0000
commitd3aef722da533c3b100ba653498c79986a44c9f9 (patch)
tree57e4ab278c69271e8d956d233037c93803123084 /src/quicktemplates2/qquicktextarea.cpp
parentdc39818207439a62a97179b8d2ad22ef49521148 (diff)
Fix font inheritance
In item views, it can happen during incubation that a control doesn't yet have a window associated when the parent item changes. Therefore we must make sure to resolve the font when the window changes. Task-number: QTBUG-63119 Change-Id: I890f70ae6faa232dcc2c094ccec02e76b371d2cb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquicktextarea.cpp')
-rw-r--r--src/quicktemplates2/qquicktextarea.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/quicktemplates2/qquicktextarea.cpp b/src/quicktemplates2/qquicktextarea.cpp
index afc2932c..24011505 100644
--- a/src/quicktemplates2/qquicktextarea.cpp
+++ b/src/quicktemplates2/qquicktextarea.cpp
@@ -622,17 +622,19 @@ void QQuickTextArea::itemChange(QQuickItem::ItemChange change, const QQuickItem:
{
Q_D(QQuickTextArea);
QQuickTextEdit::itemChange(change, value);
- if (change == ItemParentHasChanged && value.item) {
+ if ((change == ItemParentHasChanged && value.item) || (change == ItemSceneChange && value.window)) {
d->resolveFont();
#if QT_CONFIG(quicktemplates2_hover)
if (!d->explicitHoverEnabled)
d->updateHoverEnabled(QQuickControlPrivate::calcHoverEnabled(d->parentItem), false); // explicit=false
#endif
- QQuickFlickable *flickable = qobject_cast<QQuickFlickable *>(value.item->parentItem());
- if (flickable) {
- QQuickScrollView *scrollView = qobject_cast<QQuickScrollView *>(flickable->parentItem());
- if (scrollView)
- d->attachFlickable(flickable);
+ if (change == ItemParentHasChanged) {
+ QQuickFlickable *flickable = qobject_cast<QQuickFlickable *>(value.item->parentItem());
+ if (flickable) {
+ QQuickScrollView *scrollView = qobject_cast<QQuickScrollView *>(flickable->parentItem());
+ if (scrollView)
+ d->attachFlickable(flickable);
+ }
}
}
}