-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmiundostack.cpp
More file actions
56 lines (45 loc) · 1.06 KB
/
miundostack.cpp
File metadata and controls
56 lines (45 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "miundostack.h"
#include <QPair>
#include <QDebug>
MiUndoStack::MiUndoStack(QObject *parent):QUndoStack(parent)
{
}
QStringList MiUndoStack::LeeRuta()
{
return m_pilaposiciones.pop().first;
/*QPair<QStringList,int> dato = m_pilarutas.pop();
return dato.first;*/
}
int MiUndoStack::LeeTablaMedCertActiva()
{
/*QPair<QStringList,int> dato = m_pilarutas.pop();
return dato.second;*/
return m_pilaposiciones.pop().second;
}
MiUndoStack::POSICION MiUndoStack::LeePosicion()
{
return m_pilaposiciones.pop();
}
void MiUndoStack::GuardarPosicion(const QStringList &ruta, int tablamedcertactiva)
{
//QPair<QStringList,int>dato(ruta,tablamedcertactiva);
m_pilaposiciones.push(qMakePair(ruta,tablamedcertactiva));
}
int MiUndoStack::tamanno()
{
return m_pilaposiciones.size();
}
void MiUndoStack::Undo()
{
undo();
}
void MiUndoStack::Redo()
{
redo();
}
void MiUndoStack::Push(const QStringList &ruta, int tablaactiva, QUndoCommand *comando)
{
GuardarPosicion(ruta,tablaactiva);
push(comando);
//qDebug()<<"Pushhh";
}