From 322e5b7f5e35db73f7d7730a6fff558e153ad356 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Wed, 18 Dec 2019 16:05:52 +0100 Subject: QtWidget docs: small fixes Apply some minor fixes to the widget docs - use nullptr - use c++11 initializer list - properly delete widget when cleaning the layout (QTBUG-29471) - rework CardLayout example to make it work with Qt5 Fixes: QTBUG-29471 Change-Id: Ie2ee9f75eb8faf97d2bbd2c25e7013d4f30d8dd0 Reviewed-by: Friedemann Kleint Reviewed-by: Paul Wicking --- src/widgets/doc/snippets/code/src_gui_kernel_qlayoutitem.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/widgets/doc/snippets/code/src_gui_kernel_qlayoutitem.cpp') diff --git a/src/widgets/doc/snippets/code/src_gui_kernel_qlayoutitem.cpp b/src/widgets/doc/snippets/code/src_gui_kernel_qlayoutitem.cpp index d9f70b91ed..dd0f860c01 100644 --- a/src/widgets/doc/snippets/code/src_gui_kernel_qlayoutitem.cpp +++ b/src/widgets/doc/snippets/code/src_gui_kernel_qlayoutitem.cpp @@ -52,8 +52,7 @@ int MyLayout::heightForWidth(int w) const { if (cache_dirty || cached_width != w) { - // not all C++ compilers support "mutable" - MyLayout *that = (MyLayout*)this; + MyLayout *that = const_cast(this); int h = calculateHeightForWidth(w); that->cached_hfw = h; return h; -- cgit v1.2.3