mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-10 00:04:23 -04:00
add a completer for the file widget when creating a new GPKG (#35072)
This commit is contained in:
parent
9b9c906de3
commit
a93db7d7c5
2
python/core/auto_additions/qgsproviderconnectionmodel.py
Normal file
2
python/core/auto_additions/qgsproviderconnectionmodel.py
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# The following has been generated automatically from src/core/qgsproviderconnectionmodel.h
|
||||||
|
QgsProviderConnectionModel.Role.baseClass = QgsProviderConnectionModel
|
@ -49,6 +49,7 @@ class CORE_EXPORT QgsProviderConnectionModel : public QAbstractItemModel
|
|||||||
RoleConfiguration, //!< Connection configuration variant map
|
RoleConfiguration, //!< Connection configuration variant map
|
||||||
RoleEmpty, //!< Entry is an empty entry
|
RoleEmpty, //!< Entry is an empty entry
|
||||||
};
|
};
|
||||||
|
Q_ENUM( Role )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for QgsProviderConnectionModel, for the specified \a provider.
|
* Constructor for QgsProviderConnectionModel, for the specified \a provider.
|
||||||
|
@ -31,11 +31,13 @@
|
|||||||
#include "qgshelp.h"
|
#include "qgshelp.h"
|
||||||
#include "qgsogrutils.h"
|
#include "qgsogrutils.h"
|
||||||
#include "qgsgui.h"
|
#include "qgsgui.h"
|
||||||
|
#include "qgsproviderconnectionmodel.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QCompleter>
|
||||||
|
|
||||||
#include <ogr_api.h>
|
#include <ogr_api.h>
|
||||||
#include <ogr_srs_api.h>
|
#include <ogr_srs_api.h>
|
||||||
@ -129,6 +131,15 @@ QgsNewGeoPackageLayerDialog::QgsNewGeoPackageLayerDialog( QWidget *parent, Qt::W
|
|||||||
}
|
}
|
||||||
checkOk();
|
checkOk();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
QgsProviderConnectionModel *ogrProviderModel = new QgsProviderConnectionModel( QStringLiteral( "ogr" ), this );
|
||||||
|
|
||||||
|
QCompleter *completer = new QCompleter( this );
|
||||||
|
completer->setModel( ogrProviderModel );
|
||||||
|
completer->setCompletionRole( QgsProviderConnectionModel::RoleUri );
|
||||||
|
completer->setCompletionMode( QCompleter::PopupCompletion );
|
||||||
|
completer->setFilterMode( Qt::MatchContains );
|
||||||
|
mDatabase->lineEdit()->setCompleter( completer );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsNewGeoPackageLayerDialog::setCrs( const QgsCoordinateReferenceSystem &crs )
|
void QgsNewGeoPackageLayerDialog::setCrs( const QgsCoordinateReferenceSystem &crs )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user