diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-03-01 11:16:51 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-03-03 23:35:25 +0000 |
commit | 5af06405a61a571fd79f186bf535d9fab957bec1 (patch) | |
tree | 730f71ebde748a041d5a1c3406671e19c2d95798 /src/widgets/styles | |
parent | cfe5b1b8dd04b98a229b53bb1474cae2b5731395 (diff) |
Don't access data in moved-from object
It's undefined behavior, esp since we leave it to the compiler to
implement a move constructor for the ButtonInfo struct. So read the data
that we need first.
Fixes static analyzer warning
de76eedae524c86f89d6369c0f5af8c7.
Change-Id: I8fc458b7e9ba8904ec7a3b1c26aac0628e336ea2
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 4daf83a0dc05f944c066237aa95c388f29ce890a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index a200cc0cd1..cef61763ee 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -863,9 +863,9 @@ QHash<QStyle::SubControl, QRect> QStyleSheetStyle::titleBarLayout(const QWidget info.rule = subRule; info.offset = offsets[where]; info.where = where; - infos.append(std::move(info)); - offsets[where] += info.width; + + infos.append(std::move(info)); } } |