QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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 }
170 
171 void QgsNewHttpConnection::wfsFeaturePagingStateChanged( int state )
172 {
173  lblPageSize->setEnabled( state == Qt::Checked );
174  txtPageSize->setEnabled( state == Qt::Checked );
175 }
176 
178 {
179  return txtName->text();
180 }
181 
183 {
184  return txtUrl->text();
185 }
186 
187 void QgsNewHttpConnection::nameChanged( const QString &text )
188 {
189  Q_UNUSED( text )
190  buttonBox->button( QDialogButtonBox::Ok )->setDisabled( txtName->text().isEmpty() || txtUrl->text().isEmpty() );
191 }
192 
193 void QgsNewHttpConnection::urlChanged( const QString &text )
194 {
195  Q_UNUSED( text )
196  buttonBox->button( QDialogButtonBox::Ok )->setDisabled( txtName->text().isEmpty() || txtUrl->text().isEmpty() );
197  mWfsVersionDetectButton->setDisabled( txtUrl->text().isEmpty() );
198 }
199 
200 void QgsNewHttpConnection::updateOkButtonState()
201 {
202  bool enabled = !txtName->text().isEmpty() && !txtUrl->text().isEmpty();
203  buttonBox->button( QDialogButtonBox::Ok )->setEnabled( enabled );
204 }
205 
207 {
208  QgsSettings settings;
209  QString key = mBaseKey + txtName->text();
210 
211  // warn if entry was renamed to an existing connection
212  if ( ( mOriginalConnName.isNull() || mOriginalConnName.compare( txtName->text(), Qt::CaseInsensitive ) != 0 ) &&
213  settings.contains( key + "/url" ) &&
214  QMessageBox::question( this,
215  tr( "Save Connection" ),
216  tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ),
217  QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
218  {
219  return false;
220  }
221 
222  if ( ! mAuthSettings->password().isEmpty() &&
223  QMessageBox::question( this,
224  tr( "Saving Passwords" ),
225  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." ),
226  QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
227  {
228  return false;
229  }
230 
231  return true;
232 }
233 
235 {
236  return mTestConnectionButton;
237 }
238 
240 {
241  return mAuthSettings;
242 }
243 
245 {
246  return mWfsVersionDetectButton;
247 }
248 
250 {
251  return cmbVersion;
252 }
253 
255 {
256  return cbxWfsFeaturePaging;
257 }
258 
260 {
261  return txtPageSize;
262 }
263 
264 QString QgsNewHttpConnection::wfsSettingsKey( const QString &base, const QString &connectionName ) const
265 {
266  return base + connectionName;
267 }
268 
269 QString QgsNewHttpConnection::wmsSettingsKey( const QString &base, const QString &connectionName ) const
270 {
271  return base + connectionName;
272 }
273 
275 {
276  QgsSettings settings;
277  QString wfsKey = wfsSettingsKey( mBaseKey, mOriginalConnName );
278  QString wmsKey = wmsSettingsKey( mBaseKey, mOriginalConnName );
279 
280  cbxIgnoreGetMapURI->setChecked( settings.value( wmsKey + "/ignoreGetMapURI", false ).toBool() );
281  cbxWmsIgnoreReportedLayerExtents->setChecked( settings.value( wmsKey + QStringLiteral( "/ignoreReportedLayerExtents" ), false ).toBool() );
282  cbxWfsIgnoreAxisOrientation->setChecked( settings.value( wfsKey + "/ignoreAxisOrientation", false ).toBool() );
283  cbxWfsInvertAxisOrientation->setChecked( settings.value( wfsKey + "/invertAxisOrientation", false ).toBool() );
284  cbxWmsIgnoreAxisOrientation->setChecked( settings.value( wmsKey + "/ignoreAxisOrientation", false ).toBool() );
285  cbxWmsInvertAxisOrientation->setChecked( settings.value( wmsKey + "/invertAxisOrientation", false ).toBool() );
286  cbxIgnoreGetFeatureInfoURI->setChecked( settings.value( wmsKey + "/ignoreGetFeatureInfoURI", false ).toBool() );
287  cbxSmoothPixmapTransform->setChecked( settings.value( wmsKey + "/smoothPixmapTransform", false ).toBool() );
288 
289  int dpiIdx;
290  switch ( settings.value( wmsKey + "/dpiMode", 7 ).toInt() )
291  {
292  case 0: // off
293  dpiIdx = 1;
294  break;
295  case 1: // QGIS
296  dpiIdx = 2;
297  break;
298  case 2: // UMN
299  dpiIdx = 3;
300  break;
301  case 4: // GeoServer
302  dpiIdx = 4;
303  break;
304  default: // other => all
305  dpiIdx = 0;
306  break;
307  }
308  cmbDpiMode->setCurrentIndex( dpiIdx );
309 
310  QString version = settings.value( wfsKey + "/version" ).toString();
311  int versionIdx = WFS_VERSION_MAX; // AUTO
312  if ( version == QLatin1String( "1.0.0" ) )
313  versionIdx = WFS_VERSION_1_0;
314  else if ( version == QLatin1String( "1.1.0" ) )
315  versionIdx = WFS_VERSION_1_1;
316  else if ( version == QLatin1String( "2.0.0" ) )
317  versionIdx = WFS_VERSION_2_0;
318  else if ( version == QLatin1String( "OGC_API_FEATURES" ) )
319  versionIdx = WFS_VERSION_API_FEATURES_1_0;
320  cmbVersion->setCurrentIndex( versionIdx );
321 
322  // Enable/disable these items per WFS versions
323  wfsVersionCurrentIndexChanged( versionIdx );
324 
325  mRefererLineEdit->setText( settings.value( wmsKey + "/referer" ).toString() );
326  txtMaxNumFeatures->setText( settings.value( wfsKey + "/maxnumfeatures" ).toString() );
327 
328  // Only default to paging enabled if WFS 2.0.0 or higher
329  bool pagingEnabled = settings.value( wfsKey + "/pagingenabled", ( versionIdx == WFS_VERSION_MAX || versionIdx >= WFS_VERSION_2_0 ) ).toBool();
330  txtPageSize->setText( settings.value( wfsKey + "/pagesize" ).toString() );
331  cbxWfsFeaturePaging->setChecked( pagingEnabled );
332 }
333 
334 // Mega ewwww. all this is taken from Qt's QUrl::setEncodedPath compatibility helper.
335 // (I can't see any way to port the below code to NOT require this).
336 
337 inline char toHexUpper( uint value ) noexcept
338 {
339  return "0123456789ABCDEF"[value & 0xF];
340 }
341 
342 static inline ushort encodeNibble( ushort c )
343 {
344  return ushort( toHexUpper( c ) );
345 }
346 
347 bool qt_is_ascii( const char *&ptr, const char *end ) noexcept
348 {
349  while ( ptr + 4 <= end )
350  {
351  quint32 data = qFromUnaligned<quint32>( ptr );
352  if ( data &= 0x80808080U )
353  {
354 #if Q_BYTE_ORDER == Q_BIG_ENDIAN
355  uint idx = qCountLeadingZeroBits( data );
356 #else
357  uint idx = qCountTrailingZeroBits( data );
358 #endif
359  ptr += idx / 8;
360  return false;
361  }
362  ptr += 4;
363  }
364  while ( ptr != end )
365  {
366  if ( quint8( *ptr ) & 0x80 )
367  return false;
368  ++ptr;
369  }
370  return true;
371 }
372 
373 QString fromEncodedComponent_helper( const QByteArray &ba )
374 {
375  if ( ba.isNull() )
376  return QString();
377  // scan ba for anything above or equal to 0x80
378  // control points below 0x20 are fine in QString
379  const char *in = ba.constData();
380  const char *const end = ba.constEnd();
381  if ( qt_is_ascii( in, end ) )
382  {
383  // no non-ASCII found, we're safe to convert to QString
384  return QString::fromLatin1( ba, ba.size() );
385  }
386  // we found something that we need to encode
387  QByteArray intermediate = ba;
388  intermediate.resize( ba.size() * 3 - ( in - ba.constData() ) );
389  uchar *out = reinterpret_cast<uchar *>( intermediate.data() + ( in - ba.constData() ) );
390  for ( ; in < end; ++in )
391  {
392  if ( *in & 0x80 )
393  {
394  // encode
395  *out++ = '%';
396  *out++ = encodeNibble( uchar( *in ) >> 4 );
397  *out++ = encodeNibble( uchar( *in ) & 0xf );
398  }
399  else
400  {
401  // keep
402  *out++ = uchar( *in );
403  }
404  }
405  // now it's safe to call fromLatin1
406  return QString::fromLatin1( intermediate, out - reinterpret_cast<uchar *>( intermediate.data() ) );
407 }
408 
409 
411 {
412  QUrl url( txtUrl->text().trimmed() );
413  QUrlQuery query( url );
414  const QList<QPair<QString, QString> > items = query.queryItems( QUrl::FullyEncoded );
415  QHash< QString, QPair<QString, QString> > params;
416  for ( const QPair<QString, QString> &it : items )
417  {
418  params.insert( it.first.toUpper(), it );
419  }
420 
421  if ( params[QStringLiteral( "SERVICE" )].second.toUpper() == "WMS" ||
422  params[QStringLiteral( "SERVICE" )].second.toUpper() == "WFS" ||
423  params[QStringLiteral( "SERVICE" )].second.toUpper() == "WCS" )
424  {
425  query.removeQueryItem( params.value( QStringLiteral( "SERVICE" ) ).first );
426  query.removeQueryItem( params.value( QStringLiteral( "REQUEST" ) ).first );
427  query.removeQueryItem( params.value( QStringLiteral( "FORMAT" ) ).first );
428  }
429 
430  url.setQuery( query );
431 
432  if ( url.path( QUrl::FullyEncoded ).isEmpty() )
433  {
434  url.setPath( fromEncodedComponent_helper( "/" ) );
435  }
436  return url;
437 }
438 
440 {
441  QgsSettings settings;
442  QString key = mBaseKey + txtName->text();
443  QString credentialsKey = "qgis/" + mCredentialsBaseKey + '/' + txtName->text();
444 
445  if ( !validate() )
446  return;
447 
448  // on rename delete original entry first
449  if ( !mOriginalConnName.isNull() && mOriginalConnName != key )
450  {
451  settings.remove( mBaseKey + mOriginalConnName );
452  settings.remove( "qgis/" + mCredentialsBaseKey + '/' + mOriginalConnName );
453  settings.sync();
454  }
455 
456  QUrl url( urlTrimmed() );
457  settings.setValue( key + "/url", url.toString() );
458 
459  QString wfsKey = wfsSettingsKey( mBaseKey, txtName->text() );
460  QString wmsKey = wmsSettingsKey( mBaseKey, txtName->text() );
461 
462  if ( mTypes & ConnectionWfs )
463  {
464  settings.setValue( wfsKey + "/ignoreAxisOrientation", cbxWfsIgnoreAxisOrientation->isChecked() );
465  settings.setValue( wfsKey + "/invertAxisOrientation", cbxWfsInvertAxisOrientation->isChecked() );
466  }
467  if ( mTypes & ConnectionWms || mTypes & ConnectionWcs )
468  {
469  settings.setValue( wmsKey + "/ignoreAxisOrientation", cbxWmsIgnoreAxisOrientation->isChecked() );
470  settings.setValue( wmsKey + "/invertAxisOrientation", cbxWmsInvertAxisOrientation->isChecked() );
471 
472  settings.setValue( wmsKey + QStringLiteral( "/ignoreReportedLayerExtents" ), cbxWmsIgnoreReportedLayerExtents->isChecked() );
473  settings.setValue( wmsKey + "/ignoreGetMapURI", cbxIgnoreGetMapURI->isChecked() );
474  settings.setValue( wmsKey + "/smoothPixmapTransform", cbxSmoothPixmapTransform->isChecked() );
475 
476  int dpiMode = 0;
477  switch ( cmbDpiMode->currentIndex() )
478  {
479  case 0: // all => QGIS|UMN|GeoServer
480  dpiMode = 7;
481  break;
482  case 1: // off
483  dpiMode = 0;
484  break;
485  case 2: // QGIS
486  dpiMode = 1;
487  break;
488  case 3: // UMN
489  dpiMode = 2;
490  break;
491  case 4: // GeoServer
492  dpiMode = 4;
493  break;
494  }
495 
496  settings.setValue( wmsKey + "/dpiMode", dpiMode );
497 
498  settings.setValue( wmsKey + "/referer", mRefererLineEdit->text() );
499  }
500  if ( mTypes & ConnectionWms )
501  {
502  settings.setValue( wmsKey + "/ignoreGetFeatureInfoURI", cbxIgnoreGetFeatureInfoURI->isChecked() );
503  }
504  if ( mTypes & ConnectionWfs )
505  {
506  QString version = QStringLiteral( "auto" );
507  switch ( cmbVersion->currentIndex() )
508  {
509  case WFS_VERSION_MAX:
510  version = QStringLiteral( "auto" );
511  break;
512  case WFS_VERSION_1_0:
513  version = QStringLiteral( "1.0.0" );
514  break;
515  case WFS_VERSION_1_1:
516  version = QStringLiteral( "1.1.0" );
517  break;
518  case WFS_VERSION_2_0:
519  version = QStringLiteral( "2.0.0" );
520  break;
522  version = QStringLiteral( "OGC_API_FEATURES" );
523  break;
524  }
525  settings.setValue( wfsKey + "/version", version );
526 
527  settings.setValue( wfsKey + "/maxnumfeatures", txtMaxNumFeatures->text() );
528 
529  settings.setValue( wfsKey + "/pagesize", txtPageSize->text() );
530  settings.setValue( wfsKey + "/pagingenabled", cbxWfsFeaturePaging->isChecked() );
531  }
532 
533  settings.setValue( credentialsKey + "/username", mAuthSettings->username() );
534  settings.setValue( credentialsKey + "/password", mAuthSettings->password() );
535 
536  settings.setValue( credentialsKey + "/authcfg", mAuthSettings->configId() );
537 
538  if ( mHttpGroupBox->isVisible() )
539  settings.setValue( key + "/referer", mRefererLineEdit->text() );
540 
541  settings.setValue( mBaseKey + "/selected", txtName->text() );
542 
543  QDialog::accept();
544 }
545 
546 void QgsNewHttpConnection::showHelp()
547 {
548  QgsHelp::openHelp( QStringLiteral( "working_with_ogc/index.html" ) );
549 }
QgsSettings::remove
void remove(const QString &key, QgsSettings::Section section=QgsSettings::NoSection)
Removes the setting key and any sub-settings of key in a section.
Definition: qgssettings.cpp:205
qgsauthsettingswidget.h
QgsSettings::value
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
Definition: qgssettings.cpp:174
QgsNewHttpConnection::FlagShowTestConnection
@ FlagShowTestConnection
Display the 'test connection' button.
Definition: qgsnewhttpconnection.h:58
QgsNewHttpConnection::validate
virtual bool validate()
Returns true if dialog settings are valid, or false if current settings are not valid and the dialog ...
Definition: qgsnewhttpconnection.cpp:206
qgsgui.h
QgsNewHttpConnection::ConnectionWfs
@ ConnectionWfs
WFS connection.
Definition: qgsnewhttpconnection.h:45
fromEncodedComponent_helper
QString fromEncodedComponent_helper(const QByteArray &ba)
Definition: qgsnewhttpconnection.cpp:373
QgsAuthSettingsWidget
Definition: qgsauthsettingswidget.h:36
QgsSettings
Definition: qgssettings.h:61
QgsNewHttpConnection::WFS_VERSION_API_FEATURES_1_0
@ WFS_VERSION_API_FEATURES_1_0
Definition: qgsnewhttpconnection.h:113
QgsNewHttpConnection::wfsVersionDetectButton
QPushButton * wfsVersionDetectButton()
Returns the "WFS version detect" button.
Definition: qgsnewhttpconnection.cpp:244
QgsNewHttpConnection::url
QString url() const
Returns the current connection url.
Definition: qgsnewhttpconnection.cpp:182
QgsNewHttpConnection::accept
void accept() override
Definition: qgsnewhttpconnection.cpp:439
QgsNewHttpConnection::WFS_VERSION_MAX
@ WFS_VERSION_MAX
Definition: qgsnewhttpconnection.h:109
QgsNewHttpConnection::FlagHideAuthenticationGroup
@ FlagHideAuthenticationGroup
Hide the Authentication group.
Definition: qgsnewhttpconnection.h:59
QgsGui::enableAutoGeometryRestore
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:133
QgsNewHttpConnection::QgsNewHttpConnection
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.
Definition: qgsnewhttpconnection.cpp:29
QgsNewHttpConnection::ConnectionWcs
@ ConnectionWcs
WCS connection.
Definition: qgsnewhttpconnection.h:47
QgsSettings::sync
void sync()
Writes any unsaved changes to permanent storage, and reloads any settings that have been changed in t...
Definition: qgssettings.cpp:200
QgsNewHttpConnection::WFS_VERSION_2_0
@ WFS_VERSION_2_0
Definition: qgsnewhttpconnection.h:112
QgsNewHttpConnection::wfsVersionComboBox
QComboBox * wfsVersionComboBox()
Returns the "WFS version" combobox.
Definition: qgsnewhttpconnection.cpp:249
QgsNewHttpConnection::WFS_VERSION_1_1
@ WFS_VERSION_1_1
Definition: qgsnewhttpconnection.h:111
QgsNewHttpConnection::wmsSettingsKey
virtual QString wmsSettingsKey(const QString &base, const QString &connectionName) const
Returns the QSettings key for WMS related settings for the connection.
Definition: qgsnewhttpconnection.cpp:269
QgsNewHttpConnection::ConnectionWms
@ ConnectionWms
WMS connection.
Definition: qgsnewhttpconnection.h:46
QgsNewHttpConnection::updateServiceSpecificSettings
void updateServiceSpecificSettings()
Triggers a resync of the GUI widgets for the service specific settings (i.e.
Definition: qgsnewhttpconnection.cpp:274
QgsNewHttpConnection::wfsPageSizeLineEdit
QLineEdit * wfsPageSizeLineEdit()
Returns the "WFS page size" edit.
Definition: qgsnewhttpconnection.cpp:259
QgsNewHttpConnection::urlTrimmed
QUrl urlTrimmed() const
Returns the url.
Definition: qgsnewhttpconnection.cpp:410
QgsSettings::setValue
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
Definition: qgssettings.cpp:289
QgsNewHttpConnection::authSettingsWidget
QgsAuthSettingsWidget * authSettingsWidget()
Returns the current authentication settings widget.
Definition: qgsnewhttpconnection.cpp:239
qgsnewhttpconnection.h
QgsNewHttpConnection::WFS_VERSION_1_0
@ WFS_VERSION_1_0
Definition: qgsnewhttpconnection.h:110
QgsNewHttpConnection::name
QString name() const
Returns the current connection name.
Definition: qgsnewhttpconnection.cpp:177
qt_is_ascii
bool qt_is_ascii(const char *&ptr, const char *end) noexcept
Definition: qgsnewhttpconnection.cpp:347
c
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
Definition: porting_processing.dox:1
QgsHelp::openHelp
static void openHelp(const QString &key)
Opens help topic for the given help key using default system web browser.
Definition: qgshelp.cpp:36
QgsNewHttpConnection::testConnectButton
QPushButton * testConnectButton()
Returns the "test connection" button.
Definition: qgsnewhttpconnection.cpp:234
qgssettings.h
QgsNewHttpConnection::wfsSettingsKey
virtual QString wfsSettingsKey(const QString &base, const QString &connectionName) const
Returns the QSettings key for WFS related settings for the connection.
Definition: qgsnewhttpconnection.cpp:264
QgsSettings::contains
bool contains(const QString &key, QgsSettings::Section section=QgsSettings::NoSection) const
Returns true if there exists a setting called key; returns false otherwise.
Definition: qgssettings.cpp:188
toHexUpper
char toHexUpper(uint value) noexcept
Definition: qgsnewhttpconnection.cpp:337
qgshelp.h
QgsNewHttpConnection::wfsPagingEnabledCheckBox
QCheckBox * wfsPagingEnabledCheckBox()
Returns the "WFS paging enabled" checkbox.
Definition: qgsnewhttpconnection.cpp:254
QgsNewHttpConnection::FlagShowHttpSettings
@ FlagShowHttpSettings
Display the 'http' group.
Definition: qgsnewhttpconnection.h:60