QGIS API Documentation  3.13.0-Master (788156190c)
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  txtReferer->setVisible( false );
134  mGroupBox->layout()->removeWidget( txtReferer );
135  lblReferer->setVisible( false );
136  mGroupBox->layout()->removeWidget( lblReferer );
137  }
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 }
176 
177 void QgsNewHttpConnection::wfsFeaturePagingStateChanged( int state )
178 {
179  lblPageSize->setEnabled( state == Qt::Checked );
180  txtPageSize->setEnabled( state == Qt::Checked );
181 }
182 
184 {
185  return txtName->text();
186 }
187 
189 {
190  return txtUrl->text();
191 }
192 
193 void QgsNewHttpConnection::nameChanged( const QString &text )
194 {
195  Q_UNUSED( text )
196  buttonBox->button( QDialogButtonBox::Ok )->setDisabled( txtName->text().isEmpty() || txtUrl->text().isEmpty() );
197 }
198 
199 void QgsNewHttpConnection::urlChanged( const QString &text )
200 {
201  Q_UNUSED( text )
202  buttonBox->button( QDialogButtonBox::Ok )->setDisabled( txtName->text().isEmpty() || txtUrl->text().isEmpty() );
203  mWfsVersionDetectButton->setDisabled( txtUrl->text().isEmpty() );
204 }
205 
206 void QgsNewHttpConnection::updateOkButtonState()
207 {
208  bool enabled = !txtName->text().isEmpty() && !txtUrl->text().isEmpty();
209  buttonBox->button( QDialogButtonBox::Ok )->setEnabled( enabled );
210 }
211 
213 {
214  QgsSettings settings;
215  QString key = mBaseKey + txtName->text();
216 
217  // warn if entry was renamed to an existing connection
218  if ( ( mOriginalConnName.isNull() || mOriginalConnName.compare( txtName->text(), Qt::CaseInsensitive ) != 0 ) &&
219  settings.contains( key + "/url" ) &&
220  QMessageBox::question( this,
221  tr( "Save Connection" ),
222  tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ),
223  QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
224  {
225  return false;
226  }
227 
228  if ( ! mAuthSettings->password().isEmpty() &&
229  QMessageBox::question( this,
230  tr( "Saving Passwords" ),
231  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." ),
232  QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
233  {
234  return false;
235  }
236 
237  return true;
238 }
239 
241 {
242  return mTestConnectionButton;
243 }
244 
246 {
247  return mAuthSettings;
248 }
249 
251 {
252  return mWfsVersionDetectButton;
253 }
254 
256 {
257  return cmbVersion;
258 }
259 
261 {
262  return cbxWfsFeaturePaging;
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  cbxWmsIgnoreAxisOrientation->setChecked( settings.value( wmsKey + "/ignoreAxisOrientation", false ).toBool() );
291  cbxWmsInvertAxisOrientation->setChecked( settings.value( wmsKey + "/invertAxisOrientation", false ).toBool() );
292  cbxIgnoreGetFeatureInfoURI->setChecked( settings.value( wmsKey + "/ignoreGetFeatureInfoURI", false ).toBool() );
293  cbxSmoothPixmapTransform->setChecked( settings.value( wmsKey + "/smoothPixmapTransform", false ).toBool() );
294 
295  int dpiIdx;
296  switch ( settings.value( wmsKey + "/dpiMode", 7 ).toInt() )
297  {
298  case 0: // off
299  dpiIdx = 1;
300  break;
301  case 1: // QGIS
302  dpiIdx = 2;
303  break;
304  case 2: // UMN
305  dpiIdx = 3;
306  break;
307  case 4: // GeoServer
308  dpiIdx = 4;
309  break;
310  default: // other => all
311  dpiIdx = 0;
312  break;
313  }
314  cmbDpiMode->setCurrentIndex( dpiIdx );
315 
316  QString version = settings.value( wfsKey + "/version" ).toString();
317  int versionIdx = WFS_VERSION_MAX; // AUTO
318  if ( version == QLatin1String( "1.0.0" ) )
319  versionIdx = WFS_VERSION_1_0;
320  else if ( version == QLatin1String( "1.1.0" ) )
321  versionIdx = WFS_VERSION_1_1;
322  else if ( version == QLatin1String( "2.0.0" ) )
323  versionIdx = WFS_VERSION_2_0;
324  else if ( version == QLatin1String( "OGC_API_FEATURES" ) )
325  versionIdx = WFS_VERSION_API_FEATURES_1_0;
326  cmbVersion->setCurrentIndex( versionIdx );
327 
328  // Enable/disable these items per WFS versions
329  wfsVersionCurrentIndexChanged( versionIdx );
330 
331  txtReferer->setText( settings.value( wmsKey + "/referer" ).toString() );
332  txtMaxNumFeatures->setText( settings.value( wfsKey + "/maxnumfeatures" ).toString() );
333 
334  // Only default to paging enabled if WFS 2.0.0 or higher
335  bool pagingEnabled = settings.value( wfsKey + "/pagingenabled", ( versionIdx == WFS_VERSION_MAX || versionIdx >= WFS_VERSION_2_0 ) ).toBool();
336  txtPageSize->setText( settings.value( wfsKey + "/pagesize" ).toString() );
337  cbxWfsFeaturePaging->setChecked( pagingEnabled );
338 }
339 
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  }
475  if ( mTypes & ConnectionWms || mTypes & ConnectionWcs )
476  {
477  settings.setValue( wmsKey + "/ignoreAxisOrientation", cbxWmsIgnoreAxisOrientation->isChecked() );
478  settings.setValue( wmsKey + "/invertAxisOrientation", cbxWmsInvertAxisOrientation->isChecked() );
479 
480  settings.setValue( wmsKey + QStringLiteral( "/ignoreReportedLayerExtents" ), cbxWmsIgnoreReportedLayerExtents->isChecked() );
481  settings.setValue( wmsKey + "/ignoreGetMapURI", cbxIgnoreGetMapURI->isChecked() );
482  settings.setValue( wmsKey + "/smoothPixmapTransform", cbxSmoothPixmapTransform->isChecked() );
483 
484  int dpiMode = 0;
485  switch ( cmbDpiMode->currentIndex() )
486  {
487  case 0: // all => QGIS|UMN|GeoServer
488  dpiMode = 7;
489  break;
490  case 1: // off
491  dpiMode = 0;
492  break;
493  case 2: // QGIS
494  dpiMode = 1;
495  break;
496  case 3: // UMN
497  dpiMode = 2;
498  break;
499  case 4: // GeoServer
500  dpiMode = 4;
501  break;
502  }
503 
504  settings.setValue( wmsKey + "/dpiMode", dpiMode );
505 
506  settings.setValue( wmsKey + "/referer", txtReferer->text() );
507  }
508  if ( mTypes & ConnectionWms )
509  {
510  settings.setValue( wmsKey + "/ignoreGetFeatureInfoURI", cbxIgnoreGetFeatureInfoURI->isChecked() );
511  }
512  if ( mTypes & ConnectionWfs )
513  {
514  QString version = QStringLiteral( "auto" );
515  switch ( cmbVersion->currentIndex() )
516  {
517  case WFS_VERSION_MAX:
518  version = QStringLiteral( "auto" );
519  break;
520  case WFS_VERSION_1_0:
521  version = QStringLiteral( "1.0.0" );
522  break;
523  case WFS_VERSION_1_1:
524  version = QStringLiteral( "1.1.0" );
525  break;
526  case WFS_VERSION_2_0:
527  version = QStringLiteral( "2.0.0" );
528  break;
530  version = QStringLiteral( "OGC_API_FEATURES" );
531  break;
532  }
533  settings.setValue( wfsKey + "/version", version );
534 
535  settings.setValue( wfsKey + "/maxnumfeatures", txtMaxNumFeatures->text() );
536 
537  settings.setValue( wfsKey + "/pagesize", txtPageSize->text() );
538  settings.setValue( wfsKey + "/pagingenabled", cbxWfsFeaturePaging->isChecked() );
539  }
540 
541  settings.setValue( credentialsKey + "/username", mAuthSettings->username() );
542  settings.setValue( credentialsKey + "/password", mAuthSettings->password() );
543 
544  settings.setValue( credentialsKey + "/authcfg", mAuthSettings->configId() );
545 
546  if ( mHttpGroupBox->isVisible() )
547  settings.setValue( key + "/referer", mRefererLineEdit->text() );
548 
549  settings.setValue( mBaseKey + "/selected", txtName->text() );
550 
551  QDialog::accept();
552 }
553 
554 void QgsNewHttpConnection::showHelp()
555 {
556  QgsHelp::openHelp( QStringLiteral( "working_with_ogc/index.html" ) );
557 }
QgsNewHttpConnection::QgsNewHttpConnection
QgsNewHttpConnection(QWidget *parent=nullptr, QgsNewHttpConnection::ConnectionTypes types=ConnectionWms, const QString &baseKey="qgis/connections-wms/", const QString &connectionName=QString(), QgsNewHttpConnection::Flags flags=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)
Constructor for QgsNewHttpConnection.
Definition: qgsnewhttpconnection.cpp:29
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:212
qgsgui.h
QgsNewHttpConnection::ConnectionWfs
@ ConnectionWfs
WFS connection.
Definition: qgsnewhttpconnection.h:45
fromEncodedComponent_helper
QString fromEncodedComponent_helper(const QByteArray &ba)
Definition: qgsnewhttpconnection.cpp:381
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:250
QgsNewHttpConnection::url
QString url() const
Returns the current connection url.
Definition: qgsnewhttpconnection.cpp:188
QgsNewHttpConnection::accept
void accept() override
Definition: qgsnewhttpconnection.cpp:447
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::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:255
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:275
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:280
QgsNewHttpConnection::wfsPageSizeLineEdit
QLineEdit * wfsPageSizeLineEdit()
Returns the "WFS page size" edit.
Definition: qgsnewhttpconnection.cpp:265
QgsNewHttpConnection::urlTrimmed
QUrl urlTrimmed() const
Returns the url.
Definition: qgsnewhttpconnection.cpp:418
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:245
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:183
qt_is_ascii
bool qt_is_ascii(const char *&ptr, const char *end) noexcept
Definition: qgsnewhttpconnection.cpp:355
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:240
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:270
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:345
qgshelp.h
QgsNewHttpConnection::wfsPagingEnabledCheckBox
QCheckBox * wfsPagingEnabledCheckBox()
Returns the "WFS paging enabled" checkbox.
Definition: qgsnewhttpconnection.cpp:260
QgsNewHttpConnection::FlagShowHttpSettings
@ FlagShowHttpSettings
Display the 'http' group.
Definition: qgsnewhttpconnection.h:60