pgLab/pglab/TablesPage.h
eelke 2a75e86102 Added listing of triggers for selected table (not completely finished).
Used slightly different approach. This tab is fully build in source code
using subclasses to adjust behaviour of widgets for reuse in the other tabs.
Uses custom proxy model for filtering triggers for correct table and supporting
out of the box sorting by QTableView.

SqlCodePreview: QPlainTextEditor which sql highlighter and in readonly mode but allows copy.
2018-10-07 19:40:06 +02:00

55 lines
1.5 KiB
C++

#ifndef TABLESPAGE_H
#define TABLESPAGE_H
#include <QWidget>
#include <memory>
#include <QItemSelection>
namespace Ui {
class TablesPage;
}
class TablesTableModel;
class ColumnTableModel;
class ConstraintModel;
class PgDatabaseCatalog;
class NamespaceFilterWidget;
class IndexModel;
class MainWindow;
class TriggerPage;
class TablesPage : public QWidget
{
Q_OBJECT
public:
explicit TablesPage(MainWindow *parent = 0);
~TablesPage();
void setCatalog(std::shared_ptr<PgDatabaseCatalog> cat);
private:
Ui::TablesPage *ui;
MainWindow *m_window;
QWidget *m_triggerTab;
TriggerPage *m_triggerPage;
std::shared_ptr<PgDatabaseCatalog> m_catalog;
TablesTableModel* m_tablesModel = nullptr;
ColumnTableModel* m_columnsModel = nullptr;
ConstraintModel* m_constraintModel = nullptr;
IndexModel* m_indexModel = nullptr;
//NamespaceFilterWidget* m_namespaceFilterWidget;
void retranslateUi(bool all = true);
QWidget* addDetailTab(QWidget *contents, QString caption);
private slots:
void tableListTable_currentRowChanged(const QModelIndex &current, const QModelIndex &previous);
// void constraintsTable_currentRowChanged(const QModelIndex &current, const QModelIndex &previous);
void constraintsTable_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
void constraintsTable_modelReset();
void indexesTable_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
void indexesTable_modelReset();
void on_tableListTable_doubleClicked(const QModelIndex &index);
};
#endif // TABLESPAGE_H