diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-06-06 00:27:44 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-07-13 01:32:53 +0200 |
commit | 43fa292ff621550d0977908b499fb54096251825 (patch) | |
tree | 7f4f06e5dc4f70dc01080ac2b78a4c617172c1b5 /src/gui/text/qtextformat.cpp | |
parent | 23444d4b26a13677a2029a2b5a53bfae76647b71 (diff) | |
download | qtbase-43fa292ff621550d0977908b499fb54096251825.tar.gz |
QVariant::setValue(): enable move semantics
Given we optimize for the case where the new value is of the
same type of the one already stored in the variant, enable move
assignment for that case.
As a drive-by, avoid a path to detach() for data() if we know
we're detached.
Change-Id: I9abbdc10637ce77ebb747b49d83e1ef914d997bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/text/qtextformat.cpp')
-rw-r--r-- | src/gui/text/qtextformat.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index 58c318bcbf..d12f7e152d 100644 --- a/src/gui/text/qtextformat.cpp +++ b/src/gui/text/qtextformat.cpp @@ -2122,7 +2122,7 @@ void QTextBlockFormat::setTabPositions(const QList<QTextOption::Tab> &tabs) QList<QTextOption::Tab>::ConstIterator iter = tabs.constBegin(); while (iter != tabs.constEnd()) { QVariant v; - v.setValue<QTextOption::Tab>(*iter); + v.setValue(*iter); list.append(v); ++iter; } |