summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-08-15 14:00:25 +0200
committerMarc Mutz <marc.mutz@kdab.com>2019-08-22 12:10:10 +0200
commit36cf237ea1ca1522e37c3d4e66f08dc00bc3295d (patch)
treec7f208d260265c3e386caee3d571ce7f9cad029f /src/widgets/kernel
parent2dee00621632ab8acd0b3d59bdba264afe2f32c1 (diff)
QWidget: two small fixes
- Use QPointer::data() instead of a C-style cast - Remove an abuse of Q_UNLIKELY. Q_UNLIKELY is for error code. Using it for conditions that have a good chance of being true in normal operations just caused all the error handling code to be paged in needlessly. Change-Id: I542a5b938b032ca84f2cf1f78fbc45049a12ad1a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qwidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index d098d9cc04..049ddb0213 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -6181,7 +6181,7 @@ void QWidget::setFocusProxy(QWidget * w)
QWidget *QWidget::focusProxy() const
{
Q_D(const QWidget);
- return d->extra ? (QWidget *)d->extra->focus_proxy : nullptr;
+ return d->extra ? d->extra->focus_proxy.data() : nullptr;
}
@@ -11932,7 +11932,7 @@ QOpenGLContext *QWidgetPrivate::shareContext() const
#ifdef QT_NO_OPENGL
return 0;
#else
- if (Q_UNLIKELY(!extra || !extra->topextra || !extra->topextra->window))
+ if (!extra || !extra->topextra || !extra->topextra->window)
return 0;
if (!extra->topextra->shareContext) {