diff --git a/scidavis/src/Table.cpp b/scidavis/src/Table.cpp index a7697c2..446e52e 100644 --- a/scidavis/src/Table.cpp +++ b/scidavis/src/Table.cpp @@ -453,7 +453,7 @@ bool Table::recalculate(int col, bool only_selected_rows) switch (col_ptr->columnMode()) { case SciDAVis::Numeric: { - QVector<double> results(end_row-start_row+1); + QVector<qreal> results(end_row-start_row+1); for (int i=start_row; i<=end_row; i++) { colscript->setInt(i+1,"i"); ret = colscript->eval(); diff --git a/scidavis/src/future/core/column/Column.cpp b/scidavis/src/future/core/column/Column.cpp index 4e32d80..9817015 100644 --- a/scidavis/src/future/core/column/Column.cpp +++ b/scidavis/src/future/core/column/Column.cpp @@ -236,7 +236,7 @@ void Column::setValueAt(int row, double new_value) exec(new ColumnSetValueCmd(d_column_private, row, new_value)); } -void Column::replaceValues(int first, const QVector<double>& new_values) +void Column::replaceValues(int first, const QVector<qreal>& new_values) { if (!new_values.isEmpty()) exec(new ColumnReplaceValuesCmd(d_column_private, first, new_values)); diff --git a/scidavis/src/future/core/column/Column.h b/scidavis/src/future/core/column/Column.h index 049c89a..d3d37b1 100644 --- a/scidavis/src/future/core/column/Column.h +++ b/scidavis/src/future/core/column/Column.h @@ -283,7 +283,7 @@ class Column : public AbstractColumn /** * Use this only when dataType() is double */ - virtual void replaceValues(int first, const QVector<double>& new_values); + virtual void replaceValues(int first, const QVector<qreal>& new_values); //@} //! \name XML related functions diff --git a/scidavis/src/future/core/column/ColumnPrivate.cpp b/scidavis/src/future/core/column/ColumnPrivate.cpp index 919f61a..d1699f5 100644 --- a/scidavis/src/future/core/column/ColumnPrivate.cpp +++ b/scidavis/src/future/core/column/ColumnPrivate.cpp @@ -931,7 +931,7 @@ void Column::Private::setValueAt(int row, double new_value) emit d_owner->dataChanged(d_owner); } -void Column::Private::replaceValues(int first, const QVector<double>& new_values) +void Column::Private::replaceValues(int first, const QVector<qreal>& new_values) { if (d_data_type != SciDAVis::TypeDouble) return; diff --git a/scidavis/src/future/core/column/ColumnPrivate.h b/scidavis/src/future/core/column/ColumnPrivate.h index 03ea224..fdb33c6 100644 --- a/scidavis/src/future/core/column/ColumnPrivate.h +++ b/scidavis/src/future/core/column/ColumnPrivate.h @@ -289,7 +289,7 @@ class Column::Private /** * Use this only when dataType() is double */ - void replaceValues(int first, const QVector<double>& new_values); + void replaceValues(int first, const QVector<qreal>& new_values); //@} private: diff --git a/scidavis/src/future/core/column/columncommands.cpp b/scidavis/src/future/core/column/columncommands.cpp index 1fcc359..200394a 100644 --- a/scidavis/src/future/core/column/columncommands.cpp +++ b/scidavis/src/future/core/column/columncommands.cpp @@ -49,7 +49,7 @@ ColumnSetModeCmd::~ColumnSetModeCmd() if(d_new_data != d_old_data) { if(d_new_type == SciDAVis::TypeDouble) - delete static_cast< QVector<double>* >(d_new_data); + delete static_cast< QVector<qreal>* >(d_new_data); else if(d_new_type == SciDAVis::TypeQString) delete static_cast< QStringList* >(d_new_data); else if(d_new_type == SciDAVis::TypeQDateTime) @@ -61,7 +61,7 @@ ColumnSetModeCmd::~ColumnSetModeCmd() if(d_new_data != d_old_data) { if(d_old_type == SciDAVis::TypeDouble) - delete static_cast< QVector<double>* >(d_old_data); + delete static_cast< QVector<qreal>* >(d_old_data); else if(d_old_type == SciDAVis::TypeQString) delete static_cast< QStringList* >(d_old_data); else if(d_old_type == SciDAVis::TypeQDateTime) @@ -328,7 +328,7 @@ ColumnClearCmd::~ColumnClearCmd() if(d_undone) { if(d_type == SciDAVis::TypeDouble) - delete static_cast< QVector<double>* >(d_empty_data); + delete static_cast< QVector<qreal>* >(d_empty_data); else if(d_type == SciDAVis::TypeQString) delete static_cast< QStringList* >(d_empty_data); else if(d_type == SciDAVis::TypeQDateTime) @@ -337,7 +337,7 @@ ColumnClearCmd::~ColumnClearCmd() else { if(d_type == SciDAVis::TypeDouble) - delete static_cast< QVector<double>* >(d_data); + delete static_cast< QVector<qreal>* >(d_data); else if(d_type == SciDAVis::TypeQString) delete static_cast< QStringList* >(d_data); else if(d_type == SciDAVis::TypeQDateTime) @@ -353,7 +353,7 @@ void ColumnClearCmd::redo() switch(d_type) { case SciDAVis::TypeDouble: - d_empty_data = new QVector<double>(); + d_empty_data = new QVector<qreal>(); break; case SciDAVis::TypeQDateTime: d_empty_data = new QList<QDateTime>(); @@ -719,7 +719,7 @@ void ColumnReplaceTextsCmd::undo() /////////////////////////////////////////////////////////////////////////// // class ColumnReplaceValuesCmd /////////////////////////////////////////////////////////////////////////// -ColumnReplaceValuesCmd::ColumnReplaceValuesCmd(Column::Private * col, int first, const QVector<double>& new_values, QUndoCommand * parent ) +ColumnReplaceValuesCmd::ColumnReplaceValuesCmd(Column::Private * col, int first, const QVector<qreal>& new_values, QUndoCommand * parent ) : QUndoCommand( parent ), d_col(col), d_first(first), d_new_values(new_values) { setText(QObject::tr("%1: replace the values for rows %2 to %3").arg(col->name()).arg(first).arg(first + new_values.count() -1)); @@ -734,7 +734,7 @@ void ColumnReplaceValuesCmd::redo() { if(!d_copied) { - d_old_values = static_cast< QVector<double>* >(d_col->dataPointer())->mid(d_first, d_new_values.count()); + d_old_values = static_cast< QVector<qreal>* >(d_col->dataPointer())->mid(d_first, d_new_values.count()); d_row_count = d_col->rowCount(); d_validity = d_col->validityAttribute(); d_copied = true; diff --git a/scidavis/src/future/core/column/columncommands.h b/scidavis/src/future/core/column/columncommands.h index be4b9f9..9d1e54c 100644 --- a/scidavis/src/future/core/column/columncommands.h +++ b/scidavis/src/future/core/column/columncommands.h @@ -677,7 +677,7 @@ class ColumnReplaceValuesCmd : public QUndoCommand { public: //! Ctor - ColumnReplaceValuesCmd(Column::Private * col, int first, const QVector<double>& new_values, QUndoCommand * parent = 0 ); + ColumnReplaceValuesCmd(Column::Private * col, int first, const QVector<qreal>& new_values, QUndoCommand * parent = 0 ); //! Dtor ~ColumnReplaceValuesCmd(); @@ -692,9 +692,9 @@ private: //! The first row to replace int d_first; //! The new values - QVector<double> d_new_values; + QVector<qreal> d_new_values; //! The old values - QVector<double> d_old_values; + QVector<qreal> d_old_values; //! Status flag bool d_copied; //! The old number of rows diff --git a/scidavis/src/future/table/future_Table.cpp b/scidavis/src/future/table/future_Table.cpp index ee3c411..89358b0 100644 --- a/scidavis/src/future/table/future_Table.cpp +++ b/scidavis/src/future/table/future_Table.cpp @@ -565,7 +565,7 @@ void Table::fillSelectedCellsWithRowNumbers() switch (col_ptr->columnMode()) { case SciDAVis::Numeric: { - QVector<double> results(last-first+1); + QVector<qreal> results(last-first+1); for (int row=first; row<=last; row++) if(d_view->isCellSelected(row, col)) results[row-first] = row+1; @@ -607,7 +607,7 @@ void Table::fillSelectedCellsWithRandomNumbers() switch (col_ptr->columnMode()) { case SciDAVis::Numeric: { - QVector<double> results(last-first+1); + QVector<qreal> results(last-first+1); for (int row=first; row<=last; row++) if (d_view->isCellSelected(row, col)) results[row-first] = double(qrand())/double(RAND_MAX); @@ -790,7 +790,7 @@ void Table::normalizeColumns(QList< Column* > cols) if (col->valueAt(row) > max) max = col->valueAt(row); } - QVector<double> results(col->rowCount()); + QVector<qreal> results(col->rowCount()); if (max != 0.0) // avoid division by zero for (int row=0; row<col->rowCount(); row++) results[row] = col->valueAt(row) / max; @@ -826,7 +826,7 @@ void Table::normalizeSelection() foreach(Column *col_ptr, d_view->selectedColumns()) { int col = columnIndex(col_ptr); if (col_ptr->dataType() == SciDAVis::TypeDouble) { - QVector<double> results(rowCount()); + QVector<qreal> results(rowCount()); for (int row=0; row<col_ptr->rowCount(); row++) if (d_view->isCellSelected(row, col)) results[row] = col_ptr->valueAt(row) / max; diff --git a/scidavis/src/scidavis.sip b/scidavis/src/scidavis.sip index f8c3838..9eda7a3 100644 --- a/scidavis/src/scidavis.sip +++ b/scidavis/src/scidavis.sip @@ -171,7 +171,7 @@ class Column: AbstractAspect void replaceDateTimes(int first, const QList<QDateTime>& new_values); double valueAt(int row) const; void setValueAt(int row, double new_value); - void replaceValues(int first, const QVector<double>& new_values); + void replaceValues(int first, const QVector<qreal>& new_values); Column * x() const /NoDerived/; %MethodCode