QueryTool now uses the same DataGrid as the CRUD tool.
This commit is contained in:
parent
bbe52c9db8
commit
5e7fb68c55
15 changed files with 135 additions and 203 deletions
28
pglab/crud/DataGridWidget.h
Normal file
28
pglab/crud/DataGridWidget.h
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#ifndef DATAGRIDWIDGET_H
|
||||
#define DATAGRIDWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class QAbstractItemModel;
|
||||
class QSortFilterProxyModel;
|
||||
class QTableView;
|
||||
|
||||
/** Sortable and editable grid shared by the CRUD tab and the query result tab.
|
||||
*/
|
||||
class DataGridWidget : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DataGridWidget(QWidget *parent = nullptr);
|
||||
|
||||
/// Sets the model to show, sorting is done by a proxy that uses CustomSortRole
|
||||
void setSourceModel(QAbstractItemModel *model);
|
||||
|
||||
QTableView *view() const { return m_view; }
|
||||
QSortFilterProxyModel *proxy() const { return m_proxy; }
|
||||
|
||||
private:
|
||||
QTableView *m_view = nullptr;
|
||||
QSortFilterProxyModel *m_proxy = nullptr;
|
||||
};
|
||||
|
||||
#endif // DATAGRIDWIDGET_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue