[QGIS Commit] r13339 - trunk/qgis/src/app
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Tue Apr 20 15:25:32 EDT 2010
Author: jef
Date: 2010-04-20 15:25:32 -0400 (Tue, 20 Apr 2010)
New Revision: 13339
Modified:
trunk/qgis/src/app/qgsattributedialog.cpp
Log:
set attribute dialog parent and save geometry
Modified: trunk/qgis/src/app/qgsattributedialog.cpp
===================================================================
--- trunk/qgis/src/app/qgsattributedialog.cpp 2010-04-20 19:18:32 UTC (rev 13338)
+++ trunk/qgis/src/app/qgsattributedialog.cpp 2010-04-20 19:25:32 UTC (rev 13339)
@@ -42,11 +42,11 @@
#include <QVBoxLayout>
QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeature )
- : mDialog( 0 ),
- mSettingsPath( "/Windows/AttributeDialog/" ),
- mLayer( vl ),
- mpFeature( thepFeature ),
- mRubberBand( 0 )
+ : mDialog( 0 )
+ , mSettingsPath( "/Windows/AttributeDialog/" )
+ , mLayer( vl )
+ , mpFeature( thepFeature )
+ , mRubberBand( 0 )
{
if ( mpFeature == NULL || vl->dataProvider() == NULL )
return;
@@ -69,7 +69,7 @@
QFileInfo fi( vl->editForm() );
loader.setWorkingDirectory( fi.dir() );
- QWidget *myWidget = loader.load( &file, NULL );
+ QWidget *myWidget = loader.load( &file, QgisApp::instance() );
file.close();
mDialog = qobject_cast<QDialog*>( myWidget );
@@ -79,7 +79,7 @@
if ( !mDialog )
{
- mDialog = new QDialog();
+ mDialog = new QDialog( QgisApp::instance() );
QGridLayout *gridLayout;
QFrame *mFrame;
@@ -103,12 +103,12 @@
//
//Set up dynamic inside a scroll box
//
- QVBoxLayout * mypOuterLayout = new QVBoxLayout();
+ QVBoxLayout *mypOuterLayout = new QVBoxLayout();
mypOuterLayout->setContentsMargins( 0, 0, 0, 0 );
//transfers layout ownership so no need to call delete
mFrame->setLayout( mypOuterLayout );
- QScrollArea * mypScrollArea = new QScrollArea();
+ QScrollArea *mypScrollArea = new QScrollArea();
//transfers scroll area ownership so no need to call delete
mypOuterLayout->addWidget( mypScrollArea );
QFrame *mypInnerFrame = new QFrame();
@@ -117,7 +117,7 @@
//transfers frame ownership so no need to call delete
mypScrollArea->setWidget( mypInnerFrame );
mypScrollArea->setWidgetResizable( true );
- QGridLayout * mypInnerLayout = new QGridLayout( mypInnerFrame );
+ QGridLayout *mypInnerLayout = new QGridLayout( mypInnerFrame );
int index = 0;
for ( QgsAttributeMap::const_iterator it = myAttributes.begin(); it != myAttributes.end(); ++it )
@@ -205,6 +205,7 @@
}
connect( buttonBox, SIGNAL( rejected() ), mDialog, SLOT( reject() ) );
+ connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
}
QMetaObject::connectSlotsByName( mDialog );
@@ -245,12 +246,12 @@
delete mRubberBand;
}
+ saveGeometry();
+
if ( mDialog )
{
delete mDialog;
}
-
- saveGeometry();
}
void QgsAttributeDialog::accept()
More information about the QGIS-commit
mailing list