2017-12-10 14:20:45 +01:00
|
|
|
|
#ifndef TABLESPAGE_H
|
2017-12-10 08:17:07 +01:00
|
|
|
|
#define TABLESPAGE_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <QWidget>
|
2017-12-10 14:20:45 +01:00
|
|
|
|
#include <memory>
|
2018-11-18 20:24:27 +01:00
|
|
|
|
#include <optional>
|
2018-01-06 21:22:22 +01:00
|
|
|
|
#include <QItemSelection>
|
2017-12-10 08:17:07 +01:00
|
|
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
|
|
class TablesPage;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-12-10 14:20:45 +01:00
|
|
|
|
class TablesTableModel;
|
2018-11-29 20:21:36 +01:00
|
|
|
|
class ColumnPage;
|
2017-12-12 20:13:53 +01:00
|
|
|
|
class ColumnTableModel;
|
2017-12-30 12:57:55 +01:00
|
|
|
|
class ConstraintModel;
|
2017-12-10 14:20:45 +01:00
|
|
|
|
class PgDatabaseCatalog;
|
2017-12-29 08:39:08 +01:00
|
|
|
|
class NamespaceFilterWidget;
|
2018-01-06 21:22:22 +01:00
|
|
|
|
class IndexModel;
|
2018-01-09 20:39:43 +01:00
|
|
|
|
class MainWindow;
|
2018-10-20 10:58:42 +02:00
|
|
|
|
class PropertiesPage;
|
2018-10-07 19:40:06 +02:00
|
|
|
|
class TriggerPage;
|
2018-10-21 13:47:38 +02:00
|
|
|
|
class PgClass;
|
2017-12-10 14:20:45 +01:00
|
|
|
|
|
2017-12-10 08:17:07 +01:00
|
|
|
|
class TablesPage : public QWidget
|
|
|
|
|
|
{
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
2018-11-18 20:24:27 +01:00
|
|
|
|
explicit TablesPage(MainWindow *parent = nullptr);
|
2017-12-10 08:17:07 +01:00
|
|
|
|
~TablesPage();
|
|
|
|
|
|
|
2017-12-10 14:20:45 +01:00
|
|
|
|
void setCatalog(std::shared_ptr<PgDatabaseCatalog> cat);
|
2017-12-10 08:17:07 +01:00
|
|
|
|
private:
|
|
|
|
|
|
Ui::TablesPage *ui;
|
2018-01-09 20:39:43 +01:00
|
|
|
|
MainWindow *m_window;
|
2018-11-29 20:21:36 +01:00
|
|
|
|
// QWidget *m_columnsTab;
|
|
|
|
|
|
ColumnPage *m_columnsPage;
|
|
|
|
|
|
// QWidget *m_propertiesTab;
|
2018-10-20 10:58:42 +02:00
|
|
|
|
PropertiesPage *m_propertiesPage;
|
2018-11-29 20:21:36 +01:00
|
|
|
|
// QWidget *m_triggerTab;
|
2018-10-07 19:40:06 +02:00
|
|
|
|
TriggerPage *m_triggerPage;
|
2017-12-10 14:20:45 +01:00
|
|
|
|
std::shared_ptr<PgDatabaseCatalog> m_catalog;
|
|
|
|
|
|
TablesTableModel* m_tablesModel = nullptr;
|
2017-12-12 20:13:53 +01:00
|
|
|
|
ColumnTableModel* m_columnsModel = nullptr;
|
2017-12-30 12:57:55 +01:00
|
|
|
|
ConstraintModel* m_constraintModel = nullptr;
|
2018-01-06 21:22:22 +01:00
|
|
|
|
IndexModel* m_indexModel = nullptr;
|
2018-04-08 09:04:38 +02:00
|
|
|
|
//NamespaceFilterWidget* m_namespaceFilterWidget;
|
2017-12-12 20:13:53 +01:00
|
|
|
|
|
2018-10-07 19:40:06 +02:00
|
|
|
|
void retranslateUi(bool all = true);
|
2018-11-29 20:21:36 +01:00
|
|
|
|
// QWidget* addDetailTab(QWidget *contents, bool infront = false);
|
2018-10-21 13:47:38 +02:00
|
|
|
|
|
2018-11-18 20:24:27 +01:00
|
|
|
|
void selectedTableChanged(const std::optional<PgClass> &table);
|
2017-12-12 20:13:53 +01:00
|
|
|
|
private slots:
|
|
|
|
|
|
|
2018-01-06 21:33:24 +01:00
|
|
|
|
void tableListTable_currentRowChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
2018-10-21 13:47:38 +02:00
|
|
|
|
void tableListTable_layoutChanged(const QList<QPersistentModelIndex> &parents, QAbstractItemModel::LayoutChangeHint hint);
|
2018-04-08 09:04:38 +02:00
|
|
|
|
// void constraintsTable_currentRowChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
2018-01-06 21:33:24 +01:00
|
|
|
|
void constraintsTable_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
|
2018-08-05 11:57:27 +02:00
|
|
|
|
void constraintsTable_modelReset();
|
2018-04-08 09:04:38 +02:00
|
|
|
|
void indexesTable_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
|
2018-08-05 11:57:27 +02:00
|
|
|
|
void indexesTable_modelReset();
|
2018-01-09 20:39:43 +01:00
|
|
|
|
void on_tableListTable_doubleClicked(const QModelIndex &index);
|
2017-12-10 08:17:07 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // TABLESPAGE_H
|