QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
sortterminalstripcommand.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 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 SORTTERMINALSTRIPCOMMAND_H
19#define SORTTERMINALSTRIPCOMMAND_H
20
21#include <QUndoCommand>
22#include <QPointer>
23#include <QVector>
24
25class TerminalStrip;
27
33class SortTerminalStripCommand : public QUndoCommand
34{
35 public:
36 SortTerminalStripCommand(TerminalStrip *strip, QUndoCommand *parent = nullptr);
37
38 void undo() override;
39 void redo() override;
40
41 private:
42 void sort();
43
44 private:
45 QPointer<TerminalStrip> m_strip;
46 QVector<QSharedPointer<PhysicalTerminal>> m_old_order,
48};
49
50#endif // SORTTERMINALSTRIPCOMMAND_H
The PhysicalTerminal class Represent a physical terminal. A physical terminal is composed a least by ...
Definition physicalterminal.h:62
The SortTerminalStripCommand class An undo command use to sort the terminals element who compose a te...
Definition sortterminalstripcommand.h:34
QVector< QSharedPointer< PhysicalTerminal > > m_old_order
Definition sortterminalstripcommand.h:46
QPointer< TerminalStrip > m_strip
Definition sortterminalstripcommand.h:45
void undo() override
Definition sortterminalstripcommand.cpp:33
QVector< QSharedPointer< PhysicalTerminal > > m_new_order
Definition sortterminalstripcommand.h:47
void sort()
Definition sortterminalstripcommand.cpp:47
void redo() override
Definition sortterminalstripcommand.cpp:40
The TerminalStrip class This class hold all the datas and configurations of a terminal strip (but the...
Definition terminalstrip.h:45