CrudModel::removeRows now works for count > 1
This allows for efficient removal of blocks of rows. If you would remove row by row the repeated beginRemoveRows and endRemoveRows calls will generate additional overhead.
This commit is contained in:
parent
266e479344
commit
255b2ec970
2 changed files with 88 additions and 47 deletions
|
|
@ -297,18 +297,25 @@ private:
|
|||
/// \return The values of the primary key column. If this is a new row it will return an empty list
|
||||
///
|
||||
PKeyValues getPKeyForRow(int row) const;
|
||||
Pgsql::Params getPKeyParamsForRow(int row) const;
|
||||
|
||||
bool savePendingChanges();
|
||||
|
||||
std::tuple<QString, Pgsql::Params> createUpdateQuery(const PKeyValues &pkey_values, const PendingRow &pending_row);
|
||||
std::tuple<QString, Pgsql::Params> createInsertQuery(const PendingRow &pending_row);
|
||||
std::tuple<QString, Pgsql::Params> createDeleteStatement(const PKeyValues &pkey_values);
|
||||
|
||||
QString createDeleteStatement() const;
|
||||
std::tuple<bool, ModifiedRow> updateRow(const PendingRow &pending_row);
|
||||
|
||||
void appendNewRow();
|
||||
|
||||
int lastRowKey = 0;
|
||||
int allocNewRowKey() { return ++lastRowKey; }
|
||||
/// Convert an attnum from the database catalog to the corresponding column in the model
|
||||
///
|
||||
/// \todo still assumes columns are in order, all being shown and no special column like oid shown.
|
||||
int attNumToCol(int attnum) const { return attnum - 1; }
|
||||
private slots:
|
||||
|
||||
void connectionStateChanged(ASyncDBConnection::State state);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue