QGIS API Documentation  3.20.0-Odense (decaadbb31)
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  else
119  {
120  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)" ) );
121  }
122 
123  if ( mTypes & ConnectionWcs )
124  {
125  cbxIgnoreGetMapURI->setText( tr( "Ignore GetCoverage URI reported in capabilities" ) );
126  cbxWmsIgnoreAxisOrientation->setText( tr( "Ignore axis orientation" ) );
127  if ( !( mTypes & ConnectionWms ) )
128  {
129  mWmsOptionsGroupBox->setTitle( tr( "WCS Options" ) );
130 
131  cbxIgnoreGetFeatureInfoURI->setVisible( false );
132  mGroupBox->layout()->removeWidget( cbxIgnoreGetFeatureInfoURI );
133 
134  cmbDpiMode->setVisible( false );
135  mGroupBox->layout()->removeWidget( cmbDpiMode );
136  lblDpiMode->setVisible( false );
137  mGroupBox->layout()->removeWidget( lblDpiMode );
138  }
139  }
140 
141  if ( !( flags & FlagShowTestConnection ) )
142  {
143  mTestConnectionButton->hide();
144  mGroupBox->layout()->removeWidget( mTestConnectionButton );
145  }
146 
147  if ( flags & FlagHideAuthenticationGroup )
148  {
149  mAuthGroupBox->hide();
150  mGroupBox->layout()->removeWidget( mAuthGroupBox );
151  }
152  // Adjust height
153  int w = width();
154  adjustSize();
155  resize( w, height() );
156 
157  connect( txtName, &QLineEdit::textChanged, this, &QgsNewHttpConnection::nameChanged );
158  connect( txtUrl, &QLineEdit::textChanged, this, &QgsNewHttpConnection::urlChanged );
159 
160  buttonBox->button( QDialogButtonBox::Ok )->setDisabled( true );
161  connect( txtName, &QLineEdit::textChanged, this, &QgsNewHttpConnection::updateOkButtonState );
162  connect( txtUrl, &QLineEdit::textChanged, this, &QgsNewHttpConnection::updateOkButtonState );
163 
164  nameChanged( connectionName );
165 }
166 
167 void QgsNewHttpConnection::wfsVersionCurrentIndexChanged( int index )
168 {
169  // For now 2019-06-06, leave paging checkable for some WFS version 1.1 servers with support
170  cbxWfsFeaturePaging->setEnabled( index == WFS_VERSION_MAX || index >= WFS_VERSION_2_0 );
171  lblPageSize->setEnabled( cbxWfsFeaturePaging->isChecked() && ( index == WFS_VERSION_MAX || index >= WFS_VERSION_1_1 ) );
172  txtPageSize->setEnabled( cbxWfsFeaturePaging->isChecked() && ( index == WFS_VERSION_MAX || index >= WFS_VERSION_1_1 ) );
173  cbxWfsIgnoreAxisOrientation->setEnabled( index != WFS_VERSION_1_0 && index != WFS_VERSION_API_FEATURES_1_0 );
174  cbxWfsInvertAxisOrientation->setEnabled( index != WFS_VERSION_API_FEATURES_1_0 );
175  wfsUseGml2EncodingForTransactions()->setEnabled( index == WFS_VERSION_1_1 );
176 }
177 
178 void QgsNewHttpConnection::wfsFeaturePagingStateChanged( int state )
179 {
180  lblPageSize->setEnabled( state == Qt::Checked );
181  txtPageSize->setEnabled( state == Qt::Checked );
182 }
183 
185 {
186  return txtName->text();
187 }
188 
190 {
191  return txtUrl->text();
192 }
193 
194 void QgsNewHttpConnection::nameChanged( const QString &text )
195 {
196  Q_UNUSED( text )
197  buttonBox->button( QDialogButtonBox::Ok )->setDisabled( txtName->text().isEmpty() || txtUrl->text().isEmpty() );
198 }
199 
200 void QgsNewHttpConnection::urlChanged( const QString &text )
201 {
202  Q_UNUSED( text )
203  buttonBox->button( QDialogButtonBox::Ok )->setDisabled( txtName->text().isEmpty() || txtUrl->text().isEmpty() );
204  mWfsVersionDetectButton->setDisabled( txtUrl->text().isEmpty() );
205 }
206 
207 void QgsNewHttpConnection::updateOkButtonState()
208 {
209  bool enabled = !txtName->text().isEmpty() && !txtUrl->text().isEmpty();
210  buttonBox->button( QDialogButtonBox::Ok )->setEnabled( enabled );
211 }
212 
214 {
215  QgsSettings settings;
216  QString key = mBaseKey + txtName->text();
217 
218  // warn if entry was renamed to an existing connection
219  if ( ( mOriginalConnName.isNull() || mOriginalConnName.compare( txtName->text(), Qt::CaseInsensitive ) != 0 ) &&
220  settings.contains( key + "/url" ) &&
221  QMessageBox::question( this,
222  tr( "Save Connection" ),
223  tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ),
224  QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
225  {
226  return false;
227  }
228 
229  if ( ! mAuthSettings->password().isEmpty() &&
230  QMessageBox::question( this,
231  tr( "Saving Passwords" ),
232  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." ),
233  QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
234  {
235  return false;
236  }
237 
238  return true;
239 }
240 
242 {
243  return mTestConnectionButton;
244 }
245 
247 {
248  return mAuthSettings;
249 }
250 
252 {
253  return mWfsVersionDetectButton;
254 }
255 
257 {
258  return cmbVersion;
259 }
260 
262 {
263  return cbxWfsFeaturePaging;
264 }
265 
267 {
268  return cbxWfsUseGml2EncodingForTransactions;
269 }
270 
272 {
273  return txtPageSize;
274 }
275 
276 QString QgsNewHttpConnection::wfsSettingsKey( const QString &base, const QString &connectionName ) const
277 {
278  return base + connectionName;
279 }
280 
281 QString QgsNewHttpConnection::wmsSettingsKey( const QString &base, const QString &connectionName ) const
282 {
283  return base + connectionName;
284 }
285 
287 {
288  QgsSettings settings;
289  QString wfsKey = wfsSettingsKey( mBaseKey, mOriginalConnName );
290  QString wmsKey = wmsSettingsKey( mBaseKey, mOriginalConnName );
291 
292  cbxIgnoreGetMapURI->setChecked( settings.value( wmsKey + "/ignoreGetMapURI", false ).toBool() );
293  cbxWmsIgnoreReportedLayerExtents->setChecked( settings.value( wmsKey + QStringLiteral( "/ignoreReportedLayerExtents" ), false ).toBool() );
294  cbxWfsIgnoreAxisOrientation->setChecked( settings.value( wfsKey + "/ignoreAxisOrientation", false ).toBool() );
295  cbxWfsInvertAxisOrientation->setChecked( settings.value( wfsKey + "/invertAxisOrientation", false ).toBool() );
296  cbxWfsUseGml2EncodingForTransactions->setChecked( settings.value( wfsKey + "/preferCoordinatesForWfsT11", false ).toBool() );
297 
298  cbxWmsIgnoreAxisOrientation->setChecked( settings.value( wmsKey + "/ignoreAxisOrientation", false ).toBool() );
299  cbxWmsInvertAxisOrientation->setChecked( settings.value( wmsKey + "/invertAxisOrientation", false ).toBool() );
300  cbxIgnoreGetFeatureInfoURI->setChecked( settings.value( wmsKey + "/ignoreGetFeatureInfoURI", false ).toBool() );
301  cbxSmoothPixmapTransform->setChecked( settings.value( wmsKey + "/smoothPixmapTransform", false ).toBool() );
302 
303  int dpiIdx;
304  switch ( settings.value( wmsKey + "/dpiMode", 7 ).toInt() )
305  {
306  case 0: // off
307  dpiIdx = 1;
308  break;
309  case 1: // QGIS
310  dpiIdx = 2;
311  break;
312  case 2: // UMN
313  dpiIdx = 3;
314  break;
315  case 4: // GeoServer
316  dpiIdx = 4;
317  break;
318  default: // other => all
319  dpiIdx = 0;
320  break;
321  }
322  cmbDpiMode->setCurrentIndex( dpiIdx );
323 
324  QString version = settings.value( wfsKey + "/version" ).toString();
325  int versionIdx = WFS_VERSION_MAX; // AUTO
326  if ( version == QLatin1String( "1.0.0" ) )
327  versionIdx = WFS_VERSION_1_0;
328  else if ( version == QLatin1String( "1.1.0" ) )
329  versionIdx = WFS_VERSION_1_1;
330  else if ( version == QLatin1String( "2.0.0" ) )
331  versionIdx = WFS_VERSION_2_0;
332  else if ( version == QLatin1String( "OGC_API_FEATURES" ) )
333  versionIdx = WFS_VERSION_API_FEATURES_1_0;
334  cmbVersion->setCurrentIndex( versionIdx );
335 
336  // Enable/disable these items per WFS versions
337  wfsVersionCurrentIndexChanged( versionIdx );
338 
339  mRefererLineEdit->setText( settings.value( wmsKey + "/referer" ).toString() );
340  txtMaxNumFeatures->setText( settings.value( wfsKey + "/maxnumfeatures" ).toString() );
341 
342  // Only default to paging enabled if WFS 2.0.0 or higher
343  bool pagingEnabled = settings.value( wfsKey + "/pagingenabled", ( versionIdx == WFS_VERSION_MAX || versionIdx >= WFS_VERSION_2_0 ) ).toBool();
344  txtPageSize->setText( settings.value( wfsKey + "/pagesize" ).toString() );
345  cbxWfsFeaturePaging->setChecked( pagingEnabled );
346 }
347 
348 // Mega ewwww. all this is taken from Qt's QUrl::setEncodedPath compatibility helper.
349 // (I can't see any way to port the below code to NOT require this).
350 
351 inline char toHexUpper( uint value ) noexcept
352 {
353  return "0123456789ABCDEF"[value & 0xF];
354 }
355 
356 static inline ushort encodeNibble( ushort c )
357 {
358  return ushort( toHexUpper( c ) );
359 }
360 
361 bool qt_is_ascii( const char *&ptr, const char *end ) noexcept
362 {
363  while ( ptr + 4 <= end )
364  {
365  quint32 data = qFromUnaligned<quint32>( ptr );
366  if ( data &= 0x80808080U )
367  {
368 #if Q_BYTE_ORDER == Q_BIG_ENDIAN
369  uint idx = qCountLeadingZeroBits( data );
370 #else
371  uint idx = qCountTrailingZeroBits( data );
372 #endif
373  ptr += idx / 8;
374  return false;
375  }
376  ptr += 4;
377  }
378  while ( ptr != end )
379  {
380  if ( quint8( *ptr ) & 0x80 )
381  return false;
382  ++ptr;
383  }
384  return true;
385 }
386 
387 QString fromEncodedComponent_helper( const QByteArray &ba )
388 {
389  if ( ba.isNull() )
390  return QString();
391  // scan ba for anything above or equal to 0x80
392  // control points below 0x20 are fine in QString
393  const char *in = ba.constData();
394  const char *const end = ba.constEnd();
395  if ( qt_is_ascii( in, end ) )
396  {
397  // no non-ASCII found, we're safe to convert to QString
398  return QString::fromLatin1( ba, ba.size() );
399  }
400  // we found something that we need to encode
401  QByteArray intermediate = ba;
402  intermediate.resize( ba.size() * 3 - ( in - ba.constData() ) );
403  uchar *out = reinterpret_cast<uchar *>( intermediate.data() + ( in - ba.constData() ) );
404  for ( ; in < end; ++in )
405  {
406  if ( *in & 0x80 )
407  {
408  // encode
409  *out++ = '%';
410  *out++ = encodeNibble( uchar( *in ) >> 4 );
411  *out++ = encodeNibble( uchar( *in ) & 0xf );
412  }
413  else
414  {
415  // keep
416  *out++ = uchar( *in );
417  }
418  }
419  // now it's safe to call fromLatin1
420  return QString::fromLatin1( intermediate, out - reinterpret_cast<uchar *>( intermediate.data() ) );
421 }
422 
423 
425 {
426  QUrl url( txtUrl->text().trimmed() );
427  QUrlQuery query( url );
428  const QList<QPair<QString, QString> > items = query.queryItems( QUrl::FullyEncoded );
429  QHash< QString, QPair<QString, QString> > params;
430  for ( const QPair<QString, QString> &it : items )
431  {
432  params.insert( it.first.toUpper(), it );
433  }
434 
435  if ( params[QStringLiteral( "SERVICE" )].second.toUpper() == "WMS" ||
436  params[QStringLiteral( "SERVICE" )].second.toUpper() == "WFS" ||
437  params[QStringLiteral( "SERVICE" )].second.toUpper() == "WCS" )
438  {
439  query.removeQueryItem( params.value( QStringLiteral( "SERVICE" ) ).first );
440  query.removeQueryItem( params.value( QStringLiteral( "REQUEST" ) ).first );
441  query.removeQueryItem( params.value( QStringLiteral( "FORMAT" ) ).first );
442  }
443 
444  url.setQuery( query );
445 
446  if ( url.path( QUrl::FullyEncoded ).isEmpty() )
447  {
448  url.setPath( fromEncodedComponent_helper( "/" ) );
449  }
450  return url;
451 }
452 
454 {
455  QgsSettings settings;
456  QString key = mBaseKey + txtName->text();
457  QString credentialsKey = "qgis/" + mCredentialsBaseKey + '/' + txtName->text();
458 
459  if ( !validate() )
460  return;
461 
462  // on rename delete original entry first
463  if ( !mOriginalConnName.isNull() && mOriginalConnName != key )
464  {
465  settings.remove( mBaseKey + mOriginalConnName );
466  settings.remove( "qgis/" + mCredentialsBaseKey + '/' + mOriginalConnName );
467  settings.sync();
468  }
469 
470  QUrl url( urlTrimmed() );
471  settings.setValue( key + "/url", url.toString() );
472 
473  QString wfsKey = wfsSettingsKey( mBaseKey, txtName->text() );
474  QString wmsKey = wmsSettingsKey( mBaseKey, txtName->text() );
475 
476  if ( mTypes & ConnectionWfs )
477  {
478  settings.setValue( wfsKey + "/ignoreAxisOrientation", cbxWfsIgnoreAxisOrientation->isChecked() );
479  settings.setValue( wfsKey + "/invertAxisOrientation", cbxWfsInvertAxisOrientation->isChecked() );
480  settings.setValue( wfsKey + "/preferCoordinatesForWfsT11", cbxWfsUseGml2EncodingForTransactions->isChecked() );
481  }
482  if ( mTypes & ConnectionWms || mTypes & ConnectionWcs )
483  {
484  settings.setValue( wmsKey + "/ignoreAxisOrientation", cbxWmsIgnoreAxisOrientation->isChecked() );
485  settings.setValue( wmsKey + "/invertAxisOrientation", cbxWmsInvertAxisOrientation->isChecked() );
486 
487  settings.setValue( wmsKey + QStringLiteral( "/ignoreReportedLayerExtents" ), cbxWmsIgnoreReportedLayerExtents->isChecked() );
488  settings.setValue( wmsKey + "/ignoreGetMapURI", cbxIgnoreGetMapURI->isChecked() );
489  settings.setValue( wmsKey + "/smoothPixmapTransform", cbxSmoothPixmapTransform->isChecked() );
490 
491  int dpiMode = 0;
492  switch ( cmbDpiMode->currentIndex() )
493  {
494  case 0: // all => QGIS|UMN|GeoServer
495  dpiMode = 7;
496  break;
497  case 1: // off
498  dpiMode = 0;
499  break;
500  case 2: // QGIS
501  dpiMode = 1;
502  break;
503  case 3: // UMN
504  dpiMode = 2;
505  break;
506  case 4: // GeoServer
507  dpiMode = 4;
508  break;
509  }
510 
511  settings.setValue( wmsKey + "/dpiMode", dpiMode );
512 
513  settings.setValue( wmsKey + "/referer", mRefererLineEdit->text() );
514  }
515  if ( mTypes & ConnectionWms )
516  {
517  settings.setValue( wmsKey + "/ignoreGetFeatureInfoURI", cbxIgnoreGetFeatureInfoURI->isChecked() );
518  }
519  if ( mTypes & ConnectionWfs )
520  {
521  QString version = QStringLiteral( "auto" );
522  switch ( cmbVersion->currentIndex() )
523  {
524  case WFS_VERSION_MAX:
525  version = QStringLiteral( "auto" );
526  break;
527  case WFS_VERSION_1_0:
528  version = QStringLiteral( "1.0.0" );
529  break;
530  case WFS_VERSION_1_1:
531  version = QStringLiteral( "1.1.0" );
532  break;
533  case WFS_VERSION_2_0:
534  version = QStringLiteral( "2.0.0" );
535  break;
537  version = QStringLiteral( "OGC_API_FEATURES" );
538  break;
539  }
540  settings.setValue( wfsKey + "/version", version );
541 
542  settings.setValue( wfsKey + "/maxnumfeatures", txtMaxNumFeatures->text() );
543 
544  settings.setValue( wfsKey + "/pagesize", txtPageSize->text() );
545  settings.setValue( wfsKey + "/pagingenabled", cbxWfsFeaturePaging->isChecked() );
546  }
547 
548  settings.setValue( credentialsKey + "/username", mAuthSettings->username() );
549  settings.setValue( credentialsKey + "/password", mAuthSettings->password() );
550 
551  settings.setValue( credentialsKey + "/authcfg", mAuthSettings->configId() );
552 
553  if ( mHttpGroupBox->isVisible() )
554  settings.setValue( key + "/referer", mRefererLineEdit->text() );
555 
556  settings.setValue( mBaseKey + "/selected", txtName->text() );
557 
558  QDialog::accept();
559 }
560 
561 void QgsNewHttpConnection::showHelp()
562 {
563  QgsHelp::openHelp( QStringLiteral( "working_with_ogc/index.html" ) );
564 }
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.
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