7#ifndef CURVE_NAME_LIST_H
8#define CURVE_NAME_LIST_H
11#include <QStandardItemModel>
34 virtual int columnCount (
const QModelIndex &parent)
const;
49 virtual Qt::ItemFlags
flags (
const QModelIndex &index)
const;
53 const QString &curveCurrent,
54 const QString &curveOriginal,
55 unsigned int pointCount);
58 virtual QStandardItem *
item(
int row,
int column = 0)
const;
64 virtual bool removeRows (
int row,
int count,
const QModelIndex &parent);
70 virtual int rowCount (
const QModelIndex & parent = QModelIndex())
const;
73 virtual bool setData (
const QModelIndex &index,
74 const QVariant &value,
78 virtual void setItem(
int row,
int column, QStandardItem *
item);
86 bool curveNameIsAcceptable (
const QString &curveNameNew,
@ NUMBER_CURVE_NAME_LIST_COLUMNS
@ CURVE_NAME_LIST_COLUMN_CURRENT
QHash< QString, unsigned int > OriginalCurveToPointCount
QHash< QString, QString > CurrentCurveToOriginalCurve
void reset()
Clear all information.
bool containsCurveNameCurrent(const QString &curveName) const
Return true if specified curve name is already in the list.
virtual int columnCount(const QModelIndex &parent) const
One column.
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
One row per curve name.
unsigned int currentCurveToPointCount(const QString ¤tCurve) const
Return the point count for the specified current curve.
QString currentCurvesAsString() const
For debugging we dump the curve names.
unsigned int numPointsForSelectedCurves(const QList< unsigned int > &rowsSelected) const
Return the number of points associated with the selected curves, as specified by their row numbers.
virtual QStandardItem * item(int row, int column=0) const
Retrieve data from model.
virtual void setItem(int row, int column, QStandardItem *item)
Store one curve name data.
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Override normal flags with additional editing flags.
virtual bool removeRows(int row, int count, const QModelIndex &parent)
Remove one row.
void insertRow(int row, const QString &curveCurrent, const QString &curveOriginal, unsigned int pointCount)
Create a new entry at the specified row.
CurveNameList()
Default constructor.
QString currentCurveToOriginalCurve(const QString ¤tCurve) const
Return the original curve for the specified current curve.
virtual Qt::DropActions supportedDropActions() const
Allow dragging for reordering.
virtual bool setData(const QModelIndex &index, const QVariant &value, int role)
Store data for one curve name.