75 virtual bool isValid(
const QString &sql, QString &errorReason, QString &warningMsg ) = 0;
87 Argument(
const QString &nameIn = QString(),
const QString &typeIn = QString() )
88 : name( nameIn ), type( typeIn ) {}
107 : name( nameIn ), minArgs( args ), maxArgs( args ) {}
109 Function(
const QString &nameIn,
int minArgs,
int maxArgsIn )
110 : name( nameIn ), minArgs( minArgs ), maxArgs( maxArgsIn ) {}
116 explicit QgsSQLComposerDialog( QWidget *parent =
nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
129 void setSql(
const QString &sql );
135 void setSubsetString(
const QString &subsetString )
override { setSql( subsetString ); }
138 void addTableNames(
const QStringList &list );
140 void addTableNames(
const QList<PairNameTitle> &listNameTitle );
142 void addColumnNames(
const QStringList &list,
const QString &tableName );
144 void addColumnNames(
const QList<PairNameType> &list,
const QString &tableName );
146 void addOperators(
const QStringList &list );
148 void addSpatialPredicates(
const QStringList &list );
150 void addSpatialPredicates(
const QList<Function> &list );
152 void addFunctions(
const QStringList &list );
154 void addFunctions(
const QList<Function> &list );
156 void addApis(
const QStringList &list );
159 void setSupportMultipleTables(
bool bMultipleTables,
const QString &mainTypename = QString() );
166 void setTableSelectedCallback( TableSelectedCallback *tableSelectedCallback );
172 void setSQLValidatorCallback( SQLValidatorCallback *sqlValidatorCallback );
175 bool eventFilter( QObject *obj, QEvent *event )
override;
178 void accept()
override;
180 void mTablesCombo_currentIndexChanged(
int );
181 void mColumnsCombo_currentIndexChanged(
int );
182 void mSpatialPredicatesCombo_currentIndexChanged(
int );
183 void mFunctionsCombo_currentIndexChanged(
int );
184 void mOperatorsCombo_currentIndexChanged(
int );
185 void mAddJoinButton_clicked();
186 void mRemoveJoinButton_clicked();
187 void mTableJoins_itemSelectionChanged();
190 void buildSQLFromFields();
191 void splitSQLIntoFields();
195 QStringList mApiList;
196 QSet<QString> mAlreadySelectedTables;
197 TableSelectedCallback *mTableSelectedCallback =
nullptr;
198 SQLValidatorCallback *mSQLValidatorCallback =
nullptr;
199 QObject *mFocusedObject =
nullptr;
200 bool mAlreadyModifyingFields =
false;
201 bool mDistinct =
false;
203 QMap<QString, QString> mapTableEntryTextToName;
204 QMap<QString, QString> mapColumnEntryTextToName;
205 QMap<QString, QString> mapSpatialPredicateEntryTextToName;
206 QMap<QString, QString> mapFunctionEntryTextToName;
207 QString lastSearchedText;
210 void loadTableColumns(
const QString &table );
211 void functionCurrentIndexChanged( QComboBox *combo,
const QMap<QString, QString> &mapEntryTextToName );
212 void getFunctionList(
const QList<Function> &list, QStringList &listApi, QStringList &listCombo, QMap<QString, QString> &mapEntryTextToName );