Skip to content
Permalink
Browse files

set working directory for ui loader

git-svn-id: http://svn.osgeo.org/qgis/trunk@12220 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Nov 22, 2009
1 parent 075daae commit 95f1db4e0a78772b2db97d30db4b0293f925d0fa
Showing with 14 additions and 6 deletions.
  1. +14 −6 src/app/qgsattributedialog.cpp
@@ -33,6 +33,8 @@
#include <QFrame>
#include <QScrollArea>
#include <QFile>
#include <QFileInfo>
#include <QDir>
#include <QDialogButtonBox>
#include <QUiLoader>
#include <QDialog>
@@ -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 )

0 comments on commit 95f1db4

Please sign in to comment.