-
Notifications
You must be signed in to change notification settings - Fork 3
/
QueryParamDlg.h
56 lines (42 loc) · 1.41 KB
/
QueryParamDlg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef QUERYPARAMDLG_H
#define QUERYPARAMDLG_H
#include <QVariantMap>
#include <QDialog>
QT_BEGIN_NAMESPACE
class QComboBox;
class QGridLayout;
QT_END_NAMESPACE
class DbConnection;
class QueryParamDlg : public QDialog
{
Q_OBJECT
struct QueryParamDlgPrivate {
QVariantMap bindTypes;
QVariantMap bindSql;
DbConnection *dbConn = Q_NULLPTR;
};
public:
explicit QueryParamDlg(DbConnection *dbc, QWidget *parent = nullptr);
void setBindSql(const QVariantMap &sqlRef);
QVariantMap bindSql() const;
void setBindTypes(const QVariantMap &map);
QVariantMap bindTypes() const;
void setupParams(const QStringList& params);
QVariantMap bindings(const QStringList& params) const;
void setDefaults(const QVariantMap &map);
private Q_SLOTS:
void fillReference(QComboBox *cmb, const QString& param);
private:
void setupUI();
QComboBox *createCmb(const QString ¶m, int row, QWidget *parent = Q_NULLPTR);
void updateValueEditor(const QString ¶m, int row);
QWidget *createValueEditor(const QString ¶m, QWidget *parent = Q_NULLPTR);
QString editorName(const QString ¶m) const;
QString comboName(const QString ¶m) const;
void setValue(const QString ¶m, const QVariant& value);
QVariant getValue(const QString ¶m) const;
private:
QGridLayout *ui_Grid;
QueryParamDlgPrivate d;
};
#endif // QUERYPARAMDLG_H