2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2011-02-22 12:08:19 +01:00
|
|
|
|
2010-11-24 14:52:06 +01:00
|
|
|
#include "pixmapchangedcommand.h"
|
|
|
|
|
|
2012-08-06 13:42:46 +02:00
|
|
|
#include <QDebug>
|
2010-11-24 14:52:06 +01:00
|
|
|
|
|
|
|
|
#include <QVarLengthArray>
|
|
|
|
|
|
2016-08-03 23:29:58 +03:00
|
|
|
#include <algorithm>
|
|
|
|
|
|
2010-11-24 14:52:06 +01:00
|
|
|
namespace QmlDesigner {
|
|
|
|
|
|
2018-07-24 23:56:45 +02:00
|
|
|
PixmapChangedCommand::PixmapChangedCommand() = default;
|
2010-11-24 14:52:06 +01:00
|
|
|
|
2010-11-30 21:32:52 +01:00
|
|
|
PixmapChangedCommand::PixmapChangedCommand(const QVector<ImageContainer> &imageVector)
|
|
|
|
|
: m_imageVector(imageVector)
|
2010-11-24 14:52:06 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-30 21:32:52 +01:00
|
|
|
QVector<ImageContainer> PixmapChangedCommand::images() const
|
2010-11-24 14:52:06 +01:00
|
|
|
{
|
2010-11-30 21:32:52 +01:00
|
|
|
return m_imageVector;
|
2010-11-24 14:52:06 +01:00
|
|
|
}
|
|
|
|
|
|
2013-07-04 17:06:31 +02:00
|
|
|
void PixmapChangedCommand::sort()
|
|
|
|
|
{
|
2016-08-03 23:29:58 +03:00
|
|
|
std::sort(m_imageVector.begin(), m_imageVector.end());
|
2013-07-04 17:06:31 +02:00
|
|
|
}
|
|
|
|
|
|
2010-11-24 14:52:06 +01:00
|
|
|
QDataStream &operator<<(QDataStream &out, const PixmapChangedCommand &command)
|
|
|
|
|
{
|
2010-11-30 21:32:52 +01:00
|
|
|
out << command.images();
|
2010-11-24 14:52:06 +01:00
|
|
|
|
|
|
|
|
return out;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QDataStream &operator>>(QDataStream &in, PixmapChangedCommand &command)
|
|
|
|
|
{
|
2010-11-30 21:32:52 +01:00
|
|
|
in >> command.m_imageVector;
|
2010-11-24 14:52:06 +01:00
|
|
|
|
|
|
|
|
return in;
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-04 17:06:31 +02:00
|
|
|
bool operator ==(const PixmapChangedCommand &first, const PixmapChangedCommand &second)
|
|
|
|
|
{
|
|
|
|
|
return first.m_imageVector == second.m_imageVector;
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-16 17:00:07 +02:00
|
|
|
QDebug operator <<(QDebug debug, const PixmapChangedCommand &command)
|
|
|
|
|
{
|
|
|
|
|
return debug.nospace() << "PixmapChangedCommand(" << command.images() << ")";
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-24 14:52:06 +01:00
|
|
|
} // namespace QmlDesigner
|