The QgsNewDatabaseTableNameWidget class embeds the browser view to select a DB schema and a new table name.
More...
#include <qgsnewdatabasetablenamewidget.h>
|
void | accepted () |
| Emitted when the OK/accept button is clicked.
|
|
void | providerKeyChanged (const QString &providerKey) |
| This signal is emitted when the selects a data provider or a schema name that has a different data provider than the previously selected one.
|
|
void | schemaNameChanged (const QString &schemaName) |
| This signal is emitted when the user selects a schema (or file path for filesystem-based DBs like spatialite or GPKG).
|
|
void | tableNameChanged (const QString &tableName) |
| This signal is emitted when the user enters a table name.
|
|
void | uriChanged (const QString &uri) |
| This signal is emitted when the URI of the new table changes, whether or not it is a valid one.
|
|
void | validationChanged (bool isValid) |
| This signal is emitted whenever the validation status of the widget changes.
|
|
void | panelAccepted (QgsPanelWidget *panel) |
| Emitted when the panel is accepted by the user.
|
|
void | showPanel (QgsPanelWidget *panel) |
| Emit when you require a panel to be show in the interface.
|
|
void | widgetChanged () |
| Emitted when the widget state changes.
|
|
|
| QgsNewDatabaseTableNameWidget (QgsBrowserGuiModel *browserModel=nullptr, const QStringList &providersFilter=QStringList(), QWidget *parent=nullptr) |
| Constructs a new QgsNewDatabaseTableNameWidget.
|
|
QString | dataProviderKey () const |
| Returns the currently selected data item provider key.
|
|
bool | isValid () const |
| Returns true if the widget contains a valid new table name.
|
|
QString | schema () const |
| Returns the currently selected schema or file path (in case of filesystem-based DBs like spatialite or GPKG) for the new table.
|
|
void | setAcceptButtonVisible (bool visible) |
| Sets whether the optional "Ok"/accept button should be visible.
|
|
void | showEvent (QShowEvent *e) override |
| Scroll to last selected index and expand it's children.
|
|
QString | table () const |
| Returns the current name of the new table.
|
|
QString | uri () const |
| Returns the (possibly blank) string representation of the new table data source URI.
|
|
QString | validationError () const |
| Returns the validation error or an empty string is the widget status is valid.
|
|
| QgsPanelWidget (QWidget *parent=nullptr) |
| Base class for any widget that can be shown as a inline panel.
|
|
virtual bool | applySizeConstraintsToStack () const |
| Returns true if the size constraints and hints for the panel widget should be applied to the parent QgsPanelWidgetStack which this panel is shown in.
|
|
bool | autoDelete () |
| The the auto delete property on the widget.
|
|
void | connectChildPanel (QgsPanelWidget *panel) |
| Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to bubble up to the user.
|
|
void | connectChildPanels (const QList< QgsPanelWidget * > &panels) |
| Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to bubble up to the user.
|
|
bool | dockMode () |
| Returns the dock mode state.
|
|
virtual QMenu * | menuButtonMenu () |
| Returns the menu to use for the menu button for this panel, or nullptr if no menu button is required.
|
|
virtual QString | menuButtonTooltip () const |
| Returns the (translated) tooltip text to use for the menu button for this panel.
|
|
QString | panelTitle () |
| The title of the panel.
|
|
void | setAutoDelete (bool autoDelete) |
| The the auto delete property on the widget.
|
|
virtual void | setDockMode (bool dockMode) |
| Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs.
|
|
void | setPanelTitle (const QString &panelTitle) |
| Set the title of the panel when shown in the interface.
|
|
|
void | acceptPanel () |
| Accept the panel.
|
|
void | openPanel (QgsPanelWidget *panel) |
| Open a panel or dialog depending on dock mode setting If dock mode is true this method will emit the showPanel signal for connected slots to handle the open event.
|
|
static QgsPanelWidget * | findParentPanel (QWidget *widget) |
| Traces through the parents of a widget to find if it is contained within a QgsPanelWidget widget.
|
|
void | keyPressEvent (QKeyEvent *event) override |
| Overridden key press event to handle the esc event on the widget.
|
|
The QgsNewDatabaseTableNameWidget class embeds the browser view to select a DB schema and a new table name.
The table name is validated for uniqueness and the selected data item provider, schema and table names can be retrieved with getters.
- Warning
- The data provider that originated the data item provider must support the connections API
- Since
- QGIS 3.14
Definition at line 44 of file qgsnewdatabasetablenamewidget.h.
◆ QgsNewDatabaseTableNameWidget()
QgsNewDatabaseTableNameWidget::QgsNewDatabaseTableNameWidget |
( |
QgsBrowserGuiModel * |
browserModel = nullptr , |
|
|
const QStringList & |
providersFilter = QStringList() , |
|
|
QWidget * |
parent = nullptr |
|
) |
| |
|
explicit |
Constructs a new QgsNewDatabaseTableNameWidget.
- Parameters
-
browserModel | an existing browser model (typically from app), if NULL an instance will be created |
providersFilter | optional white list of data provider keys that should be shown in the widget, if not specified all providers data items with database capabilities will be shown |
parent | optional parent for this widget |
Definition at line 37 of file qgsnewdatabasetablenamewidget.cpp.
◆ accepted
void QgsNewDatabaseTableNameWidget::accepted |
( |
| ) |
|
|
signal |
Emitted when the OK/accept button is clicked.
◆ dataProviderKey()
QString QgsNewDatabaseTableNameWidget::dataProviderKey |
( |
| ) |
const |
◆ isValid()
bool QgsNewDatabaseTableNameWidget::isValid |
( |
| ) |
const |
◆ providerKeyChanged
void QgsNewDatabaseTableNameWidget::providerKeyChanged |
( |
const QString & |
providerKey | ) |
|
|
signal |
This signal is emitted when the selects a data provider or a schema name that has a different data provider than the previously selected one.
- Parameters
-
providerKey | the data provider key of the selected schema |
◆ schema()
QString QgsNewDatabaseTableNameWidget::schema |
( |
| ) |
const |
Returns the currently selected schema or file path (in case of filesystem-based DBs like spatialite or GPKG) for the new table.
Definition at line 237 of file qgsnewdatabasetablenamewidget.cpp.
◆ schemaNameChanged
void QgsNewDatabaseTableNameWidget::schemaNameChanged |
( |
const QString & |
schemaName | ) |
|
|
signal |
This signal is emitted when the user selects a schema (or file path for filesystem-based DBs like spatialite or GPKG).
- Parameters
-
schemaName | the name of the selected schema |
◆ setAcceptButtonVisible()
void QgsNewDatabaseTableNameWidget::setAcceptButtonVisible |
( |
bool |
visible | ) |
|
Sets whether the optional "Ok"/accept button should be visible.
By default this is hidden, to better allow the widget to be embedded inside other widgets and dialogs.
Definition at line 165 of file qgsnewdatabasetablenamewidget.cpp.
◆ showEvent()
void QgsNewDatabaseTableNameWidget::showEvent |
( |
QShowEvent * |
e | ) |
|
|
override |
◆ table()
QString QgsNewDatabaseTableNameWidget::table |
( |
| ) |
const |
◆ tableNameChanged
void QgsNewDatabaseTableNameWidget::tableNameChanged |
( |
const QString & |
tableName | ) |
|
|
signal |
This signal is emitted when the user enters a table name.
- Parameters
-
tableName | the name of the new table |
◆ uri()
QString QgsNewDatabaseTableNameWidget::uri |
( |
| ) |
const |
Returns the (possibly blank) string representation of the new table data source URI.
The URI might be invalid in case the widget is not in a valid state.
Definition at line 242 of file qgsnewdatabasetablenamewidget.cpp.
◆ uriChanged
void QgsNewDatabaseTableNameWidget::uriChanged |
( |
const QString & |
uri | ) |
|
|
signal |
This signal is emitted when the URI of the new table changes, whether or not it is a valid one.
- Parameters
-
uri | URI string representation |
◆ validationChanged
void QgsNewDatabaseTableNameWidget::validationChanged |
( |
bool |
isValid | ) |
|
|
signal |
This signal is emitted whenever the validation status of the widget changes.
- Parameters
-
isValid | true if the current status of the widget is valid |
◆ validationError()
QString QgsNewDatabaseTableNameWidget::validationError |
( |
| ) |
const |
◆ TestQgsNewDatabaseTableNameWidget
friend class TestQgsNewDatabaseTableNameWidget |
|
friend |
The documentation for this class was generated from the following files: