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