QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgsnewhttpconnection.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsnewhttpconnection.cpp - selector for a new HTTP server for WMS, etc.
3 -------------------
4 begin : 3 April 2005
5 copyright : (C) 2005 by Brendan Morley
6 email : morb at ozemail dot com dot au
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
18#include "moc_qgsnewhttpconnection.cpp"
20#include "qgssettings.h"
21#include "qgshelp.h"
22#include "qgsgui.h"
24#include "qgsowsconnection.h"
27
28#include <QMessageBox>
29#include <QUrl>
30#include <QPushButton>
31#include <QRegularExpression>
32#include <QRegularExpressionValidator>
33#include <QUrlQuery>
34
35const QgsSettingsEntryBool *QgsNewHttpConnection::settingsIgnoreReportedLayerExtentsDefault = new QgsSettingsEntryBool( QStringLiteral( "ignore-reported-layer-extents-default" ), sTreeHttpConnectionDialog, false );
36
37QgsNewHttpConnection::QgsNewHttpConnection( QWidget *parent, ConnectionTypes types, const QString &serviceName, const QString &connectionName, QgsNewHttpConnection::Flags flags, Qt::WindowFlags fl )
38 : QDialog( parent, fl )
39 , mTypes( types )
40 , mServiceName( serviceName )
41 , mOriginalConnName( connectionName )
42{
43 setupUi( this );
44
45 // compatibility fix with former API (pre 3.26) when serviceName was a setting key instead
46 if ( mServiceName.startsWith( QLatin1String( "qgis/" ) ) )
47 {
48 // It would be obviously much better to use mBaseKey also for credentials,
49 // but for some strange reason a different hardcoded key was used instead.
50 // WFS and WMS credentials were mixed with the same key WMS.
51 // Only WMS and WFS providers are using QgsNewHttpConnection at this moment
52 // using connection-wms and connection-wfs -> parse credential key from it.
53 mServiceName = mServiceName.split( '-' ).last().toUpper();
54 }
55
56 if ( !( flags & FlagShowHttpSettings ) )
57 mHttpHeaders->hide();
58
60
61 connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsNewHttpConnection::showHelp );
62
63 QString connectionType = mServiceName;
64 if ( mServiceName == QLatin1String( "WMS" ) )
65 {
66 connectionType = QStringLiteral( "WMS/WMTS" );
67 }
68 setWindowTitle( tr( "Create a New %1 Connection" ).arg( connectionType ) );
69
70 txtName->setValidator( new QRegularExpressionValidator( QRegularExpression( "[^\\/]+" ), txtName ) );
71
72 cmbDpiMode->clear();
73 cmbDpiMode->addItem( tr( "all" ), static_cast<int>( Qgis::DpiMode::All ) );
74 cmbDpiMode->addItem( tr( "off" ), static_cast<int>( Qgis::DpiMode::Off ) );
75 cmbDpiMode->addItem( tr( "QGIS" ), static_cast<int>( Qgis::DpiMode::QGIS ) );
76 cmbDpiMode->addItem( tr( "UMN" ), static_cast<int>( Qgis::DpiMode::UMN ) );
77 cmbDpiMode->addItem( tr( "GeoServer" ), static_cast<int>( Qgis::DpiMode::GeoServer ) );
78
79 cmbTilePixelRatio->clear();
80 cmbTilePixelRatio->addItem( tr( "Undefined (not scaled)" ), static_cast<int>( Qgis::TilePixelRatio::Undefined ) );
81 cmbTilePixelRatio->addItem( tr( "Standard (96 DPI)" ), static_cast<int>( Qgis::TilePixelRatio::StandardDpi ) );
82 cmbTilePixelRatio->addItem( tr( "High (192 DPI)" ), static_cast<int>( Qgis::TilePixelRatio::HighDpi ) );
83
84 cmbVersion->clear();
85 cmbVersion->addItem( tr( "Maximum" ) );
86 cmbVersion->addItem( tr( "1.0" ) );
87 cmbVersion->addItem( tr( "1.1" ) );
88 cmbVersion->addItem( tr( "2.0" ) );
89 cmbVersion->addItem( tr( "OGC API - Features" ) );
90 connect( cmbVersion, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsNewHttpConnection::wfsVersionCurrentIndexChanged );
91
92 cmbFeaturePaging->clear();
93 cmbFeaturePaging->addItem( tr( "Default (trust server capabilities)" ) );
94 cmbFeaturePaging->addItem( tr( "Enabled" ) );
95 cmbFeaturePaging->addItem( tr( "Disabled" ) );
96 connect( cmbFeaturePaging, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsNewHttpConnection::wfsFeaturePagingCurrentIndexChanged );
97
98 if ( !connectionName.isEmpty() )
99 {
100 // populate the dialog with the information stored for the connection
101 // populate the fields with the stored setting parameters
102
103 txtName->setText( connectionName );
104 const QStringList detailParameters { mServiceName.toLower(), connectionName };
105 txtUrl->setText( QgsOwsConnection::settingsUrl->value( detailParameters ) );
106 mHttpHeaders->setHeaders( QgsHttpHeaders( QgsOwsConnection::settingsHeaders->value( detailParameters ) ) );
107
109
110 // Authentication
111 mAuthSettings->setUsername( QgsOwsConnection::settingsUsername->value( detailParameters ) );
112 mAuthSettings->setPassword( QgsOwsConnection::settingsPassword->value( detailParameters ) );
113 mAuthSettings->setConfigId( QgsOwsConnection::settingsAuthCfg->value( detailParameters ) );
114 }
115 mWfsVersionDetectButton->setDisabled( txtUrl->text().isEmpty() );
116
117 if ( !( mTypes & ConnectionWms ) && !( mTypes & ConnectionWcs ) )
118 {
119 mWmsOptionsGroupBox->setVisible( false );
120 mGroupBox->layout()->removeWidget( mWmsOptionsGroupBox );
121 }
122 if ( !( mTypes & ConnectionWfs ) )
123 {
124 mWfsOptionsGroupBox->setVisible( false );
125 mGroupBox->layout()->removeWidget( mWfsOptionsGroupBox );
126 }
127 else
128 {
129 txtUrl->setToolTip( tr( "HTTP address of the WFS service, or landing page of a OGC API service<br>(an ending slash might be needed for some OGC API servers)" ) );
130 }
131
132 if ( mTypes & ConnectionWcs )
133 {
134 cbxIgnoreGetMapURI->setText( tr( "Ignore GetCoverage URI reported in capabilities" ) );
135 cbxWmsIgnoreAxisOrientation->setText( tr( "Ignore axis orientation" ) );
136 if ( !( mTypes & ConnectionWms ) )
137 {
138 mWmsOptionsGroupBox->setTitle( tr( "WCS Options" ) );
139
140 cbxIgnoreGetFeatureInfoURI->setVisible( false );
141 mGroupBox->layout()->removeWidget( cbxIgnoreGetFeatureInfoURI );
142
143 sbFeatureCount->setVisible( false );
144 mGroupBox->layout()->removeWidget( sbFeatureCount );
145 lblFeatureCount->setVisible( false );
146 mGroupBox->layout()->removeWidget( lblFeatureCount );
147
148 cmbDpiMode->setVisible( false );
149 mGroupBox->layout()->removeWidget( cmbDpiMode );
150 lblDpiMode->setVisible( false );
151 mGroupBox->layout()->removeWidget( lblDpiMode );
152 cmbTilePixelRatio->setVisible( false );
153 mGroupBox->layout()->removeWidget( cmbTilePixelRatio );
154 lblTilePixelRatio->setVisible( false );
155 mGroupBox->layout()->removeWidget( lblTilePixelRatio );
156 }
157 }
158
159 cbxWmsIgnoreReportedLayerExtents->setChecked( settingsIgnoreReportedLayerExtentsDefault->value() );
160
161 if ( !( flags & FlagShowTestConnection ) )
162 {
163 mTestConnectionButton->hide();
164 mGroupBox->layout()->removeWidget( mTestConnectionButton );
165 }
166
167 if ( flags & FlagHideAuthenticationGroup )
168 {
169 mAuthGroupBox->hide();
170 mGroupBox->layout()->removeWidget( mAuthGroupBox );
171 }
172 // Adjust height
173 const int w = width();
174 adjustSize();
175 resize( w, height() );
176
177 connect( txtName, &QLineEdit::textChanged, this, &QgsNewHttpConnection::nameChanged );
178 connect( txtUrl, &QLineEdit::textChanged, this, &QgsNewHttpConnection::urlChanged );
179
180 buttonBox->button( QDialogButtonBox::Ok )->setDisabled( true );
181 connect( txtName, &QLineEdit::textChanged, this, &QgsNewHttpConnection::updateOkButtonState );
182 connect( txtUrl, &QLineEdit::textChanged, this, &QgsNewHttpConnection::updateOkButtonState );
183
184 nameChanged( connectionName );
185}
186
187void QgsNewHttpConnection::wfsVersionCurrentIndexChanged( int index )
188{
189 // For now 2019-06-06, leave paging checkable for some WFS version 1.1 servers with support
190 cmbFeaturePaging->setEnabled( index == WFS_VERSION_MAX || index >= WFS_VERSION_2_0 );
191 const bool pagingNotDisabled = cmbFeaturePaging->currentIndex() != static_cast<int>( QgsNewHttpConnection::WfsFeaturePagingIndex::DISABLED );
192 lblPageSize->setEnabled( pagingNotDisabled && ( index == WFS_VERSION_MAX || index >= WFS_VERSION_1_1 ) );
193 txtPageSize->setEnabled( pagingNotDisabled && ( index == WFS_VERSION_MAX || index >= WFS_VERSION_1_1 ) );
194 cbxWfsIgnoreAxisOrientation->setEnabled( index != WFS_VERSION_1_0 && index != WFS_VERSION_API_FEATURES_1_0 );
195 cbxWfsInvertAxisOrientation->setEnabled( index != WFS_VERSION_API_FEATURES_1_0 );
196 wfsUseGml2EncodingForTransactions()->setEnabled( index == WFS_VERSION_1_1 );
197}
198
199void QgsNewHttpConnection::wfsFeaturePagingCurrentIndexChanged( int index )
200{
201 const bool pagingNotDisabled = index != static_cast<int>( QgsNewHttpConnection::WfsFeaturePagingIndex::DISABLED );
202 lblPageSize->setEnabled( pagingNotDisabled );
203 txtPageSize->setEnabled( pagingNotDisabled );
204}
205
207{
208 return txtName->text();
209}
210
212{
213 return txtUrl->text();
214}
215
216void QgsNewHttpConnection::nameChanged( const QString &text )
217{
218 Q_UNUSED( text )
219 buttonBox->button( QDialogButtonBox::Ok )->setDisabled( txtName->text().isEmpty() || txtUrl->text().isEmpty() );
220}
221
222void QgsNewHttpConnection::urlChanged( const QString &text )
223{
224 Q_UNUSED( text )
225 buttonBox->button( QDialogButtonBox::Ok )->setDisabled( txtName->text().isEmpty() || txtUrl->text().isEmpty() );
226 mWfsVersionDetectButton->setDisabled( txtUrl->text().isEmpty() );
227}
228
229void QgsNewHttpConnection::updateOkButtonState()
230{
231 const bool enabled = !txtName->text().isEmpty() && !txtUrl->text().isEmpty();
232 buttonBox->button( QDialogButtonBox::Ok )->setEnabled( enabled );
233}
234
236{
237 const QString newConnectionName = txtName->text();
238
239 bool urlExists = QgsOwsConnection::settingsUrl->exists( { mServiceName.toLower(), newConnectionName } );
240
241 // warn if entry was renamed to an existing connection
242 if ( ( mOriginalConnName.isNull() || mOriginalConnName.compare( newConnectionName, Qt::CaseInsensitive ) != 0 ) && urlExists && QMessageBox::question( this, tr( "Save Connection" ), tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ), QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
243 {
244 return false;
245 }
246
247 if ( !mAuthSettings->password().isEmpty() && QMessageBox::question( this, tr( "Saving Passwords" ), tr( "WARNING: You have entered a password. It will be stored in unsecured plain text in your project files and your home directory (Unix-like OS) or user profile (Windows). If you want to avoid this, press Cancel and either:\n\na) Don't provide a password in the connection settings — it will be requested interactively when needed;\nb) Use the Configuration tab to add your credentials in an HTTP Basic Authentication method and store them in an encrypted database." ), QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
248 {
249 return false;
250 }
251
252 return true;
253}
254
256{
257 return mTestConnectionButton;
258}
259
264
266{
267 return mWfsVersionDetectButton;
268}
269
271{
272 return cmbVersion;
273}
274
276{
277 return cmbFeaturePaging;
278}
279
281{
282 return cbxWfsUseGml2EncodingForTransactions;
283}
284
286{
287 return txtPageSize;
288}
289
290QString QgsNewHttpConnection::wfsSettingsKey( const QString &base, const QString &connectionName ) const
291{
292 return base + connectionName;
293}
294
295QString QgsNewHttpConnection::wmsSettingsKey( const QString &base, const QString &connectionName ) const
296{
297 return base + connectionName;
298}
299
301{
302 QStringList detailsParameters = { mServiceName.toLower(), mOriginalConnName };
303
304 cbxIgnoreGetMapURI->setChecked( QgsOwsConnection::settingsIgnoreGetMapURI->value( detailsParameters ) );
305 cbxWmsIgnoreReportedLayerExtents->setChecked( QgsOwsConnection::settingsReportedLayerExtents->value( detailsParameters ) );
306 cbxWfsIgnoreAxisOrientation->setChecked( QgsOwsConnection::settingsIgnoreAxisOrientation->value( detailsParameters ) );
307 cbxWfsInvertAxisOrientation->setChecked( QgsOwsConnection::settingsInvertAxisOrientation->value( detailsParameters ) );
308 cbxWfsUseGml2EncodingForTransactions->setChecked( QgsOwsConnection::settingsPreferCoordinatesForWfsT11->value( detailsParameters ) );
309
310 cbxWmsIgnoreAxisOrientation->setChecked( QgsOwsConnection::settingsIgnoreAxisOrientation->value( detailsParameters ) );
311 cbxWmsInvertAxisOrientation->setChecked( QgsOwsConnection::settingsInvertAxisOrientation->value( detailsParameters ) );
312 cbxIgnoreGetFeatureInfoURI->setChecked( QgsOwsConnection::settingsIgnoreGetFeatureInfoURI->value( detailsParameters ) );
313 cbxSmoothPixmapTransform->setChecked( QgsOwsConnection::settingsSmoothPixmapTransform->value( detailsParameters ) );
314
315 Qgis::DpiMode dpiMode = QgsOwsConnection::settingsDpiMode->value( detailsParameters );
316 cmbDpiMode->setCurrentIndex( cmbDpiMode->findData( static_cast<int>( dpiMode ) ) );
317 Qgis::TilePixelRatio tilePixelRatio = QgsOwsConnection::settingsTilePixelRatio->value( detailsParameters );
318 cmbTilePixelRatio->setCurrentIndex( cmbTilePixelRatio->findData( static_cast<int>( tilePixelRatio ) ) );
319
320 sbFeatureCount->setValue( QgsOwsConnection::settingsFeatureCount->value( detailsParameters ) );
321
322 const QString version = QgsOwsConnection::settingsVersion->value( detailsParameters );
323 int versionIdx = WFS_VERSION_MAX; // AUTO
324 if ( version == QLatin1String( "1.0.0" ) )
325 versionIdx = WFS_VERSION_1_0;
326 else if ( version == QLatin1String( "1.1.0" ) )
327 versionIdx = WFS_VERSION_1_1;
328 else if ( version == QLatin1String( "2.0.0" ) )
329 versionIdx = WFS_VERSION_2_0;
330 else if ( version == QLatin1String( "OGC_API_FEATURES" ) )
331 versionIdx = WFS_VERSION_API_FEATURES_1_0;
332 cmbVersion->setCurrentIndex( versionIdx );
333
334 // Enable/disable these items per WFS versions
335 wfsVersionCurrentIndexChanged( versionIdx );
336
337 mHttpHeaders->setHeaders( QgsHttpHeaders( QgsOwsConnection::settingsHeaders->value( { mServiceName.toLower(), mOriginalConnName } ) ) );
338
339 txtMaxNumFeatures->setText( QgsOwsConnection::settingsMaxNumFeatures->value( detailsParameters ) );
340
341 // Only default to paging enabled if WFS 2.0.0 or higher
342 const QString pagingEnabled = QgsOwsConnection::settingsPagingEnabled->value( detailsParameters );
343 if ( pagingEnabled == QLatin1String( "enabled" ) )
344 cmbFeaturePaging->setCurrentIndex( static_cast<int>( QgsNewHttpConnection::WfsFeaturePagingIndex::ENABLED ) );
345 else if ( pagingEnabled == QLatin1String( "disabled" ) )
346 cmbFeaturePaging->setCurrentIndex( static_cast<int>( QgsNewHttpConnection::WfsFeaturePagingIndex::DISABLED ) );
347 else
348 cmbFeaturePaging->setCurrentIndex( static_cast<int>( QgsNewHttpConnection::WfsFeaturePagingIndex::DEFAULT ) );
349
350 txtPageSize->setText( QgsOwsConnection::settingsPagesize->value( detailsParameters ) );
351}
352
354{
355 QUrl url( txtUrl->text().trimmed() );
356 QUrlQuery query( url );
357 const QList<QPair<QString, QString>> items = query.queryItems( QUrl::FullyEncoded );
358 QHash<QString, QPair<QString, QString>> params;
359 for ( const QPair<QString, QString> &it : items )
360 {
361 params.insert( it.first.toUpper(), it );
362 }
363
364 if ( params[QStringLiteral( "SERVICE" )].second.toUpper() == "WMS" || params[QStringLiteral( "SERVICE" )].second.toUpper() == "WFS" || params[QStringLiteral( "SERVICE" )].second.toUpper() == "WCS" )
365 {
366 query.removeQueryItem( params.value( QStringLiteral( "SERVICE" ) ).first );
367 query.removeQueryItem( params.value( QStringLiteral( "REQUEST" ) ).first );
368 query.removeQueryItem( params.value( QStringLiteral( "FORMAT" ) ).first );
369 }
370
371 url.setQuery( query );
372
373 if ( url.path( QUrl::FullyEncoded ).isEmpty() )
374 {
375 url.setPath( fromEncodedComponent_helper( "/" ) );
376 }
377 return url;
378}
379
381{
382 const QString newConnectionName = txtName->text();
383
384 if ( !validate() )
385 return;
386
387 QgsSettings settings;
388
389 // on rename delete original entry first
390 if ( !mOriginalConnName.isNull() && mOriginalConnName != newConnectionName )
391 {
392 QgsOwsConnection::sTreeOwsConnections->deleteItem( mOriginalConnName, { mServiceName.toLower() } );
393 settings.sync();
394 }
395
396 QStringList detailsParameters = { mServiceName.toLower(), newConnectionName };
397
398 const QUrl url( urlTrimmed() );
399 QgsOwsConnection::settingsUrl->setValue( url.toString(), detailsParameters );
400
401 if ( mTypes & ConnectionWfs )
402 {
403 QgsOwsConnection::settingsIgnoreAxisOrientation->setValue( cbxWfsIgnoreAxisOrientation->isChecked(), detailsParameters );
404 QgsOwsConnection::settingsInvertAxisOrientation->setValue( cbxWfsInvertAxisOrientation->isChecked(), detailsParameters );
405 QgsOwsConnection::settingsPreferCoordinatesForWfsT11->setValue( cbxWfsUseGml2EncodingForTransactions->isChecked(), detailsParameters );
406 }
407 if ( mTypes & ConnectionWms || mTypes & ConnectionWcs )
408 {
409 QgsOwsConnection::settingsIgnoreAxisOrientation->setValue( cbxWmsIgnoreAxisOrientation->isChecked(), detailsParameters );
410 QgsOwsConnection::settingsInvertAxisOrientation->setValue( cbxWmsInvertAxisOrientation->isChecked(), detailsParameters );
411
412 QgsOwsConnection::settingsReportedLayerExtents->setValue( cbxWmsIgnoreReportedLayerExtents->isChecked(), detailsParameters );
413 QgsOwsConnection::settingsIgnoreGetMapURI->setValue( cbxIgnoreGetMapURI->isChecked(), detailsParameters );
414 QgsOwsConnection::settingsSmoothPixmapTransform->setValue( cbxSmoothPixmapTransform->isChecked(), detailsParameters );
415
416 Qgis::DpiMode dpiMode = cmbDpiMode->currentData().value<Qgis::DpiMode>();
417 QgsOwsConnection::settingsDpiMode->setValue( dpiMode, detailsParameters );
418 Qgis::TilePixelRatio tilePixelRatio = cmbTilePixelRatio->currentData().value<Qgis::TilePixelRatio>();
419 QgsOwsConnection::settingsTilePixelRatio->setValue( tilePixelRatio, detailsParameters );
420
421 QgsOwsConnection::settingsHeaders->setValue( mHttpHeaders->httpHeaders().headers(), detailsParameters );
422 }
423 if ( mTypes & ConnectionWms )
424 {
425 QgsOwsConnection::settingsIgnoreGetFeatureInfoURI->setValue( cbxIgnoreGetFeatureInfoURI->isChecked(), detailsParameters );
426 QgsOwsConnection::settingsFeatureCount->setValue( sbFeatureCount->value(), detailsParameters );
427 }
428 if ( mTypes & ConnectionWfs )
429 {
430 QString version = QStringLiteral( "auto" );
431 switch ( cmbVersion->currentIndex() )
432 {
433 case WFS_VERSION_MAX:
434 version = QStringLiteral( "auto" );
435 break;
436 case WFS_VERSION_1_0:
437 version = QStringLiteral( "1.0.0" );
438 break;
439 case WFS_VERSION_1_1:
440 version = QStringLiteral( "1.1.0" );
441 break;
442 case WFS_VERSION_2_0:
443 version = QStringLiteral( "2.0.0" );
444 break;
446 version = QStringLiteral( "OGC_API_FEATURES" );
447 break;
448 }
449 QgsOwsConnection::settingsVersion->setValue( version, detailsParameters );
450 QgsOwsConnection::settingsMaxNumFeatures->setValue( txtMaxNumFeatures->text(), detailsParameters );
451 QgsOwsConnection::settingsPagesize->setValue( txtPageSize->text(), detailsParameters );
452
453 QString pagingEnabled = QStringLiteral( "default" );
454 switch ( cmbFeaturePaging->currentIndex() )
455 {
457 pagingEnabled = QStringLiteral( "default" );
458 break;
460 pagingEnabled = QStringLiteral( "enabled" );
461 break;
463 pagingEnabled = QStringLiteral( "disabled" );
464 break;
465 }
466 QgsOwsConnection::settingsPagingEnabled->setValue( pagingEnabled, detailsParameters );
467 }
468
469 QStringList credentialsParameters = { mServiceName.toLower(), newConnectionName };
470 QgsOwsConnection::settingsUsername->setValue( mAuthSettings->username(), credentialsParameters );
471 QgsOwsConnection::settingsPassword->setValue( mAuthSettings->password(), credentialsParameters );
472 QgsOwsConnection::settingsAuthCfg->setValue( mAuthSettings->configId(), credentialsParameters );
473
474 if ( mHttpHeaders->isVisible() )
475 QgsOwsConnection::settingsHeaders->setValue( mHttpHeaders->httpHeaders().headers(), credentialsParameters );
476
477 QgsOwsConnection::sTreeOwsConnections->setSelectedItem( newConnectionName, { mServiceName.toLower() } );
478
479 QDialog::accept();
480}
481
482void QgsNewHttpConnection::showHelp()
483{
484 QgsHelp::openHelp( QStringLiteral( "working_with_ogc/index.html" ) );
485}
TilePixelRatio
DpiMode enum.
Definition qgis.h:3168
@ Undefined
Undefined (not scale)
@ HighDpi
High (192 DPI)
@ StandardDpi
Standard (96 DPI)
DpiMode
DpiMode enum.
Definition qgis.h:3154
@ GeoServer
GeoServer.
Widget for entering authentication credentials both in the form username/password and by using QGIS A...
static void enableAutoGeometryRestore(QWidget *widget, const QString &key=QString())
Register the widget to allow its position to be automatically saved and restored when open and closed...
Definition qgsgui.cpp:210
static void openHelp(const QString &key)
Opens help topic for the given help key using default system web browser.
Definition qgshelp.cpp:39
This class implements simple http header management.
QPushButton * testConnectButton()
Returns the "test connection" button.
QgsAuthSettingsWidget * authSettingsWidget()
Returns the current authentication settings widget.
QComboBox * wfsPagingComboBox()
Returns the "WFS paging" combobox.
virtual bool validate()
Returns true if dialog settings are valid, or false if current settings are not valid and the dialog ...
QgsNewHttpConnection(QWidget *parent=nullptr, QgsNewHttpConnection::ConnectionTypes types=ConnectionWms, const QString &serviceName="WMS", const QString &connectionName=QString(), QgsNewHttpConnection::Flags flags=QgsNewHttpConnection::Flags(), Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)
Constructor for QgsNewHttpConnection.
QString name() const
Returns the current connection name.
@ FlagShowHttpSettings
Display the 'http' group.
@ FlagHideAuthenticationGroup
Hide the Authentication group.
@ FlagShowTestConnection
Display the 'test connection' button.
QCheckBox * wfsUseGml2EncodingForTransactions()
Returns the "Use GML2 encoding for transactions" checkbox.
QComboBox * wfsVersionComboBox()
Returns the "WFS version" combobox.
virtual QString wmsSettingsKey(const QString &base, const QString &connectionName) const
Returns the QSettings key for WMS related settings for the connection.
virtual QString wfsSettingsKey(const QString &base, const QString &connectionName) const
Returns the QSettings key for WFS related settings for the connection.
QString url() const
Returns the current connection url.
QPushButton * wfsVersionDetectButton()
Returns the "WFS version detect" button.
static const QgsSettingsEntryBool * settingsIgnoreReportedLayerExtentsDefault
QUrl urlTrimmed() const
Returns the url.
QLineEdit * wfsPageSizeLineEdit()
Returns the "WFS page size" edit.
void updateServiceSpecificSettings()
Triggers a resync of the GUI widgets for the service specific settings (i.e.
@ ConnectionWms
WMS connection.
@ ConnectionWfs
WFS connection.
@ ConnectionWcs
WCS connection.
QFlags< ConnectionType > ConnectionTypes
static const QgsSettingsEntryInteger * settingsFeatureCount
static const QgsSettingsEntryBool * settingsPreferCoordinatesForWfsT11
static const QgsSettingsEntryString * settingsPagingEnabled
static const QgsSettingsEntryString * settingsMaxNumFeatures
static QgsSettingsTreeNamedListNode * sTreeOwsConnections
static const QgsSettingsEntryBool * settingsIgnoreGetFeatureInfoURI
static const QgsSettingsEntryString * settingsPassword
static const QgsSettingsEntryBool * settingsReportedLayerExtents
static const QgsSettingsEntryEnumFlag< Qgis::DpiMode > * settingsDpiMode
static const QgsSettingsEntryBool * settingsIgnoreAxisOrientation
static const QgsSettingsEntryBool * settingsInvertAxisOrientation
static const QgsSettingsEntryString * settingsVersion
static const QgsSettingsEntryString * settingsPagesize
static const QgsSettingsEntryString * settingsAuthCfg
static const QgsSettingsEntryEnumFlag< Qgis::TilePixelRatio > * settingsTilePixelRatio
static const QgsSettingsEntryVariantMap * settingsHeaders
static const QgsSettingsEntryString * settingsUsername
static const QgsSettingsEntryBool * settingsSmoothPixmapTransform
static const QgsSettingsEntryString * settingsUrl
static const QgsSettingsEntryBool * settingsIgnoreGetMapURI
T value(const QString &dynamicKeyPart=QString()) const
Returns settings value.
bool setValue(const T &value, const QString &dynamicKeyPart=QString()) const
Set settings value.
bool exists(const QString &dynamicKeyPart=QString()) const
Returns true if the settings is contained in the underlying QSettings.
A boolean settings entry.
void deleteItem(const QString &item, const QStringList &parentsNamedItems=QStringList())
Deletes a named item from the named list node.
void setSelectedItem(const QString &item, const QStringList &parentsNamedItems=QStringList())
Sets the selected named item from the named list node.
This class is a composition of two QSettings instances:
Definition qgssettings.h:64
void sync()
Writes any unsaved changes to permanent storage, and reloads any settings that have been changed in t...
QString fromEncodedComponent_helper(const QByteArray &ba)