QGIS API Documentation
3.20.0-Odense (decaadbb31)
|
The QgsNewDatabaseTableNameWidget class embeds the browser view to select a DB schema and a new table name. More...
#include <qgsnewdatabasetablenamewidget.h>
Signals | |
void | accepted () |
Emitted when the OK/accept button is clicked. More... | |
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. More... | |
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). More... | |
void | tableNameChanged (const QString &tableName) |
This signal is emitted when the user enters a table name. More... | |
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. More... | |
void | validationChanged (bool isValid) |
This signal is emitted whenever the validation status of the widget changes. More... | |
Signals inherited from QgsPanelWidget | |
void | panelAccepted (QgsPanelWidget *panel) |
Emitted when the panel is accepted by the user. More... | |
void | showPanel (QgsPanelWidget *panel) |
Emit when you require a panel to be show in the interface. More... | |
void | widgetChanged () |
Emitted when the widget state changes. More... | |
Public Member Functions | |
QgsNewDatabaseTableNameWidget (QgsBrowserGuiModel *browserModel=nullptr, const QStringList &providersFilter=QStringList(), QWidget *parent=nullptr) | |
Constructs a new QgsNewDatabaseTableNameWidget. More... | |
QString | dataProviderKey () const |
Returns the currently selected data item provider key. More... | |
bool | isValid () const |
Returns true if the widget contains a valid new table name. More... | |
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. More... | |
void | setAcceptButtonVisible (bool visible) |
Sets whether the optional "Ok"/accept button should be visible. More... | |
void | showEvent (QShowEvent *e) override |
Scroll to last selected index and expand it's children. More... | |
QString | table () const |
Returns the current name of the new table. More... | |
QString | uri () const |
Returns the (possibly blank) string representation of the new table data source URI. More... | |
QString | validationError () const |
Returns the validation error or an empty string is the widget status is valid. More... | |
Public Member Functions inherited from QgsPanelWidget | |
QgsPanelWidget (QWidget *parent=nullptr) | |
Base class for any widget that can be shown as a inline panel. More... | |
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. More... | |
bool | autoDelete () |
The the auto delete property on the widget. More... | |
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. More... | |
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. More... | |
bool | dockMode () |
Returns the dock mode state. More... | |
virtual QMenu * | menuButtonMenu () |
Returns the menu to use for the menu button for this panel, or nullptr if no menu button is required. More... | |
virtual QString | menuButtonTooltip () const |
Returns the (translated) tooltip text to use for the menu button for this panel. More... | |
QString | panelTitle () |
The title of the panel. More... | |
void | setAutoDelete (bool autoDelete) |
The the auto delete property on the widget. More... | |
virtual void | setDockMode (bool dockMode) |
Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs. More... | |
void | setPanelTitle (const QString &panelTitle) |
Set the title of the panel when shown in the interface. More... | |
Friends | |
class | TestQgsNewDatabaseTableNameWidget |
Additional Inherited Members | |
Public Slots inherited from QgsPanelWidget | |
void | acceptPanel () |
Accept the panel. More... | |
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. More... | |
Static Public Member Functions inherited from QgsPanelWidget | |
static QgsPanelWidget * | findParentPanel (QWidget *widget) |
Traces through the parents of a widget to find if it is contained within a QgsPanelWidget widget. More... | |
Protected Member Functions inherited from QgsPanelWidget | |
void | keyPressEvent (QKeyEvent *event) override |
Overridden key press event to handle the esc event on the widget. More... | |
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.
Definition at line 44 of file qgsnewdatabasetablenamewidget.h.
|
explicit |
Constructs a new QgsNewDatabaseTableNameWidget.
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.
|
signal |
Emitted when the OK/accept button is clicked.
QString QgsNewDatabaseTableNameWidget::dataProviderKey | ( | ) | const |
Returns the currently selected data item provider key.
Definition at line 252 of file qgsnewdatabasetablenamewidget.cpp.
bool QgsNewDatabaseTableNameWidget::isValid | ( | ) | const |
Returns true
if the widget contains a valid new table name.
Definition at line 359 of file qgsnewdatabasetablenamewidget.cpp.
|
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.
providerKey | the data provider key of the selected 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.
|
signal |
This signal is emitted when the user selects a schema (or file path for filesystem-based DBs like spatialite or GPKG).
schemaName | the name of the selected schema |
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.
|
override |
Scroll to last selected index and expand it's children.
Definition at line 369 of file qgsnewdatabasetablenamewidget.cpp.
QString QgsNewDatabaseTableNameWidget::table | ( | ) | const |
Returns the current name of the new table.
Definition at line 247 of file qgsnewdatabasetablenamewidget.cpp.
|
signal |
This signal is emitted when the user enters a table name.
tableName | the name of the new table |
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.
|
signal |
This signal is emitted when the URI of the new table changes, whether or not it is a valid one.
uri | URI string representation |
|
signal |
This signal is emitted whenever the validation status of the widget changes.
isValid | true if the current status of the widget is valid |
QString QgsNewDatabaseTableNameWidget::validationError | ( | ) | const |
Returns the validation error or an empty string is the widget status is valid.
Definition at line 364 of file qgsnewdatabasetablenamewidget.cpp.
|
friend |
Definition at line 172 of file qgsnewdatabasetablenamewidget.h.