scidavis  2.3.0
About: SciDAVis is a free application for Scientific Data Analysis and Visualization (a fork off of QtiPlot).
  Fossies Dox: scidavis-2.3.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

tablecommands.cpp
Go to the documentation of this file.
1 
11 
30 #include "table/tablecommands.h"
31 #include "table/future_Table.h"
32 #include "core/column/Column.h"
33 #include "lib/Interval.h"
35 #include <QObject>
36 #include <QtDebug>
37 
39 // class TableInsertColumnsCmd
41 TableInsertColumnsCmd::TableInsertColumnsCmd( future::Table::Private& private_obj, int before, QList<Column*> cols, QUndoCommand * parent)
42  : QUndoCommand( parent ), d_private_obj(private_obj), d_before(before), d_cols(cols)
43 {
44  setText(QObject::tr("%1: insert %2 column(s)").arg(d_private_obj.name()).arg(d_cols.size()));
45 }
46 
48 {
51 }
52 
54 {
57 }
58 
60 // end of class TableInsertColumnsCmd
62 
64 // class TableSetNumberOfRowsCmd
66 TableSetNumberOfRowsCmd::TableSetNumberOfRowsCmd( future::Table::Private& private_obj, int rows, QUndoCommand * parent )
67  : QUndoCommand( parent ), d_private_obj(private_obj), d_rows(rows)
68 {
69  setText(QObject::tr("%1: set the number of rows to %2").arg(d_private_obj.name()).arg(rows));
70 }
71 
73 {
76 }
77 
79 {
81 }
82 
84 // end of class TableSetNumberOfRowsCmd
86 
88 // class TableRemoveColumnsCmd
90 TableRemoveColumnsCmd::TableRemoveColumnsCmd( future::Table::Private& private_obj, int first, int count, QList<Column*> cols, QUndoCommand * parent )
91  : QUndoCommand( parent ), d_private_obj(private_obj), d_first(first), d_count(count), d_old_cols(cols)
92 {
93  setText(QObject::tr("%1: remove %2 column(s)").arg(d_private_obj.name()).arg(count));
94 }
95 
97 {
99 }
100 
102 {
104 }
105 
107 // end of class TableRemoveColumnsCmd
109 
111 // class TableMoveColumnCmd
113 TableMoveColumnCmd::TableMoveColumnCmd( future::Table::Private& private_obj, int from, int to, QUndoCommand * parent )
114  : QUndoCommand( parent ), d_private_obj(private_obj), d_from(from), d_to(to)
115 {
116  setText(QObject::tr("%1: move column %2 from position %3 to %4")
117  .arg(d_private_obj.name())
118  .arg(d_private_obj.column(from)->name())
119  .arg(d_from+1).arg(d_to+1));
120 }
121 
123 {
125 }
126 
128 {
130 }
131 
133 // end of class TableMoveColumnCmd
135 
future::Table::Private::setRowCount
void setRowCount(int count)
Set the number of rows of the table.
Definition: future_Table.cpp:2551
TableMoveColumnCmd::d_from
int d_from
The old column index.
Definition: tablecommands.h:142
TableRemoveColumnsCmd::d_count
int d_count
The number of columns to be removed.
Definition: tablecommands.h:117
TableMoveColumnCmd::undo
void undo() override
Definition: tablecommands.cpp:127
future::Table::Private::removeColumns
void removeColumns(int first, int count)
Remove Columns.
Definition: future_Table.cpp:2511
future::Table::Private::rowCount
int rowCount() const
Return the number of rows in the table.
Definition: future_Table.h:522
TableInsertColumnsCmd::redo
void redo() override
Definition: tablecommands.cpp:47
Column.h
tablecommands.h
TableMoveColumnCmd::d_to
int d_to
The new column index.
Definition: tablecommands.h:144
TableInsertColumnsCmd::d_rows_before
int d_rows_before
Row count before the command.
Definition: tablecommands.h:66
TableMoveColumnCmd::redo
void redo() override
Definition: tablecommands.cpp:122
future::Table::Private::insertColumns
void insertColumns(int before, QList< Column * > cols)
Insert columns before column number 'before'.
Definition: future_Table.cpp:2482
Double2StringFilter.h
future_Table.h
TableRemoveColumnsCmd::TableRemoveColumnsCmd
TableRemoveColumnsCmd(future::Table::Private &private_obj, int first, int count, QList< Column * > cols, QUndoCommand *parent=0)
Definition: tablecommands.cpp:90
TableRemoveColumnsCmd::redo
void redo() override
Definition: tablecommands.cpp:96
TableSetNumberOfRowsCmd::TableSetNumberOfRowsCmd
TableSetNumberOfRowsCmd(future::Table::Private &private_obj, int rows, QUndoCommand *parent=0)
Definition: tablecommands.cpp:66
TableInsertColumnsCmd::d_cols
QList< Column * > d_cols
The new columns.
Definition: tablecommands.h:64
future::Table::Private::moveColumn
void moveColumn(int from, int to)
Move a column to another position.
Definition: future_Table.cpp:2537
TableMoveColumnCmd::d_private_obj
future::Table::Private & d_private_obj
The private object to modify.
Definition: tablecommands.h:140
TableRemoveColumnsCmd::d_first
int d_first
The first column.
Definition: tablecommands.h:115
future::Table::Private::name
QString name() const
Definition: future_Table.h:541
TableRemoveColumnsCmd::d_private_obj
future::Table::Private & d_private_obj
The private object to modify.
Definition: tablecommands.h:113
AbstractAspect::name
QString name() const
Definition: AbstractAspect.cpp:229
future::Table::Private::column
Column * column(int index) const
Return column number 'index'.
Definition: future_Table.cpp:2453
TableRemoveColumnsCmd::undo
void undo() override
Definition: tablecommands.cpp:101
TableInsertColumnsCmd::d_private_obj
future::Table::Private & d_private_obj
The private object to modify.
Definition: tablecommands.h:60
TableSetNumberOfRowsCmd::d_old_rows
int d_old_rows
Number of rows before.
Definition: tablecommands.h:92
TableInsertColumnsCmd::d_before
int d_before
Column to insert before.
Definition: tablecommands.h:62
TableSetNumberOfRowsCmd::undo
void undo() override
Definition: tablecommands.cpp:78
TableSetNumberOfRowsCmd::d_private_obj
future::Table::Private & d_private_obj
The private object to modify.
Definition: tablecommands.h:88
TableSetNumberOfRowsCmd::redo
void redo() override
Definition: tablecommands.cpp:72
TableInsertColumnsCmd::TableInsertColumnsCmd
TableInsertColumnsCmd(future::Table::Private &private_obj, int before, QList< Column * > cols, QUndoCommand *parent=0)
Definition: tablecommands.cpp:41
TableMoveColumnCmd::TableMoveColumnCmd
TableMoveColumnCmd(future::Table::Private &private_obj, int from, int to, QUndoCommand *parent=0)
Definition: tablecommands.cpp:113
Interval.h
TableInsertColumnsCmd::undo
void undo() override
Definition: tablecommands.cpp:53
future::Table::Private
Definition: future_Table.h:486
TableSetNumberOfRowsCmd::d_rows
int d_rows
Number of rows.
Definition: tablecommands.h:90
TableRemoveColumnsCmd::d_old_cols
QList< Column * > d_old_cols
The removed columns.
Definition: tablecommands.h:119