Seamly2D
Code documentation
set_piece_color.h
Go to the documentation of this file.
1 /***************************************************************************
2  ** @file set_piece_color.h
3  ** @author Douglas S Caskey
4  ** @date Jan 1, 2023
5  **
6  ** @copyright
7  ** Copyright (C) 2017 - 2023 Seamly, LLC
8  ** https://github.com/fashionfreedom/seamly2d
9  **
10  ** @brief
11  ** Seamly2D is free software: you can redistribute it and/or modify
12  ** it under the terms of the GNU General Public License as published by
13  ** the Free Software Foundation, either version 3 of the License, or
14  ** (at your option) any later version.
15  **
16  ** Seamly2D is distributed in the hope that it will be useful,
17  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  ** GNU General Public License for more details.
20  **
21  ** You should have received a copy of the GNU General Public License
22  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
23  **************************************************************************/
24 
25 #ifndef SET_PIECE_COLOR_H
26 #define SET_PIECE_COLOR_H
27 
28 #include <qcompilerdetection.h>
29 #include <QMetaObject>
30 #include <QObject>
31 #include <QString>
32 #include <QtGlobal>
33 
34 #include "vundocommand.h"
35 
37 {
38  Q_OBJECT
39 public:
40  SetPieceColor(quint32 id, QString color, VContainer *data,
41  VAbstractPattern *doc, QUndoCommand *parent = nullptr);
42  virtual ~SetPieceColor();
43  virtual void undo() Q_DECL_OVERRIDE;
44  virtual void redo() Q_DECL_OVERRIDE;
45  virtual int id() const Q_DECL_OVERRIDE;
46  quint32 getpieceId() const;
47  QString getColor() const;
48 
49 signals:
50  void updateList(quint32 m_id);
51 
52 private:
53  Q_DISABLE_COPY(SetPieceColor)
54  quint32 m_id;
56  QString m_oldColor;
57  QString m_newColor;
58 
59  void doCmd(QString color);
60 };
61 
62 #endif // SET_PIECE_COLOR_H
QString m_oldColor
virtual int id() const Q_DECL_OVERRIDE
void updateList(quint32 m_id)
virtual void undo() Q_DECL_OVERRIDE
QString m_newColor
VContainer * m_data
QString getColor() const
virtual ~SetPieceColor()
quint32 getpieceId() const
virtual void redo() Q_DECL_OVERRIDE
SetPieceColor(quint32 id, QString color, VContainer *data, VAbstractPattern *doc, QUndoCommand *parent=nullptr)
void doCmd(QString color)
The VContainer class container of all variables.
Definition: vcontainer.h:141
VAbstractPattern * doc
Definition: vundocommand.h:106