diff --git a/src/gui/painting/qcolortrc_p.h b/src/gui/painting/qcolortrc_p.h index f86d9e86218..d1ad1987dfe 100644 --- a/src/gui/painting/qcolortrc_p.h +++ b/src/gui/painting/qcolortrc_p.h @@ -25,12 +25,11 @@ QT_BEGIN_NAMESPACE class Q_GUI_EXPORT QColorTrc { public: - QColorTrc() noexcept : m_type(Type::Uninitialized) - { } - QColorTrc(const QColorTransferFunction &fun) : m_type(Type::Function), m_fun(fun) - { } - QColorTrc(const QColorTransferTable &table) : m_type(Type::Table), m_table(table) - { } + QColorTrc() noexcept : m_type(Type::Uninitialized) { } + QColorTrc(const QColorTransferFunction &fun) : m_type(Type::Function), m_fun(fun) { } + QColorTrc(const QColorTransferTable &table) : m_type(Type::Table), m_table(table) { } + QColorTrc(QColorTransferFunction &&fun) noexcept : m_type(Type::Function), m_fun(std::move(fun)) { } + QColorTrc(QColorTransferTable &&table) noexcept : m_type(Type::Table), m_table(std::move(table)) { } enum class Type { Uninitialized, diff --git a/src/gui/painting/qicc.cpp b/src/gui/painting/qicc.cpp index 48555702617..bd47efdfc0d 100644 --- a/src/gui/painting/qicc.cpp +++ b/src/gui/painting/qicc.cpp @@ -549,7 +549,7 @@ static quint32 parseTRC(const QByteArrayView &tagData, QColorTrc &gamma, QColorT static_assert(sizeof(GenericTagData) == 2 * sizeof(quint32_be), "GenericTagData has padding. The following code is a subject to UB."); qFromBigEndian(tagData.constData() + valueOffset, curv.valueCount, tabl.data()); - QColorTransferTable table = QColorTransferTable(curv.valueCount, std::move(tabl), type); + QColorTransferTable table(curv.valueCount, tabl, type); QColorTransferFunction curve; if (!table.checkValidity()) { qCWarning(lcIcc) << "Invalid curv table";