QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgsdatabaseschemaselectiondialog.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsdatabaseschemaselectiondialog.cpp
3 ---------------------
4 begin : March 2025
5 copyright : (C) 2025 by Jan Caha
6 email : jan.caha at outlook dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
17
18#include <QApplication>
19#include <QGridLayout>
20#include <QLabel>
21#include <QMessageBox>
22
23#include "moc_qgsdatabaseschemaselectiondialog.cpp"
24
26 : QDialog( parent )
27{
28 setWindowTitle( tr( "Select Schema" ) );
29
30 QGridLayout *layout = new QGridLayout( this );
31
32 mCboSchema = new QgsDatabaseSchemaComboBox( connection, this );
33 mCboSchema->setAllowEmptySchema( false );
34
35 layout->addWidget( new QLabel( tr( "Select schema" ) ), 0, 0 );
36 layout->addWidget( mCboSchema, 0, 1 );
37
38 mButtonBox = new QDialogButtonBox( this );
39 mButtonBox->setOrientation( Qt::Horizontal );
40 mButtonBox->setStandardButtons( QDialogButtonBox::Cancel | QDialogButtonBox::Ok );
41 connect( mButtonBox, &QDialogButtonBox::rejected, this, &QgsDatabaseSchemaSelectionDialog::reject );
42 connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsDatabaseSchemaSelectionDialog::accept );
43
44 layout->addWidget( mButtonBox, 1, 0, 2, 0 );
45}
46
48{
49 return mCboSchema->currentSchema();
50}
Provides common functionality for database based connections.
A combo box which displays the list of schemas for a specific database connection.
QgsDatabaseSchemaSelectionDialog(QgsAbstractDatabaseProviderConnection *connection, QWidget *parent=nullptr)
Constructor for QgsDatabaseSchemaSelectionDialog, for the specified connection.
QString selectedSchema() const
Returns the name of the current schema selected in the combo box.