QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
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. 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 QgsPanelWidgetfindParentPanel (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...
 

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 NULL 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 37 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 252 of file qgsnewdatabasetablenamewidget.cpp.

◆ isValid()

bool QgsNewDatabaseTableNameWidget::isValid ( ) const

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

Definition at line 359 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 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
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 165 of file qgsnewdatabasetablenamewidget.cpp.

◆ showEvent()

void QgsNewDatabaseTableNameWidget::showEvent ( QShowEvent *  e)
override

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

Definition at line 369 of file qgsnewdatabasetablenamewidget.cpp.

◆ table()

QString QgsNewDatabaseTableNameWidget::table ( ) const

Returns the current name of the new table.

Definition at line 247 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 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
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 364 of file qgsnewdatabasetablenamewidget.cpp.

Friends And Related Function 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: