QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
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
16
#include "
qgsdatabaseschemaselectiondialog.h
"
17
18
#include <QApplication>
19
#include <QGridLayout>
20
#include <QLabel>
21
#include <QMessageBox>
22
23
#include "moc_qgsdatabaseschemaselectiondialog.cpp"
24
25
QgsDatabaseSchemaSelectionDialog::QgsDatabaseSchemaSelectionDialog
(
QgsAbstractDatabaseProviderConnection
*connection, QWidget *parent )
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
47
QString
QgsDatabaseSchemaSelectionDialog::selectedSchema
()
const
48
{
49
return
mCboSchema->currentSchema();
50
}
QgsAbstractDatabaseProviderConnection
Provides common functionality for database based connections.
Definition
qgsabstractdatabaseproviderconnection.h:50
QgsDatabaseSchemaComboBox
A combo box which displays the list of schemas for a specific database connection.
Definition
qgsdatabaseschemacombobox.h:52
QgsDatabaseSchemaSelectionDialog::QgsDatabaseSchemaSelectionDialog
QgsDatabaseSchemaSelectionDialog(QgsAbstractDatabaseProviderConnection *connection, QWidget *parent=nullptr)
Constructor for QgsDatabaseSchemaSelectionDialog, for the specified connection.
Definition
qgsdatabaseschemaselectiondialog.cpp:25
QgsDatabaseSchemaSelectionDialog::selectedSchema
QString selectedSchema() const
Returns the name of the current schema selected in the combo box.
Definition
qgsdatabaseschemaselectiondialog.cpp:47
qgsdatabaseschemaselectiondialog.h
Generated on
for QGIS API Documentation by
1.17.0