QGIS API Documentation  2.7.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 
20 QgsDialog::QgsDialog( QWidget *parent, Qt::WindowFlags fl,
21  QDialogButtonBox::StandardButtons buttons,
22  Qt::Orientation orientation )
23  : QDialog( parent, fl )
24 {
25  // create buttonbox
26  mButtonBox = new QDialogButtonBox( buttons, orientation, this );
27  connect( mButtonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
28  connect( mButtonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
29 
30  // layout
31  QLayout *layout = 0;
32  if ( orientation == Qt::Horizontal )
33  layout = new QVBoxLayout();
34  else
35  layout = new QHBoxLayout();
36  mLayout = new QVBoxLayout();
37  layout->addItem( mLayout );
38  layout->addWidget( mButtonBox );
39  setLayout( layout );
40 }
41 
43 {
44 }
45 
QDialogButtonBox * mButtonBox
Definition: qgsdialog.h:46
QVBoxLayout * mLayout
Definition: qgsdialog.h:45
QVBoxLayout * layout()
Returns the central layout. Widgets added to it must have this dialog as parent.
Definition: qgsdialog.h:40
QgsDialog(QWidget *parent=0, Qt::WindowFlags fl=QgisGui::ModalDialogFlags, QDialogButtonBox::StandardButtons buttons=QDialogButtonBox::Close, Qt::Orientation orientation=Qt::Horizontal)
Definition: qgsdialog.cpp:20