diff options
Diffstat (limited to 'src/widgets/doc/snippets/code/src_gui_kernel_qlayoutitem.cpp')
-rw-r--r-- | src/widgets/doc/snippets/code/src_gui_kernel_qlayoutitem.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
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<MyLayout *>(this); int h = calculateHeightForWidth(w); that->cached_hfw = h; return h; |