QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
qgsdialog.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsdialog.cpp
3 -------------------
4 begin : July 2012
5 copyright : (C) 2012 by Etienne Tourigny
6 email : etourigny dot dev at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#include "qgsdialog.h"
19#include "moc_qgsdialog.cpp"
20
21QgsDialog::QgsDialog( QWidget *parent, Qt::WindowFlags fl,
22 QDialogButtonBox::StandardButtons buttons,
23 Qt::Orientation orientation )
24 : QDialog( parent, fl )
25{
26 // create buttonbox
27 mButtonBox = new QDialogButtonBox( buttons, orientation, this );
28 connect( mButtonBox, &QDialogButtonBox::accepted, this, &QDialog::accept );
29 connect( mButtonBox, &QDialogButtonBox::rejected, this, &QDialog::reject );
30
31 // layout
32 QBoxLayout *layout = nullptr;
33 if ( orientation == Qt::Horizontal )
34 layout = new QVBoxLayout();
35 else
36 layout = new QHBoxLayout();
37 mLayout = new QVBoxLayout();
38 layout->addLayout( mLayout );
39 layout->addWidget( mButtonBox );
40 setLayout( layout );
41}
42
QgsDialog(QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags, QDialogButtonBox::StandardButtons buttons=QDialogButtonBox::Close, Qt::Orientation orientation=Qt::Horizontal)
Constructor for QgsDialog.
Definition qgsdialog.cpp:21
QDialogButtonBox * mButtonBox
Definition qgsdialog.h:52
QVBoxLayout * layout()
Returns the central layout. Widgets added to it must have this dialog as parent.
Definition qgsdialog.h:46
QVBoxLayout * mLayout
Definition qgsdialog.h:51