QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
setautonumcontextcommand.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2026 The QElectroTech Team
3 This file is part of QElectroTech.
4
5 QElectroTech is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9
10 QElectroTech is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef SETAUTONUMCONTEXTCOMMAND_H
19#define SETAUTONUMCONTEXTCOMMAND_H
20
22
23#include <QUndoCommand>
24#include <functional>
25
35class SetAutoNumContextCommand : public QUndoCommand
36{
37 public:
38 using Setter = std::function<void(const QString &, const NumerotationContext &)>;
39
41 Setter setter,
42 const QString &key,
43 const NumerotationContext &old_context,
44 const NumerotationContext &new_context,
45 QUndoCommand *parent = nullptr);
46
47 void undo() override;
48 void redo() override;
49
50 private:
52 QString m_key;
55};
56
57#endif // SETAUTONUMCONTEXTCOMMAND_H
Definition numerotationcontext.h:31
SetAutoNumContextCommand(Setter setter, const QString &key, const NumerotationContext &old_context, const NumerotationContext &new_context, QUndoCommand *parent=nullptr)
SetAutoNumContextCommand::SetAutoNumContextCommand.
Definition setautonumcontextcommand.cpp:31
QString m_key
Definition setautonumcontextcommand.h:52
NumerotationContext m_new_context
Definition setautonumcontextcommand.h:54
NumerotationContext m_old_context
Definition setautonumcontextcommand.h:53
Setter m_setter
Definition setautonumcontextcommand.h:51
std::function< void(const QString &, const NumerotationContext &)> Setter
Definition setautonumcontextcommand.h:38
void undo() override
Definition setautonumcontextcommand.cpp:49
void redo() override
Definition setautonumcontextcommand.cpp:44