Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45962 from 3nids/ux-db-table-filter
improve filtering of layers in DB dialogs
- Loading branch information
Showing
40 changed files
with
942 additions
and
1,181 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
python/core/auto_generated/providers/qgsabstractdbtablemodel.sip.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/providers/qgsabstractdbtablemodel.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
class QgsAbstractDbTableModel : QStandardItemModel | ||
{ | ||
%Docstring(signature="appended") | ||
The :py:class:`QgsAbstractDbTableModel` class is a pure virtual model class for results in a database source widget selector | ||
|
||
.. versionadded:: 3.24 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsabstractdbtablemodel.h" | ||
%End | ||
public: | ||
explicit QgsAbstractDbTableModel( QObject *parent = 0 ); | ||
%Docstring | ||
Constructor | ||
%End | ||
|
||
virtual QStringList columns() const = 0; | ||
%Docstring | ||
Returns the list of columns in the table | ||
%End | ||
|
||
virtual int defaultSearchColumn() const = 0; | ||
%Docstring | ||
Returns the index of the column used by default to filter the results (probably the table name column if it exists) | ||
%End | ||
|
||
virtual bool searchableColumn( int column ) const; | ||
%Docstring | ||
Returns if the column should be searchable at the given index | ||
%End | ||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/providers/qgsabstractdbtablemodel.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
python/gui/auto_generated/providers/qgsdbsourceselectbase.sip.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/providers/qgsdbsourceselectbase.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
class QgsDbSourceSelectBase : QgsAbstractDataSourceWidget, protected Ui::QgsDbSourceSelectBase | ||
{ | ||
%Docstring(signature="appended") | ||
The :py:class:`QgsDbSourceSelectBase` class is a base class for database source widget selector | ||
|
||
.. versionadded:: 3.24 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsdbsourceselectbase.h" | ||
%End | ||
public: | ||
QgsDbSourceSelectBase( QWidget *parent = 0, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::None ); | ||
%Docstring | ||
Constructor | ||
%End | ||
|
||
protected: | ||
void setSourceModel( QgsAbstractDbTableModel *model ); | ||
%Docstring | ||
Sets the source model for the widget | ||
%End | ||
|
||
QSortFilterProxyModel *proxyModel(); | ||
%Docstring | ||
Returns the proxy model used to filter the results | ||
%End | ||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/providers/qgsdbsourceselectbase.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/*************************************************************************** | ||
qgsabstractdbtablemodel.h | ||
-------------------------------------- | ||
Date : 08.11.2021 | ||
Copyright : (C) 2021 Denis Rouzaud | ||
Email : denis@opengis.ch | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#ifndef QGSABSTRACTDBTABLEMODEL_H | ||
#define QGSABSTRACTDBTABLEMODEL_H | ||
|
||
#include "qgis_core.h" | ||
|
||
#include <QStandardItemModel> | ||
|
||
/** | ||
* \ingroup gui | ||
* \brief The QgsAbstractDbTableModel class is a pure virtual model class for results in a database source widget selector | ||
* \since QGIS 3.24 | ||
*/ | ||
class CORE_EXPORT QgsAbstractDbTableModel : public QStandardItemModel | ||
{ | ||
Q_OBJECT | ||
public: | ||
//! Constructor | ||
explicit QgsAbstractDbTableModel( QObject *parent = nullptr ) | ||
: QStandardItemModel( parent ) | ||
{} | ||
|
||
//! Returns the list of columns in the table | ||
virtual QStringList columns() const = 0; | ||
|
||
//! Returns the index of the column used by default to filter the results (probably the table name column if it exists) | ||
virtual int defaultSearchColumn() const = 0; | ||
|
||
//! Returns if the column should be searchable at the given index | ||
virtual bool searchableColumn( int column ) const {Q_UNUSED( column ) return true;} | ||
}; | ||
|
||
#endif // QGSABSTRACTDBTABLEMODEL_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.