mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
SqliteTableModel: Inserting and deleting rows, clean up, bug fixes
Add some basic code to support inserting and deleting rows again. Fix a few bugs here and there. Do some general code clean up.
This commit is contained in:
@@ -12,7 +12,7 @@ class SqliteTableModel : public QAbstractTableModel
|
||||
public:
|
||||
explicit SqliteTableModel(QObject *parent = 0, DBBrowserDB* db = 0);
|
||||
|
||||
int rowCount(const QModelIndex &parent) const;
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
int totalRowCount() const;
|
||||
int columnCount(const QModelIndex &parent) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
||||
@@ -22,6 +22,9 @@ public:
|
||||
void fetchMore(const QModelIndex &parent);
|
||||
size_t queryMore(size_t offset);
|
||||
|
||||
bool insertRows(int row, int count, const QModelIndex& parent = QModelIndex());
|
||||
bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex());
|
||||
|
||||
void setQuery(const QString& sQuery);
|
||||
void setTable(const QString& table);
|
||||
void setChunkSize(size_t chunksize);
|
||||
@@ -38,7 +41,7 @@ private:
|
||||
int m_rowCount;
|
||||
int m_columnCount;
|
||||
QStringList m_headers;
|
||||
QMap<int, QStringList> m_data;
|
||||
QList<QStringList> m_data;
|
||||
|
||||
QString m_sQuery;
|
||||
QString m_sTable;
|
||||
|
||||
Reference in New Issue
Block a user