2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-02-22 12:08:19 +01:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** Copyright (C) 2015 The Qt Company Ltd.
|
|
|
|
** Contact: http://www.qt.io/licensing
|
2011-02-22 12:08:19 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-02-22 12:08:19 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2015-01-14 18:07:15 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms and
|
|
|
|
** conditions see http://www.qt.io/terms-conditions. For further information
|
2014-10-01 13:21:18 +02:00
|
|
|
** use the contact form at http://www.qt.io/contact-us.
|
2011-02-22 12:08:19 +01:00
|
|
|
**
|
2015-09-18 11:34:48 +02:00
|
|
|
** GNU General Public License Usage
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
** General Public License version 3.0 as published by the Free Software
|
|
|
|
** Foundation and appearing in the file LICENSE.GPLv3 included in the
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
** ensure the GNU General Public License version 3.0 requirements will be
|
|
|
|
** met: http://www.gnu.org/copyleft/gpl.html.
|
2011-02-22 12:08:19 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
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>
|
|
|
|
|
|
|
|
namespace QmlDesigner {
|
|
|
|
|
|
|
|
PixmapChangedCommand::PixmapChangedCommand()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
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()
|
|
|
|
{
|
|
|
|
qSort(m_imageVector);
|
|
|
|
}
|
|
|
|
|
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
|