rename QgsDbSourceSelectBase to QgsAbstractDbSourceSelect

This commit is contained in:
Denis Rouzaud 2021-11-12 08:41:44 +01:00
parent 93bdf53a00
commit e841f76251
18 changed files with 46 additions and 46 deletions

View File

@ -1,7 +1,7 @@
/************************************************************************ /************************************************************************
* This file has been generated automatically from * * This file has been generated automatically from *
* * * *
* src/gui/providers/qgsdbsourceselectbase.h * * src/gui/providers/qgsabstractdbsourceselect.h *
* * * *
* Do not edit manually ! Edit header and run scripts/sipify.pl again * * Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/ ************************************************************************/
@ -10,19 +10,19 @@
class QgsDbSourceSelectBase : QgsAbstractDataSourceWidget, protected Ui::QgsDbSourceSelectBase class QgsAbstractDbSourceSelect : QgsAbstractDataSourceWidget, protected Ui::QgsAbstractDbSourceSelect
{ {
%Docstring(signature="appended") %Docstring(signature="appended")
The :py:class:`QgsDbSourceSelectBase` class is a base class for database source widget selector The :py:class:`QgsAbstractDbSourceSelect` class is a base class for database source widget selector
.. versionadded:: 3.24 .. versionadded:: 3.24
%End %End
%TypeHeaderCode %TypeHeaderCode
#include "qgsdbsourceselectbase.h" #include "qgsabstractdbsourceselect.h"
%End %End
public: public:
QgsDbSourceSelectBase( QWidget *parent = 0, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::None ); QgsAbstractDbSourceSelect( QWidget *parent = 0, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::None );
%Docstring %Docstring
Constructor Constructor
%End %End
@ -52,7 +52,7 @@ This is called to define the SQL query and must be re-implemented. The implement
/************************************************************************ /************************************************************************
* This file has been generated automatically from * * This file has been generated automatically from *
* * * *
* src/gui/providers/qgsdbsourceselectbase.h * * src/gui/providers/qgsabstractdbsourceselect.h *
* * * *
* Do not edit manually ! Edit header and run scripts/sipify.pl again * * Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/ ************************************************************************/

View File

@ -361,7 +361,7 @@ set(QGIS_GUI_SRCS
processing/models/qgsmodelviewtooltemporarymousepan.cpp processing/models/qgsmodelviewtooltemporarymousepan.cpp
processing/models/qgsmodelviewtoolzoom.cpp processing/models/qgsmodelviewtoolzoom.cpp
providers/qgsdbsourceselectbase.cpp providers/qgsabstractdbsourceselect.cpp
providers/qgspointcloudproviderguimetadata.cpp providers/qgspointcloudproviderguimetadata.cpp
providers/qgspointcloudsourceselect.cpp providers/qgspointcloudsourceselect.cpp
@ -1181,7 +1181,7 @@ set(QGIS_GUI_HDRS
processing/models/qgsmodelviewtooltemporarymousepan.h processing/models/qgsmodelviewtooltemporarymousepan.h
processing/models/qgsmodelviewtoolzoom.h processing/models/qgsmodelviewtoolzoom.h
providers/qgsdbsourceselectbase.h providers/qgsabstractdbsourceselect.h
providers/qgspointcloudsourceselect.h providers/qgspointcloudsourceselect.h
providers/qgspointcloudproviderguimetadata.h providers/qgspointcloudproviderguimetadata.h

View File

@ -34,7 +34,7 @@
QgsOgrDbSourceSelect::QgsOgrDbSourceSelect( const QString &theSettingsKey, const QString &theName, QgsOgrDbSourceSelect::QgsOgrDbSourceSelect( const QString &theSettingsKey, const QString &theName,
const QString &theExtensions, QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode ) const QString &theExtensions, QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode )
: QgsDbSourceSelectBase( parent, fl, theWidgetMode ) : QgsAbstractDbSourceSelect( parent, fl, theWidgetMode )
, mOgrDriverName( theSettingsKey ) , mOgrDriverName( theSettingsKey )
, mName( theName ) , mName( theName )
, mExtension( theExtensions ) , mExtension( theExtensions )

View File

@ -20,7 +20,7 @@
#include "qgsguiutils.h" #include "qgsguiutils.h"
#include "qgshelp.h" #include "qgshelp.h"
#include "qgsdbsourceselectbase.h" #include "qgsabstractdbsourceselect.h"
#include "qgsproviderregistry.h" #include "qgsproviderregistry.h"
#include "qgis_sip.h" #include "qgis_sip.h"
@ -35,7 +35,7 @@ class QgsOgrDbTableModel;
* source selects. * source selects.
* *
*/ */
class QgsOgrDbSourceSelect: public QgsDbSourceSelectBase class QgsOgrDbSourceSelect: public QgsAbstractDbSourceSelect
{ {
Q_OBJECT Q_OBJECT

View File

@ -1,5 +1,5 @@
/*************************************************************************** /***************************************************************************
qgsdbsourceselectbase.h qgsabstractdbsourceselect.h
-------------------------------------- --------------------------------------
Date : 08.11.2021 Date : 08.11.2021
Copyright : (C) 2021 Denis Rouzaud Copyright : (C) 2021 Denis Rouzaud
@ -14,13 +14,13 @@
***************************************************************************/ ***************************************************************************/
#include "qgsabstractdbtablemodel.h" #include "qgsabstractdbtablemodel.h"
#include "qgsdbsourceselectbase.h" #include "qgsabstractdbsourceselect.h"
#include <QMenu> #include <QMenu>
#include <QSortFilterProxyModel> #include <QSortFilterProxyModel>
#include <QItemDelegate> #include <QItemDelegate>
QgsDbSourceSelectBase::QgsDbSourceSelectBase( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode ) QgsAbstractDbSourceSelect::QgsAbstractDbSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode )
: QgsAbstractDataSourceWidget( parent, fl, widgetMode ) : QgsAbstractDataSourceWidget( parent, fl, widgetMode )
{ {
setupUi( this ); setupUi( this );
@ -45,13 +45,13 @@ QgsDbSourceSelectBase::QgsDbSourceSelectBase( QWidget *parent, Qt::WindowFlags f
mBuildQueryButton->setDisabled( true ); mBuildQueryButton->setDisabled( true );
buttonBox->addButton( mBuildQueryButton, QDialogButtonBox::ActionRole ); buttonBox->addButton( mBuildQueryButton, QDialogButtonBox::ActionRole );
connect( mTablesTreeView, &QTreeView::clicked, this, &QgsDbSourceSelectBase::treeviewClicked ); connect( mTablesTreeView, &QTreeView::clicked, this, &QgsAbstractDbSourceSelect::treeviewClicked );
connect( mTablesTreeView, &QTreeView::doubleClicked, this, &QgsDbSourceSelectBase::treeviewDoubleClicked ); connect( mTablesTreeView, &QTreeView::doubleClicked, this, &QgsAbstractDbSourceSelect::treeviewDoubleClicked );
connect( mBuildQueryButton, &QAbstractButton::clicked, this, [ = ]() {setSql( mTablesTreeView->currentIndex() );} ); connect( mBuildQueryButton, &QAbstractButton::clicked, this, [ = ]() {setSql( mTablesTreeView->currentIndex() );} );
} }
void QgsDbSourceSelectBase::init( QgsAbstractDbTableModel *model, QItemDelegate *delegate ) void QgsAbstractDbSourceSelect::init( QgsAbstractDbTableModel *model, QItemDelegate *delegate )
{ {
mProxyModel->setSourceModel( model ); mProxyModel->setSourceModel( model );
mTablesTreeView->setModel( mProxyModel ); mTablesTreeView->setModel( mProxyModel );
@ -107,18 +107,18 @@ void QgsDbSourceSelectBase::init( QgsAbstractDbTableModel *model, QItemDelegate
connect( mSearchTableEdit, &QLineEdit::textChanged, this, [ = ]() {filterResults();} ); connect( mSearchTableEdit, &QLineEdit::textChanged, this, [ = ]() {filterResults();} );
} }
void QgsDbSourceSelectBase::treeviewClicked( const QModelIndex &index ) void QgsAbstractDbSourceSelect::treeviewClicked( const QModelIndex &index )
{ {
mBuildQueryButton->setEnabled( index.parent().isValid() ); mBuildQueryButton->setEnabled( index.parent().isValid() );
} }
void QgsDbSourceSelectBase::treeviewDoubleClicked( const QModelIndex &index ) void QgsAbstractDbSourceSelect::treeviewDoubleClicked( const QModelIndex &index )
{ {
Q_UNUSED( index ) Q_UNUSED( index )
addButtonClicked(); addButtonClicked();
} }
void QgsDbSourceSelectBase::filterResults() void QgsAbstractDbSourceSelect::filterResults()
{ {
QString searchText = mSearchTableEdit->text(); QString searchText = mSearchTableEdit->text();
bool regex = mSearchModeRegexAction->isChecked(); bool regex = mSearchModeRegexAction->isChecked();

View File

@ -1,5 +1,5 @@
/*************************************************************************** /***************************************************************************
qgsdbsourceselectbase.h qgsabstractdbsourceselect.h
-------------------------------------- --------------------------------------
Date : 08.11.2021 Date : 08.11.2021
Copyright : (C) 2021 Denis Rouzaud Copyright : (C) 2021 Denis Rouzaud
@ -13,8 +13,8 @@
* * * *
***************************************************************************/ ***************************************************************************/
#ifndef QGSDBSOURCESELECTBASE_H #ifndef QGSABSTRACTDBSOURCESELECT_H
#define QGSDBSOURCESELECTBASE_H #define QGSABSTRACTDBSOURCESELECT_H
#include "qgis_gui.h" #include "qgis_gui.h"
@ -27,15 +27,15 @@ class QItemDelegate;
/** /**
* \ingroup gui * \ingroup gui
* \brief The QgsDbSourceSelectBase class is a base class for database source widget selector * \brief The QgsAbstractDbSourceSelect class is a base class for database source widget selector
* \since QGIS 3.24 * \since QGIS 3.24
*/ */
class GUI_EXPORT QgsDbSourceSelectBase : public QgsAbstractDataSourceWidget, protected Ui::QgsDbSourceSelectBase class GUI_EXPORT QgsAbstractDbSourceSelect : public QgsAbstractDataSourceWidget, protected Ui::QgsAbstractDbSourceSelect
{ {
Q_OBJECT Q_OBJECT
public: public:
//! Constructor //! Constructor
QgsDbSourceSelectBase( QWidget *parent = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::None ); QgsAbstractDbSourceSelect( QWidget *parent = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::None );
protected: protected:
//! Sets the source model for the table and optionally a delegate //! Sets the source model for the table and optionally a delegate
@ -65,4 +65,4 @@ class GUI_EXPORT QgsDbSourceSelectBase : public QgsAbstractDataSourceWidget, pro
QPushButton *mBuildQueryButton = nullptr; QPushButton *mBuildQueryButton = nullptr;
}; };
#endif // QGSDBSOURCESELECTBASE_H #endif // QGSABSTRACTDBSOURCESELECT_H

View File

@ -123,7 +123,7 @@ void QgsDb2SourceSelectDelegate::setModelData( QWidget *editor, QAbstractItemMod
} }
QgsDb2SourceSelect::QgsDb2SourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode ) QgsDb2SourceSelect::QgsDb2SourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode )
: QgsDbSourceSelectBase( parent, fl, theWidgetMode ) : QgsAbstractDbSourceSelect( parent, fl, theWidgetMode )
{ {
QgsGui::instance()->enableAutoGeometryRestore( this ); QgsGui::instance()->enableAutoGeometryRestore( this );

View File

@ -19,12 +19,12 @@
#ifndef QGSDB2SOURCESELECT_H #ifndef QGSDB2SOURCESELECT_H
#define QGSDB2SOURCESELECT_H #define QGSDB2SOURCESELECT_H
#include "ui_qgsdbsourceselectbase.h" #include "ui_qgsabstractdbsourceselect.h"
#include "qgsguiutils.h" #include "qgsguiutils.h"
#include "qgsdb2tablemodel.h" #include "qgsdb2tablemodel.h"
#include "qgshelp.h" #include "qgshelp.h"
#include "qgsproviderregistry.h" #include "qgsproviderregistry.h"
#include "qgsdbsourceselectbase.h" #include "qgsabstractdbsourceselect.h"
#include <QMap> #include <QMap>
#include <QPair> #include <QPair>
@ -87,7 +87,7 @@ class QgsDb2GeomColumnTypeThread : public QThread
* for Db2 databases. The user can then connect and add * for Db2 databases. The user can then connect and add
* tables from the database to the map canvas. * tables from the database to the map canvas.
*/ */
class QgsDb2SourceSelect : public QgsDbSourceSelectBase class QgsDb2SourceSelect : public QgsAbstractDbSourceSelect
{ {
Q_OBJECT Q_OBJECT

View File

@ -200,7 +200,7 @@ QgsHanaSourceSelect::QgsHanaSourceSelect(
QWidget *parent, QWidget *parent,
Qt::WindowFlags fl, Qt::WindowFlags fl,
QgsProviderRegistry::WidgetMode theWidgetMode ) QgsProviderRegistry::WidgetMode theWidgetMode )
: QgsDbSourceSelectBase( parent, fl, theWidgetMode ) : QgsAbstractDbSourceSelect( parent, fl, theWidgetMode )
{ {
QgsGui::instance()->enableAutoGeometryRestore( this ); QgsGui::instance()->enableAutoGeometryRestore( this );

View File

@ -22,7 +22,7 @@
#include "qgshelp.h" #include "qgshelp.h"
#include "qgsproviderregistry.h" #include "qgsproviderregistry.h"
#include "qgsguiutils.h" #include "qgsguiutils.h"
#include "qgsdbsourceselectbase.h" #include "qgsabstractdbsourceselect.h"
#include <QMap> #include <QMap>
@ -63,7 +63,7 @@ class QgsHanaSourceSelectDelegate : public QItemDelegate
* for SAP HANA databases. The user can then connect and add * for SAP HANA databases. The user can then connect and add
* tables from the database to the map canvas. * tables from the database to the map canvas.
*/ */
class QgsHanaSourceSelect : public QgsDbSourceSelectBase class QgsHanaSourceSelect : public QgsAbstractDbSourceSelect
{ {
Q_OBJECT Q_OBJECT

View File

@ -125,7 +125,7 @@ void QgsMssqlSourceSelectDelegate::setModelData( QWidget *editor, QAbstractItemM
} }
QgsMssqlSourceSelect::QgsMssqlSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode ) QgsMssqlSourceSelect::QgsMssqlSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode )
: QgsDbSourceSelectBase( parent, fl, theWidgetMode ) : QgsAbstractDbSourceSelect( parent, fl, theWidgetMode )
{ {
QgsGui::instance()->enableAutoGeometryRestore( this ); QgsGui::instance()->enableAutoGeometryRestore( this );

View File

@ -20,7 +20,7 @@
#include "qgsguiutils.h" #include "qgsguiutils.h"
#include "qgshelp.h" #include "qgshelp.h"
#include "qgsproviderregistry.h" #include "qgsproviderregistry.h"
#include "qgsdbsourceselectbase.h" #include "qgsabstractdbsourceselect.h"
#include "qgsmssqltablemodel.h" #include "qgsmssqltablemodel.h"
@ -57,7 +57,7 @@ class QgsMssqlSourceSelectDelegate : public QItemDelegate
* for MSSQL databases. The user can then connect and add * for MSSQL databases. The user can then connect and add
* tables from the database to the map canvas. * tables from the database to the map canvas.
*/ */
class QgsMssqlSourceSelect : public QgsDbSourceSelectBase class QgsMssqlSourceSelect : public QgsAbstractDbSourceSelect
{ {
Q_OBJECT Q_OBJECT

View File

@ -173,7 +173,7 @@ void QgsOracleSourceSelectDelegate::setModelData( QWidget *editor, QAbstractItem
} }
QgsOracleSourceSelect::QgsOracleSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode ) QgsOracleSourceSelect::QgsOracleSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode )
: QgsDbSourceSelectBase( parent, fl, theWidgetMode ) : QgsAbstractDbSourceSelect( parent, fl, theWidgetMode )
{ {
QgsGui::instance()->enableAutoGeometryRestore( this ); QgsGui::instance()->enableAutoGeometryRestore( this );
setupButtons( buttonBox ); setupButtons( buttonBox );

View File

@ -21,7 +21,7 @@
#include "qgshelp.h" #include "qgshelp.h"
#include "qgsoracleconnpool.h" #include "qgsoracleconnpool.h"
#include "qgsproviderregistry.h" #include "qgsproviderregistry.h"
#include "qgsdbsourceselectbase.h" #include "qgsabstractdbsourceselect.h"
#include <QMap> #include <QMap>
#include <QPair> #include <QPair>
@ -79,7 +79,7 @@ class QgsOracleSourceSelectDelegate : public QItemDelegate
* for Oracle databases. The user can then connect and add * for Oracle databases. The user can then connect and add
* tables from the database to the map canvas. * tables from the database to the map canvas.
*/ */
class QgsOracleSourceSelect : public QgsDbSourceSelectBase class QgsOracleSourceSelect : public QgsAbstractDbSourceSelect
{ {
Q_OBJECT Q_OBJECT

View File

@ -215,7 +215,7 @@ void QgsPgSourceSelectDelegate::setModelData( QWidget *editor, QAbstractItemMode
} }
QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode ) QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode )
: QgsDbSourceSelectBase( parent, fl, theWidgetMode ) : QgsAbstractDbSourceSelect( parent, fl, theWidgetMode )
{ {
QgsGui::instance()->enableAutoGeometryRestore( this ); QgsGui::instance()->enableAutoGeometryRestore( this );

View File

@ -21,7 +21,7 @@
#include "qgsdatasourceuri.h" #include "qgsdatasourceuri.h"
#include "qgshelp.h" #include "qgshelp.h"
#include "qgsproviderregistry.h" #include "qgsproviderregistry.h"
#include "qgsdbsourceselectbase.h" #include "qgsabstractdbsourceselect.h"
#include "qgspostgresconn.h" #include "qgspostgresconn.h"
#include <QMap> #include <QMap>
@ -59,7 +59,7 @@ class QgsPgSourceSelectDelegate : public QItemDelegate
* for PostGIS enabled PostgreSQL databases. The user can then connect and add * for PostGIS enabled PostgreSQL databases. The user can then connect and add
* tables from the database to the map canvas. * tables from the database to the map canvas.
*/ */
class QgsPgSourceSelect : public QgsDbSourceSelectBase class QgsPgSourceSelect : public QgsAbstractDbSourceSelect
{ {
Q_OBJECT Q_OBJECT

View File

@ -46,7 +46,7 @@ email : a.furieri@lqt.it
#endif #endif
QgsSpatiaLiteSourceSelect::QgsSpatiaLiteSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode ): QgsSpatiaLiteSourceSelect::QgsSpatiaLiteSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode theWidgetMode ):
QgsDbSourceSelectBase( parent, fl, theWidgetMode ) QgsAbstractDbSourceSelect( parent, fl, theWidgetMode )
{ {
QgsGui::instance()->enableAutoGeometryRestore( this ); QgsGui::instance()->enableAutoGeometryRestore( this );

View File

@ -20,7 +20,7 @@
#include "qgsguiutils.h" #include "qgsguiutils.h"
#include "qgshelp.h" #include "qgshelp.h"
#include "qgsproviderregistry.h" #include "qgsproviderregistry.h"
#include "qgsdbsourceselectbase.h" #include "qgsabstractdbsourceselect.h"
#include <QThread> #include <QThread>
#include <QMap> #include <QMap>
@ -42,7 +42,7 @@ class QPushButton;
* for SpatiaLite/SQLite databases. The user can then connect and add * for SpatiaLite/SQLite databases. The user can then connect and add
* tables from the database to the map canvas. * tables from the database to the map canvas.
*/ */
class QgsSpatiaLiteSourceSelect: public QgsDbSourceSelectBase class QgsSpatiaLiteSourceSelect: public QgsAbstractDbSourceSelect
{ {
Q_OBJECT Q_OBJECT