diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-03-01 11:16:51 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-03-03 14:12:08 +0100 |
commit | 4daf83a0dc05f944c066237aa95c388f29ce890a (patch) | |
tree | acfdd3561897e878f551b88b9e6834b533b4afd3 /src/widgets/styles | |
parent | 4a037e86d4d2808634294daa7adb9d7523dfa3b9 (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.
Pick-to: 6.1
Change-Id: I8fc458b7e9ba8904ec7a3b1c26aac0628e336ea2
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
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)); } } |