QGIS API Documentation 3.41.0-Master (d5b93354e9c)
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, QDialogButtonBox::StandardButtons buttons, Qt::Orientation orientation )
22 : QDialog( parent, fl )
23{
24 // create buttonbox
25 mButtonBox = new QDialogButtonBox( buttons, orientation, this );
26 connect( mButtonBox, &QDialogButtonBox::accepted, this, &QDialog::accept );
27 connect( mButtonBox, &QDialogButtonBox::rejected, this, &QDialog::reject );
28
29 // layout
30 QBoxLayout *layout = nullptr;
31 if ( orientation == Qt::Horizontal )
32 layout = new QVBoxLayout();
33 else
34 layout = new QHBoxLayout();
35 mLayout = new QVBoxLayout();
36 layout->addLayout( mLayout );
37 layout->addWidget( mButtonBox );
38 setLayout( layout );
39}
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:49
QVBoxLayout * layout()
Returns the central layout. Widgets added to it must have this dialog as parent.
Definition qgsdialog.h:43
QVBoxLayout * mLayout
Definition qgsdialog.h:48