QGIS API Documentation  3.18.1-Zürich (202f1bf7e5)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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  ***************************************************************************/
17 #include "qgsnewhttpconnection.h"
18 #include "qgsauthsettingswidget.h"
19 #include "qgssettings.h"
20 #include "qgshelp.h"
21 #include "qgsgui.h"
22 
23 #include <QMessageBox>
24 #include <QUrl>
25 #include <QPushButton>
26 #include <QRegExp>
27 #include <QRegExpValidator>
28 #include <QtEndian>
29 #include <QUrlQuery>
30 
31 QgsNewHttpConnection::QgsNewHttpConnection( QWidget *parent, ConnectionTypes types, const QString &baseKey, const QString &connectionName, QgsNewHttpConnection::Flags flags, Qt::WindowFlags fl )
32  : QDialog( parent, fl )
33  , mTypes( types )
34  , mBaseKey( baseKey )
35  , mOriginalConnName( connectionName )
36 {
37  setupUi( this );
38 
39  if ( !( flags & FlagShowHttpSettings ) )
40  mHttpGroupBox->hide();
41 
43 
44  connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsNewHttpConnection::showHelp );
45 
46  QRegExp rx( "/connections-([^/]+)/" );
47  if ( rx.indexIn( baseKey ) != -1 )
48  {
49  QString connectionType( rx.cap( 1 ).toUpper() );
50  if ( connectionType == QLatin1String( "WMS" ) )
51  {
52  connectionType = QStringLiteral( "WMS/WMTS" );
53  }
54  setWindowTitle( tr( "Create a New %1 Connection" ).arg( connectionType ) );
55  }
56 
57  // It would be obviously much better to use mBaseKey also for credentials,
58  // but for some strange reason a different hardcoded key was used instead.
59  // WFS and WMS credentials were mixed with the same key WMS.
60  // Only WMS and WFS providers are using QgsNewHttpConnection at this moment
61  // using connection-wms and connection-wfs -> parse credential key from it.
62  mCredentialsBaseKey = mBaseKey.split( '-' ).last().toUpper();
63 
64  txtName->setValidator( new QRegExpValidator( QRegExp( "[^\\/]+" ), txtName ) );
65 
66  cmbDpiMode->clear();
67  cmbDpiMode->addItem( tr( "all" ) );
68  cmbDpiMode->addItem( tr( "off" ) );
69  cmbDpiMode->addItem( tr( "QGIS" ) );
70  cmbDpiMode->addItem( tr( "UMN" ) );
71  cmbDpiMode->addItem( tr( "GeoServer" ) );
72 
73  cmbVersion->clear();
74  cmbVersion->addItem( tr( "Maximum" ) );
75  cmbVersion->addItem( tr( "1.0" ) );
76  cmbVersion->addItem( tr( "1.1" ) );
77  cmbVersion->addItem( tr( "2.0" ) );
78  cmbVersion->addItem( tr( "OGC API - Features" ) );
79  connect( cmbVersion,
80  static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ),
81  this, &QgsNewHttpConnection::wfsVersionCurrentIndexChanged );
82 
83  connect( cbxWfsFeaturePaging, &QCheckBox::stateChanged,
84  this, &QgsNewHttpConnection::wfsFeaturePagingStateChanged );
85 
86  if ( !connectionName.isEmpty() )
87  {
88  // populate the dialog with the information stored for the connection
89  // populate the fields with the stored setting parameters
90 
91  QgsSettings settings;
92 
93  QString key = mBaseKey + connectionName;
94  QString credentialsKey = "qgis/" + mCredentialsBaseKey + '/' + connectionName;
95  txtName->setText( connectionName );
96  txtUrl->setText( settings.value( key + "/url" ).toString() );
97  mRefererLineEdit->setText( settings.value( key + "/referer" ).toString() );
98 
100 
101  // Authentication
102  mAuthSettings->setUsername( settings.value( credentialsKey + "/username" ).toString() );
103  mAuthSettings->setPassword( settings.value( credentialsKey + "/password" ).toString() );
104  mAuthSettings->setConfigId( settings.value( credentialsKey + "/authcfg" ).toString() );
105  }
106  mWfsVersionDetectButton->setDisabled( txtUrl->text().isEmpty() );
107 
108  if ( !( mTypes & ConnectionWms ) && !( mTypes & ConnectionWcs ) )
109  {
110  mWmsOptionsGroupBox->setVisible( false );
111  mGroupBox->layout()->removeWidget( mWmsOptionsGroupBox );
112  }
113  if ( !( mTypes & ConnectionWfs ) )
114  {
115  mWfsOptionsGroupBox->setVisible( false );
116  mGroupBox->layout()->removeWidget( mWfsOptionsGroupBox );
117  }
118 
119  if ( mTypes & ConnectionWcs )
120  {
121  cbxIgnoreGetMapURI->setText( tr( "Ignore GetCoverage URI reported in capabilities" ) );
122  cbxWmsIgnoreAxisOrientation->setText( tr( "Ignore axis orientation" ) );
123  if ( !( mTypes & ConnectionWms ) )
124  {
125  mWmsOptionsGroupBox->setTitle( tr( "WCS Options" ) );
126 
127  cbxIgnoreGetFeatureInfoURI->setVisible( false );
128  mGroupBox->layout()->removeWidget( cbxIgnoreGetFeatureInfoURI );
129 
130  cmbDpiMode->setVisible( false );
131  mGroupBox->layout()->removeWidget( cmbDpiMode );
132  lblDpiMode->setVisible( false );
133  mGroupBox->layout()->removeWidget( lblDpiMode );
134  }
135  }
136 
137  if ( !( flags & FlagShowTestConnection ) )
138  {
139  mTestConnectionButton->hide();
140  mGroupBox->layout()->removeWidget( mTestConnectionButton );
141  }
142 
143  if ( flags & FlagHideAuthenticationGroup )
144  {
145  mAuthGroupBox->hide();
146  mGroupBox->layout()->removeWidget( mAuthGroupBox );
147  }
148  // Adjust height
149  int w = width();
150  adjustSize();
151  resize( w, height() );
152 
153  connect( txtName, &QLineEdit::textChanged, this, &QgsNewHttpConnection::nameChanged );
154  connect( txtUrl, &QLineEdit::textChanged, this, &QgsNewHttpConnection::urlChanged );
155 
156  buttonBox->button( QDialogButtonBox::Ok )->setDisabled( true );
157  connect( txtName, &QLineEdit::textChanged, this, &QgsNewHttpConnection::updateOkButtonState );
158  connect( txtUrl, &QLineEdit::textChanged, this, &QgsNewHttpConnection::updateOkButtonState );
159 
160  nameChanged( connectionName );
161 }
162 
163 void QgsNewHttpConnection::wfsVersionCurrentIndexChanged( int index )
164 {
165  // For now 2019-06-06, leave paging checkable for some WFS version 1.1 servers with support
166  cbxWfsFeaturePaging->setEnabled( index == WFS_VERSION_MAX || index >= WFS_VERSION_2_0 );
167  lblPageSize->setEnabled( cbxWfsFeaturePaging->isChecked() && ( index == WFS_VERSION_MAX || index >= WFS_VERSION_1_1 ) );
168  txtPageSize->setEnabled( cbxWfsFeaturePaging->isChecked() && ( index == WFS_VERSION_MAX || index >= WFS_VERSION_1_1 ) );
169  cbxWfsIgnoreAxisOrientation->setEnabled( index != WFS_VERSION_1_0 && index != WFS_VERSION_API_FEATURES_1_0 );
170  cbxWfsInvertAxisOrientation->setEnabled( index != WFS_VERSION_API_FEATURES_1_0 );
171  wfsUseGml2EncodingForTransactions()->setEnabled( index == WFS_VERSION_1_1 );
172 }
173 
174 void QgsNewHttpConnection::wfsFeaturePagingStateChanged( int state )
175 {
176  lblPageSize->setEnabled( state == Qt::Checked );
177  txtPageSize->setEnabled( state == Qt::Checked );
178 }
179 
181 {
182  return txtName->text();
183 }
184 
186 {
187  return txtUrl->text();
188 }
189 
190 void QgsNewHttpConnection::nameChanged( const QString &text )
191 {
192  Q_UNUSED( text )
193  buttonBox->button( QDialogButtonBox::Ok )->setDisabled( txtName->text().isEmpty() || txtUrl->text().isEmpty() );
194 }
195 
196 void QgsNewHttpConnection::urlChanged( const QString &text )
197 {
198  Q_UNUSED( text )
199  buttonBox->button( QDialogButtonBox::Ok )->setDisabled( txtName->text().isEmpty() || txtUrl->text().isEmpty() );
200  mWfsVersionDetectButton->setDisabled( txtUrl->text().isEmpty() );
201 }
202 
203 void QgsNewHttpConnection::updateOkButtonState()
204 {
205  bool enabled = !txtName->text().isEmpty() && !txtUrl->text().isEmpty();
206  buttonBox->button( QDialogButtonBox::Ok )->setEnabled( enabled );
207 }
208 
210 {
211  QgsSettings settings;
212  QString key = mBaseKey + txtName->text();
213 
214  // warn if entry was renamed to an existing connection
215  if ( ( mOriginalConnName.isNull() || mOriginalConnName.compare( txtName->text(), Qt::CaseInsensitive ) != 0 ) &&
216  settings.contains( key + "/url" ) &&
217  QMessageBox::question( this,
218  tr( "Save Connection" ),
219  tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ),
220  QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
221  {
222  return false;
223  }
224 
225  if ( ! mAuthSettings->password().isEmpty() &&
226  QMessageBox::question( this,
227  tr( "Saving Passwords" ),
228  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." ),
229  QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
230  {
231  return false;
232  }
233 
234  return true;
235 }
236 
238 {
239  return mTestConnectionButton;
240 }
241 
243 {
244  return mAuthSettings;
245 }
246 
248 {
249  return mWfsVersionDetectButton;
250 }
251 
253 {
254  return cmbVersion;
255 }
256 
258 {
259  return cbxWfsFeaturePaging;
260 }
261 
263 {
264  return cbxWfsUseGml2EncodingForTransactions;
265 }
266 
268 {
269  return txtPageSize;
270 }
271 
272 QString QgsNewHttpConnection::wfsSettingsKey( const QString &base, const QString &connectionName ) const
273 {
274  return base + connectionName;
275 }
276 
277 QString QgsNewHttpConnection::wmsSettingsKey( const QString &base, const QString &connectionName ) const
278 {
279  return base + connectionName;
280 }
281 
283 {
284  QgsSettings settings;
285  QString wfsKey = wfsSettingsKey( mBaseKey, mOriginalConnName );
286  QString wmsKey = wmsSettingsKey( mBaseKey, mOriginalConnName );
287 
288  cbxIgnoreGetMapURI->setChecked( settings.value( wmsKey + "/ignoreGetMapURI", false ).toBool() );
289  cbxWmsIgnoreReportedLayerExtents->setChecked( settings.value( wmsKey + QStringLiteral( "/ignoreReportedLayerExtents" ), false ).toBool() );
290  cbxWfsIgnoreAxisOrientation->setChecked( settings.value( wfsKey + "/ignoreAxisOrientation", false ).toBool() );
291  cbxWfsInvertAxisOrientation->setChecked( settings.value( wfsKey + "/invertAxisOrientation", false ).toBool() );
292  cbxWfsUseGml2EncodingForTransactions->setChecked( settings.value( wfsKey + "/preferCoordinatesForWfsT11", false ).toBool() );
293 
294  cbxWmsIgnoreAxisOrientation->setChecked( settings.value( wmsKey + "/ignoreAxisOrientation", false ).toBool() );
295  cbxWmsInvertAxisOrientation->setChecked( settings.value( wmsKey + "/invertAxisOrientation", false ).toBool() );
296  cbxIgnoreGetFeatureInfoURI->setChecked( settings.value( wmsKey + "/ignoreGetFeatureInfoURI", false ).toBool() );
297  cbxSmoothPixmapTransform->setChecked( settings.value( wmsKey + "/smoothPixmapTransform", false ).toBool() );
298 
299  int dpiIdx;
300  switch ( settings.value( wmsKey + "/dpiMode", 7 ).toInt() )
301  {
302  case 0: // off
303  dpiIdx = 1;
304  break;
305  case 1: // QGIS
306  dpiIdx = 2;
307  break;
308  case 2: // UMN
309  dpiIdx = 3;
310  break;
311  case 4: // GeoServer
312  dpiIdx = 4;
313  break;
314  default: // other => all
315  dpiIdx = 0;
316  break;
317  }
318  cmbDpiMode->setCurrentIndex( dpiIdx );
319 
320  QString version = settings.value( wfsKey + "/version" ).toString();
321  int versionIdx = WFS_VERSION_MAX; // AUTO
322  if ( version == QLatin1String( "1.0.0" ) )
323  versionIdx = WFS_VERSION_1_0;
324  else if ( version == QLatin1String( "1.1.0" ) )
325  versionIdx = WFS_VERSION_1_1;
326  else if ( version == QLatin1String( "2.0.0" ) )
327  versionIdx = WFS_VERSION_2_0;
328  else if ( version == QLatin1String( "OGC_API_FEATURES" ) )
329  versionIdx = WFS_VERSION_API_FEATURES_1_0;
330  cmbVersion->setCurrentIndex( versionIdx );
331 
332  // Enable/disable these items per WFS versions
333  wfsVersionCurrentIndexChanged( versionIdx );
334 
335  mRefererLineEdit->setText( settings.value( wmsKey + "/referer" ).toString() );
336  txtMaxNumFeatures->setText( settings.value( wfsKey + "/maxnumfeatures" ).toString() );
337 
338  // Only default to paging enabled if WFS 2.0.0 or higher
339  bool pagingEnabled = settings.value( wfsKey + "/pagingenabled", ( versionIdx == WFS_VERSION_MAX || versionIdx >= WFS_VERSION_2_0 ) ).toBool();
340  txtPageSize->setText( settings.value( wfsKey + "/pagesize" ).toString() );
341  cbxWfsFeaturePaging->setChecked( pagingEnabled );
342 }
343 
344 // Mega ewwww. all this is taken from Qt's QUrl::setEncodedPath compatibility helper.
345 // (I can't see any way to port the below code to NOT require this).
346 
347 inline char toHexUpper( uint value ) noexcept
348 {
349  return "0123456789ABCDEF"[value & 0xF];
350 }
351 
352 static inline ushort encodeNibble( ushort c )
353 {
354  return ushort( toHexUpper( c ) );
355 }
356 
357 bool qt_is_ascii( const char *&ptr, const char *end ) noexcept
358 {
359  while ( ptr + 4 <= end )
360  {
361  quint32 data = qFromUnaligned<quint32>( ptr );
362  if ( data &= 0x80808080U )
363  {
364 #if Q_BYTE_ORDER == Q_BIG_ENDIAN
365  uint idx = qCountLeadingZeroBits( data );
366 #else
367  uint idx = qCountTrailingZeroBits( data );
368 #endif
369  ptr += idx / 8;
370  return false;
371  }
372  ptr += 4;
373  }
374  while ( ptr != end )
375  {
376  if ( quint8( *ptr ) & 0x80 )
377  return false;
378  ++ptr;
379  }
380  return true;
381 }
382 
383 QString fromEncodedComponent_helper( const QByteArray &ba )
384 {
385  if ( ba.isNull() )
386  return QString();
387  // scan ba for anything above or equal to 0x80
388  // control points below 0x20 are fine in QString
389  const char *in = ba.constData();
390  const char *const end = ba.constEnd();
391  if ( qt_is_ascii( in, end ) )
392  {
393  // no non-ASCII found, we're safe to convert to QString
394  return QString::fromLatin1( ba, ba.size() );
395  }
396  // we found something that we need to encode
397  QByteArray intermediate = ba;
398  intermediate.resize( ba.size() * 3 - ( in - ba.constData() ) );
399  uchar *out = reinterpret_cast<uchar *>( intermediate.data() + ( in - ba.constData() ) );
400  for ( ; in < end; ++in )
401  {
402  if ( *in & 0x80 )
403  {
404  // encode
405  *out++ = '%';
406  *out++ = encodeNibble( uchar( *in ) >> 4 );
407  *out++ = encodeNibble( uchar( *in ) & 0xf );
408  }
409  else
410  {
411  // keep
412  *out++ = uchar( *in );
413  }
414  }
415  // now it's safe to call fromLatin1
416  return QString::fromLatin1( intermediate, out - reinterpret_cast<uchar *>( intermediate.data() ) );
417 }
418 
419 
421 {
422  QUrl url( txtUrl->text().trimmed() );
423  QUrlQuery query( url );
424  const QList<QPair<QString, QString> > items = query.queryItems( QUrl::FullyEncoded );
425  QHash< QString, QPair<QString, QString> > params;
426  for ( const QPair<QString, QString> &it : items )
427  {
428  params.insert( it.first.toUpper(), it );
429  }
430 
431  if ( params[QStringLiteral( "SERVICE" )].second.toUpper() == "WMS" ||
432  params[QStringLiteral( "SERVICE" )].second.toUpper() == "WFS" ||
433  params[QStringLiteral( "SERVICE" )].second.toUpper() == "WCS" )
434  {
435  query.removeQueryItem( params.value( QStringLiteral( "SERVICE" ) ).first );
436  query.removeQueryItem( params.value( QStringLiteral( "REQUEST" ) ).first );
437  query.removeQueryItem( params.value( QStringLiteral( "FORMAT" ) ).first );
438  }
439 
440  url.setQuery( query );
441 
442  if ( url.path( QUrl::FullyEncoded ).isEmpty() )
443  {
444  url.setPath( fromEncodedComponent_helper( "/" ) );
445  }
446  return url;
447 }
448 
450 {
451  QgsSettings settings;
452  QString key = mBaseKey + txtName->text();
453  QString credentialsKey = "qgis/" + mCredentialsBaseKey + '/' + txtName->text();
454 
455  if ( !validate() )
456  return;
457 
458  // on rename delete original entry first
459  if ( !mOriginalConnName.isNull() && mOriginalConnName != key )
460  {
461  settings.remove( mBaseKey + mOriginalConnName );
462  settings.remove( "qgis/" + mCredentialsBaseKey + '/' + mOriginalConnName );
463  settings.sync();
464  }
465 
466  QUrl url( urlTrimmed() );
467  settings.setValue( key + "/url", url.toString() );
468 
469  QString wfsKey = wfsSettingsKey( mBaseKey, txtName->text() );
470  QString wmsKey = wmsSettingsKey( mBaseKey, txtName->text() );
471 
472  if ( mTypes & ConnectionWfs )
473  {
474  settings.setValue( wfsKey + "/ignoreAxisOrientation", cbxWfsIgnoreAxisOrientation->isChecked() );
475  settings.setValue( wfsKey + "/invertAxisOrientation", cbxWfsInvertAxisOrientation->isChecked() );
476  settings.setValue( wfsKey + "/preferCoordinatesForWfsT11", cbxWfsUseGml2EncodingForTransactions->isChecked() );
477  }
478  if ( mTypes & ConnectionWms || mTypes & ConnectionWcs )
479  {
480  settings.setValue( wmsKey + "/ignoreAxisOrientation", cbxWmsIgnoreAxisOrientation->isChecked() );
481  settings.setValue( wmsKey + "/invertAxisOrientation", cbxWmsInvertAxisOrientation->isChecked() );
482 
483  settings.setValue( wmsKey + QStringLiteral( "/ignoreReportedLayerExtents" ), cbxWmsIgnoreReportedLayerExtents->isChecked() );
484  settings.setValue( wmsKey + "/ignoreGetMapURI", cbxIgnoreGetMapURI->isChecked() );
485  settings.setValue( wmsKey + "/smoothPixmapTransform", cbxSmoothPixmapTransform->isChecked() );
486 
487  int dpiMode = 0;
488  switch ( cmbDpiMode->currentIndex() )
489  {
490  case 0: // all => QGIS|UMN|GeoServer
491  dpiMode = 7;
492  break;
493  case 1: // off
494  dpiMode = 0;
495  break;
496  case 2: // QGIS
497  dpiMode = 1;
498  break;
499  case 3: // UMN
500  dpiMode = 2;
501  break;
502  case 4: // GeoServer
503  dpiMode = 4;
504  break;
505  }
506 
507  settings.setValue( wmsKey + "/dpiMode", dpiMode );
508 
509  settings.setValue( wmsKey + "/referer", mRefererLineEdit->text() );
510  }
511  if ( mTypes & ConnectionWms )
512  {
513  settings.setValue( wmsKey + "/ignoreGetFeatureInfoURI", cbxIgnoreGetFeatureInfoURI->isChecked() );
514  }
515  if ( mTypes & ConnectionWfs )
516  {
517  QString version = QStringLiteral( "auto" );
518  switch ( cmbVersion->currentIndex() )
519  {
520  case WFS_VERSION_MAX:
521  version = QStringLiteral( "auto" );
522  break;
523  case WFS_VERSION_1_0:
524  version = QStringLiteral( "1.0.0" );
525  break;
526  case WFS_VERSION_1_1:
527  version = QStringLiteral( "1.1.0" );
528  break;
529  case WFS_VERSION_2_0:
530  version = QStringLiteral( "2.0.0" );
531  break;
533  version = QStringLiteral( "OGC_API_FEATURES" );
534  break;
535  }
536  settings.setValue( wfsKey + "/version", version );
537 
538  settings.setValue( wfsKey + "/maxnumfeatures", txtMaxNumFeatures->text() );
539 
540  settings.setValue( wfsKey + "/pagesize", txtPageSize->text() );
541  settings.setValue( wfsKey + "/pagingenabled", cbxWfsFeaturePaging->isChecked() );
542  }
543 
544  settings.setValue( credentialsKey + "/username", mAuthSettings->username() );
545  settings.setValue( credentialsKey + "/password", mAuthSettings->password() );
546 
547  settings.setValue( credentialsKey + "/authcfg", mAuthSettings->configId() );
548 
549  if ( mHttpGroupBox->isVisible() )
550  settings.setValue( key + "/referer", mRefererLineEdit->text() );
551 
552  settings.setValue( mBaseKey + "/selected", txtName->text() );
553 
554  QDialog::accept();
555 }
556 
557 void QgsNewHttpConnection::showHelp()
558 {
559  QgsHelp::openHelp( QStringLiteral( "working_with_ogc/index.html" ) );
560 }
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:156
static void openHelp(const QString &key)
Opens help topic for the given help key using default system web browser.
Definition: qgshelp.cpp:36
QgsNewHttpConnection(QWidget *parent=nullptr, QgsNewHttpConnection::ConnectionTypes types=ConnectionWms, const QString &baseKey="qgis/connections-wms/", const QString &connectionName=QString(), QgsNewHttpConnection::Flags flags=QgsNewHttpConnection::Flags(), Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)
Constructor for QgsNewHttpConnection.
QPushButton * testConnectButton()
Returns the "test connection" button.
QgsAuthSettingsWidget * authSettingsWidget()
Returns the current authentication settings widget.
QCheckBox * wfsPagingEnabledCheckBox()
Returns the "WFS paging enabled" checkbox.
virtual bool validate()
Returns true if dialog settings are valid, or false if current settings are not valid and the dialog ...
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.
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.
This class is a composition of two QSettings instances:
Definition: qgssettings.h:62
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
bool contains(const QString &key, QgsSettings::Section section=QgsSettings::NoSection) const
Returns true if there exists a setting called key; returns false otherwise.
void sync()
Writes any unsaved changes to permanent storage, and reloads any settings that have been changed in t...
void remove(const QString &key, QgsSettings::Section section=QgsSettings::NoSection)
Removes the setting key and any sub-settings of key in a section.
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
QString fromEncodedComponent_helper(const QByteArray &ba)
bool qt_is_ascii(const char *&ptr, const char *end) noexcept
char toHexUpper(uint value) noexcept