| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #ifndef NUMBERLISTMODEL_H
- #define NUMBERLISTMODEL_H
- #include <QtCore>
- #include "SNCCore_global.h"
- class SNCCORESHARED_EXPORT NumberListModel : public QAbstractListModel
- {
- Q_OBJECT
- public:
- NumberListModel(QObject *parent = 0);
- int rowCount(const QModelIndex &parent = QModelIndex()) const;
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
- void setNumberList(QStringList segments,QList<QStringList> numbers);
- void setOrderIndex(QList<int> orderIndex);
- void quickSortSegment();
- void mergeSegment();
- QStringList getSegments();
- QList<int> getOrderIndex();
- QList<QStringList> getNumbers();
- void clear();
- int getCount();
- void setMapIndex();
- QString getNumber(int row) const;
- QString getNumberEx(int index) const;
- signals:
- void numberPopulated(int number);
- void optimizeProgressMaxUpdated(int max);
- void optimizeProgressCurrentUpdated(int current);
- protected:
- bool canFetchMore(const QModelIndex &parent) const;
- void fetchMore(const QModelIndex &parent);
- private :
- void swap(int i,int j);
- void heapSort(int length);
- void heapAdjust(int i,int nLength);
- private:
- QStringList segments;
- QList<QStringList> numbers;
- QList<int> orderIndex;
- int displayCount;
- int totalCount;
- QList<QStringList> indexMap;
- QList<int> rowsIndex;
- QList<int> colsIndex;
- bool canFetch;
- public slots:
-
- };
- #endif // NUMBERLISTMODEL_H
|