Can use the parameter list in the query window now.

Still requires extensive testing for all possible types.
This commit is contained in:
eelke 2017-02-19 11:12:43 +01:00
parent aefc9eb7ba
commit 3af26d915e
14 changed files with 461 additions and 242 deletions

View file

@ -16,6 +16,8 @@ namespace Ui {
class QueryTab;
}
class QTableView;
class QTabWidget;
class MainWindow;
class SqlSyntaxHighlighter;
@ -23,14 +25,29 @@ class ExplainRoot;
class QueryResultModel;
class QueryExplainModel;
class PgTypeContainer;
class OpenDatabase;
class QueryTab : public QWidget
{
class QueryParamListController : public QObject {
Q_OBJECT
public:
QueryTab(MainWindow *win, QWidget *parent = 0);
QueryParamListController(QTableView *tv, OpenDatabase *opendb, QWidget *parent);
Pgsql::Params params() const;
public slots:
void on_addParam();
void on_removeParam();
private:
QTableView *paramTableView;
OpenDatabase *m_openDatabase;
ParamListModel m_paramList;
ParamTypeDelegate m_typeDelegate;
};
class QueryTab : public QWidget {
Q_OBJECT
public:
QueryTab(MainWindow *win, QWidget *parent = nullptr);
~QueryTab();
void setConfig(const ConnectionConfig &config);
@ -70,8 +87,8 @@ private:
SqlSyntaxHighlighter* highlighter;
ConnectionConfig m_config;
StopWatch m_stopwatch;
ParamListModel m_paramList;
ParamTypeDelegate m_typeDelegate;
QueryParamListController *m_queryParamListController = nullptr;
QString m_fileName; ///< use setFileName function to set
bool m_queryTextChanged = false;