forked from qt-creator/qt-creator
QmlPuppet: Refactor ChangeAuxiliaryCommand
Change-Id: I32eb04db96322883aa908e22724756f5e25ded09 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
@@ -29,35 +29,9 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
ChangeAuxiliaryCommand::ChangeAuxiliaryCommand() = default;
|
||||
|
||||
ChangeAuxiliaryCommand::ChangeAuxiliaryCommand(const QVector<PropertyValueContainer> &auxiliaryChangeVector)
|
||||
: m_auxiliaryChangeVector (auxiliaryChangeVector)
|
||||
{
|
||||
}
|
||||
|
||||
QVector<PropertyValueContainer> ChangeAuxiliaryCommand::auxiliaryChanges() const
|
||||
{
|
||||
return m_auxiliaryChangeVector;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &out, const ChangeAuxiliaryCommand &command)
|
||||
{
|
||||
out << command.auxiliaryChanges();
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &in, ChangeAuxiliaryCommand &command)
|
||||
{
|
||||
in >> command.m_auxiliaryChangeVector;
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
QDebug operator <<(QDebug debug, const ChangeAuxiliaryCommand &command)
|
||||
{
|
||||
return debug.nospace() << "ChangeAuxiliaryCommand(auxiliaryChanges: " << command.m_auxiliaryChangeVector << ")";
|
||||
return debug.nospace() << "ChangeAuxiliaryCommand(auxiliaryChanges: " << command.auxiliaryChanges << ")";
|
||||
}
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QDataStream>
|
||||
#include <QDebug>
|
||||
#include <QMetaType>
|
||||
#include <QVector>
|
||||
|
||||
@@ -34,24 +36,24 @@ namespace QmlDesigner {
|
||||
|
||||
class ChangeAuxiliaryCommand
|
||||
{
|
||||
friend QDataStream &operator>>(QDataStream &in, ChangeAuxiliaryCommand &command);
|
||||
public:
|
||||
friend QDataStream &operator>>(QDataStream &in, ChangeAuxiliaryCommand &command)
|
||||
{
|
||||
in >> command.auxiliaryChanges;
|
||||
return in;
|
||||
}
|
||||
|
||||
friend QDataStream &operator<<(QDataStream &out, const ChangeAuxiliaryCommand &command)
|
||||
{
|
||||
out << command.auxiliaryChanges;
|
||||
return out;
|
||||
}
|
||||
|
||||
friend QDebug operator <<(QDebug debug, const ChangeAuxiliaryCommand &command);
|
||||
|
||||
public:
|
||||
ChangeAuxiliaryCommand();
|
||||
explicit ChangeAuxiliaryCommand(const QVector<PropertyValueContainer> &auxiliaryChangeVector);
|
||||
|
||||
QVector<PropertyValueContainer> auxiliaryChanges() const;
|
||||
|
||||
private:
|
||||
QVector<PropertyValueContainer> m_auxiliaryChangeVector;
|
||||
QVector<PropertyValueContainer> auxiliaryChanges;
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &out, const ChangeAuxiliaryCommand &command);
|
||||
QDataStream &operator>>(QDataStream &in, ChangeAuxiliaryCommand &command);
|
||||
|
||||
QDebug operator <<(QDebug debug, const ChangeAuxiliaryCommand &command);
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
||||
Q_DECLARE_METATYPE(QmlDesigner::ChangeAuxiliaryCommand)
|
||||
|
||||
Reference in New Issue
Block a user