mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Move CleanerTableModel to its own file
models.h / .cpp was getting too big (around 2.5k lines), and each change triggered a rebuild in tons of parts of Subsurface, this is the first commit trying to make the models code sane by removing them all of the models.h/cpp file and also clearning code in the process. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
338c0f22aa
commit
6e4aa7d044
5 changed files with 63 additions and 46 deletions
27
qt-models/cleanertablemodel.h
Normal file
27
qt-models/cleanertablemodel.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
#ifndef CLEANERTABLEMODEL_H
|
||||
#define CLEANERTABLEMODEL_H
|
||||
|
||||
#include <QAbstractTableModel>
|
||||
#include <QStringList>
|
||||
|
||||
/* When using a QAbstractTableModel, consider using this instead
|
||||
* of the default implementation, as it's easyer to setup the columns
|
||||
* and headers.
|
||||
* Most subsurface classes uses this one to save loads of lines
|
||||
* of code and share a consistent layout. */
|
||||
|
||||
class CleanerTableModel : public QAbstractTableModel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CleanerTableModel(QObject *parent = 0);
|
||||
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
|
||||
protected:
|
||||
void setHeaderDataStrings(const QStringList &headers);
|
||||
|
||||
private:
|
||||
QStringList headers;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue