Skip to content

Commit

Permalink
set working directory for ui loader
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@12220 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 22, 2009
1 parent 075daae commit 95f1db4
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/app/qgsattributedialog.cpp
Expand Up @@ -33,6 +33,8 @@
#include <QFrame>
#include <QScrollArea>
#include <QFile>
#include <QFileInfo>
#include <QDir>
#include <QDialogButtonBox>
#include <QUiLoader>
#include <QDialog>
Expand All @@ -58,13 +60,19 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
if ( !vl->editForm().isEmpty() )
{
QFile file( vl->editForm() );
file.open( QFile::ReadOnly );
QUiLoader loader;
QWidget *myWidget = loader.load( &file, NULL );
file.close();

mDialog = qobject_cast<QDialog*>( myWidget );
buttonBox = myWidget->findChild<QDialogButtonBox*>();
if( file.open( QFile::ReadOnly ) )
{
QUiLoader loader;

QFileInfo fi( vl->editForm() );
loader.setWorkingDirectory( fi.dir() );
QWidget *myWidget = loader.load( &file, NULL );
file.close();

mDialog = qobject_cast<QDialog*>( myWidget );
buttonBox = myWidget->findChild<QDialogButtonBox*>();
}
}

if ( !mDialog )
Expand Down

0 comments on commit 95f1db4

Please sign in to comment.