diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-05-24 22:06:09 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-08-20 17:36:04 +0200 |
commit | f556505f63a4255b681ba8a32e1f29ccb79725ce (patch) | |
tree | 6587436330c3e8eda6960689b6a31406f27009a4 /src/widgets/kernel/qshortcut.cpp | |
parent | 9e86fdb6e8004a0eba7d5f4b9a7b1f52275fd207 (diff) |
QWidget: replace manual memory management with unique_ptr [6/N]: extra
Had to port a lot of caching temporaries, too. Decided to leave them as
crefs to unique_ptr to catch any mischief users may be doing with the
raw pointer instead (like deleting it).
Also fixed a use of 0 as nullptr (by standardizing on pointer-to-bool
conversion, as is done everywhere else in qwidget.cpp), and made one
impregnable if condition readable.
Change-Id: Ifdc240bf352c52de0bc3c186fa7a5f4cb2882dd0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/kernel/qshortcut.cpp')
-rw-r--r-- | src/widgets/kernel/qshortcut.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp index a4ebcdfc84..39b08dbc1e 100644 --- a/src/widgets/kernel/qshortcut.cpp +++ b/src/widgets/kernel/qshortcut.cpp @@ -178,7 +178,7 @@ static bool correctWidgetContext(Qt::ShortcutContext context, QWidget *w, QWidge // Below is Qt::WindowShortcut context QWidget *tlw = w->window(); #if QT_CONFIG(graphicsview) - if (auto topData = static_cast<QWidgetPrivate *>(QObjectPrivate::get(tlw))->extra) { + if (auto topData = static_cast<QWidgetPrivate *>(QObjectPrivate::get(tlw))->extra.get()) { if (topData->proxyWidget) { bool res = correctGraphicsWidgetContext(context, topData->proxyWidget, active_window); return res; |