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 "informationchangedcommand.h"
|
|
|
|
|
|
|
|
|
|
#include <QMetaType>
|
2013-07-16 17:00:07 +02:00
|
|
|
#include <QtDebug>
|
2010-11-24 14:52:06 +01:00
|
|
|
|
|
|
|
|
#include "propertyvaluecontainer.h"
|
|
|
|
|
|
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
|
|
|
InformationChangedCommand::InformationChangedCommand() = default;
|
2010-11-24 14:52:06 +01:00
|
|
|
|
|
|
|
|
InformationChangedCommand::InformationChangedCommand(const QVector<InformationContainer> &informationVector)
|
|
|
|
|
: m_informationVector(informationVector)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QVector<InformationContainer> InformationChangedCommand::informations() const
|
|
|
|
|
{
|
|
|
|
|
return m_informationVector;
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-04 17:06:31 +02:00
|
|
|
void InformationChangedCommand::sort()
|
|
|
|
|
{
|
2016-08-03 23:29:58 +03:00
|
|
|
std::sort(m_informationVector.begin(), m_informationVector.end());
|
2013-07-04 17:06:31 +02:00
|
|
|
}
|
|
|
|
|
|
2010-11-24 14:52:06 +01:00
|
|
|
QDataStream &operator<<(QDataStream &out, const InformationChangedCommand &command)
|
|
|
|
|
{
|
|
|
|
|
out << command.informations();
|
|
|
|
|
|
|
|
|
|
return out;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QDataStream &operator>>(QDataStream &in, InformationChangedCommand &command)
|
|
|
|
|
{
|
|
|
|
|
in >> command.m_informationVector;
|
|
|
|
|
|
|
|
|
|
return in;
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-04 17:06:31 +02:00
|
|
|
bool operator ==(const InformationChangedCommand &first, const InformationChangedCommand &second)
|
|
|
|
|
{
|
|
|
|
|
return first.m_informationVector == second.m_informationVector;
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-16 17:00:07 +02:00
|
|
|
QDebug operator <<(QDebug debug, const InformationChangedCommand &command)
|
|
|
|
|
{
|
|
|
|
|
return debug.nospace() << "InformationChangedCommand(" << command.informations() << ")";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2010-11-24 14:52:06 +01:00
|
|
|
} // namespace QmlDesigner
|