7 #ifndef CURVE_NAME_LIST_H 8 #define CURVE_NAME_LIST_H 11 #include <QStandardItemModel> 16 typedef QHash<QString, QString> CurrentCurveToOriginalCurve;
17 typedef QHash<QString, unsigned int> OriginalCurveToPointCount;
20 enum CurveNameListColumns {
21 CURVE_NAME_LIST_COLUMN_CURRENT,
22 NUMBER_CURVE_NAME_LIST_COLUMNS
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,
90 CurrentCurveToOriginalCurve m_currentCurveToOriginalCurve;
91 OriginalCurveToPointCount m_originalCurveToPointCount;
94 #endif // CURVE_NAME_LIST_H virtual int columnCount(const QModelIndex &parent) const
One column.
bool containsCurveNameCurrent(const QString &curveName) const
Return true if specified curve name is already in the list.
QString currentCurvesAsString() const
For debugging we dump the curve names.
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Override normal flags with additional editing flags.
virtual void setItem(int row, int column, QStandardItem *item)
Store one curve name data.
QString currentCurveToOriginalCurve(const QString ¤tCurve) const
Return the original curve for the specified current curve.
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 bool removeRows(int row, int count, const QModelIndex &parent)
Remove one row.
unsigned int currentCurveToPointCount(const QString ¤tCurve) const
Return the point count for the specified current curve.
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
One row per curve name.
virtual bool setData(const QModelIndex &index, const QVariant &value, int role)
Store data for one curve name.
virtual QStandardItem * item(int row, int column=0) const
Retrieve data from model.
virtual Qt::DropActions supportedDropActions() const
Allow dragging for reordering.
void insertRow(int row, const QString &curveCurrent, const QString &curveOriginal, unsigned int pointCount)
Create a new entry at the specified row.
Model for DlgSettingsCurveAddRemove and CmdSettingsCurveAddRemove.
CurveNameList()
Default constructor.
void reset()
Clear all information.