QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
Signals | Public Member Functions | Friends | List of all members
QgsNewDatabaseTableNameWidget Class Reference

The QgsNewDatabaseTableNameWidget class embeds the browser view to select a DB schema and a new table name. More...

#include <qgsnewdatabasetablenamewidget.h>

Inheritance diagram for QgsNewDatabaseTableNameWidget:
Inheritance graph
[legend]

Signals

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.
 
- Signals inherited from QgsPanelWidget
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.
 

Public Member Functions

 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.
 
- Public Member Functions inherited from QgsPanelWidget
 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.
 

Friends

class TestQgsNewDatabaseTableNameWidget
 

Additional Inherited Members

- Public Slots inherited from QgsPanelWidget
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 Public Member Functions inherited from QgsPanelWidget
static QgsPanelWidgetfindParentPanel (QWidget *widget)
 Traces through the parents of a widget to find if it is contained within a QgsPanelWidget widget.
 
- Protected Member Functions inherited from QgsPanelWidget
void keyPressEvent (QKeyEvent *event) override
 Overridden key press event to handle the esc event on the widget.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ QgsNewDatabaseTableNameWidget()

QgsNewDatabaseTableNameWidget::QgsNewDatabaseTableNameWidget ( QgsBrowserGuiModel browserModel = nullptr,
const QStringList &  providersFilter = QStringList(),
QWidget *  parent = nullptr 
)
explicit

Constructs a new QgsNewDatabaseTableNameWidget.

Parameters
browserModelan existing browser model (typically from app), if nullptr an instance will be created
providersFilteroptional 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
parentoptional parent for this widget

Definition at line 38 of file qgsnewdatabasetablenamewidget.cpp.

Member Function Documentation

◆ accepted

void QgsNewDatabaseTableNameWidget::accepted ( )
signal

Emitted when the OK/accept button is clicked.

◆ dataProviderKey()

QString QgsNewDatabaseTableNameWidget::dataProviderKey ( ) const

Returns the currently selected data item provider key.

Definition at line 253 of file qgsnewdatabasetablenamewidget.cpp.

◆ isValid()

bool QgsNewDatabaseTableNameWidget::isValid ( ) const

Returns true if the widget contains a valid new table name.

Definition at line 360 of file qgsnewdatabasetablenamewidget.cpp.

◆ 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
providerKeythe 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 238 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
schemaNamethe 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 166 of file qgsnewdatabasetablenamewidget.cpp.

◆ showEvent()

void QgsNewDatabaseTableNameWidget::showEvent ( QShowEvent *  e)
override

Scroll to last selected index and expand it's children.

Definition at line 370 of file qgsnewdatabasetablenamewidget.cpp.

◆ table()

QString QgsNewDatabaseTableNameWidget::table ( ) const

Returns the current name of the new table.

Definition at line 248 of file qgsnewdatabasetablenamewidget.cpp.

◆ tableNameChanged

void QgsNewDatabaseTableNameWidget::tableNameChanged ( const QString &  tableName)
signal

This signal is emitted when the user enters a table name.

Parameters
tableNamethe 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 243 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
uriURI string representation

◆ validationChanged

void QgsNewDatabaseTableNameWidget::validationChanged ( bool  isValid)
signal

This signal is emitted whenever the validation status of the widget changes.

Parameters
isValidtrue if the current status of the widget is valid

◆ validationError()

QString QgsNewDatabaseTableNameWidget::validationError ( ) const

Returns the validation error or an empty string is the widget status is valid.

Definition at line 365 of file qgsnewdatabasetablenamewidget.cpp.

Friends And Related Symbol Documentation

◆ TestQgsNewDatabaseTableNameWidget

friend class TestQgsNewDatabaseTableNameWidget
friend

Definition at line 172 of file qgsnewdatabasetablenamewidget.h.


The documentation for this class was generated from the following files: