|
Quantum GIS API Documentation
master-693a1fe
|
00001 /*************************************************************************** 00002 qgsdialog.cpp 00003 ------------------- 00004 begin : July 2012 00005 copyright : (C) 2012 by Etienne Tourigny 00006 email : etourigny dot dev at gmail dot com 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #include "qgsdialog.h" 00019 00020 QgsDialog::QgsDialog( QWidget *parent, Qt::WFlags fl, 00021 QDialogButtonBox::StandardButtons buttons, 00022 Qt::Orientation orientation ) 00023 : QDialog( parent, fl ) 00024 { 00025 // create buttonbox 00026 mButtonBox = new QDialogButtonBox( buttons, orientation, this ); 00027 connect( mButtonBox, SIGNAL( accepted() ), this, SLOT( accept() ) ); 00028 connect( mButtonBox, SIGNAL( rejected() ), this, SLOT( reject() ) ); 00029 00030 // layout 00031 QLayout *layout = 0; 00032 if ( orientation == Qt::Horizontal ) 00033 layout = new QVBoxLayout(); 00034 else 00035 layout = new QHBoxLayout(); 00036 mLayout = new QVBoxLayout(); 00037 layout->addItem( mLayout ); 00038 layout->addWidget( mButtonBox ); 00039 setLayout( layout ); 00040 } 00041 00042 QgsDialog::~QgsDialog() 00043 { 00044 } 00045