New column page

Shows SQL for columns ALTER TABLE ... [ADD|DROP] COLUMN combines a selection
of multiple columns into a single alter table.
Show collation in list of columns.

(order of columns isn't what is should be but that should maybe be fixed
by a generic column selection and ordering mechanism that knows what the
default sort should be)
This commit is contained in:
eelke 2018-11-29 20:21:36 +01:00
parent 73c4cf4790
commit 57217974f4
19 changed files with 345 additions and 55 deletions

42
pglab/ColumnPage.h Normal file
View file

@ -0,0 +1,42 @@
#ifndef COLUMNPAGE_H
#define COLUMNPAGE_H
#include "PgClass.h"
#include <QSplitter>
#include <memory>
#include <optional>
class QTableView;
class SqlCodePreview;
class PgDatabaseCatalog;
class ColumnTableModel;
class CustomFilterSortModel;
class QItemSelection;
class QAbstractItemModel;
class ColumnPage : public QSplitter
{
Q_OBJECT
public:
explicit ColumnPage(QWidget *parent = nullptr);
void setData(std::shared_ptr<const PgDatabaseCatalog> cat, const std::optional<PgClass> &cls);
//void setFilter(const std::optional<PgClass> &cls);
signals:
public slots:
private:
QTableView *m_tableView = nullptr;
SqlCodePreview *m_definitionView = nullptr;
ColumnTableModel *m_columnModel = nullptr;
CustomFilterSortModel *m_sortFilterProxy = nullptr;
std::shared_ptr<const PgDatabaseCatalog> m_catalog;
std::optional<PgClass> m_Class;
private slots:
void tableView_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
};
#endif // COLUMNPAGE_H