Merge pull request #61912 from elpaso/bugfix-gh61867-new-http-conn-dlg-too-tall

[ux] New HTTP conn dlg: adjust height
This commit is contained in:
Alexander Bruy 2025-05-20 10:55:12 +01:00 committed by GitHub
commit 5e0fc5539f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 25 additions and 6 deletions

View File

@ -29,6 +29,6 @@ QgsNewHttpConnection.Flag.__and__ = lambda flag1, flag2: _force_int(flag1) & _fo
QgsNewHttpConnection.Flag.__or__ = lambda flag1, flag2: QgsNewHttpConnection.Flag(_force_int(flag1) | _force_int(flag2))
try:
QgsNewHttpConnection.__virtual_methods__ = ['validate', 'wfsSettingsKey', 'wmsSettingsKey']
QgsNewHttpConnection.__overridden_methods__ = ['accept']
QgsNewHttpConnection.__overridden_methods__ = ['accept', 'showEvent']
except (NameError, AttributeError):
pass

View File

@ -123,6 +123,12 @@ Returns the QSettings key for WMS related settings for the connection.
%Docstring
Triggers a resync of the GUI widgets for the service specific settings
(i.e. WFS and WMS related settings).
%End
virtual void showEvent( QShowEvent *event );
%Docstring
Adjust height of dialog to fit the content.
%End
};

View File

@ -1,6 +1,6 @@
# The following has been generated automatically from src/gui/qgsnewhttpconnection.h
try:
QgsNewHttpConnection.__virtual_methods__ = ['validate', 'wfsSettingsKey', 'wmsSettingsKey']
QgsNewHttpConnection.__overridden_methods__ = ['accept']
QgsNewHttpConnection.__overridden_methods__ = ['accept', 'showEvent']
except (NameError, AttributeError):
pass

View File

@ -123,6 +123,12 @@ Returns the QSettings key for WMS related settings for the connection.
%Docstring
Triggers a resync of the GUI widgets for the service specific settings
(i.e. WFS and WMS related settings).
%End
virtual void showEvent( QShowEvent *event );
%Docstring
Adjust height of dialog to fit the content.
%End
};

View File

@ -178,10 +178,6 @@ QgsNewHttpConnection::QgsNewHttpConnection( QWidget *parent, ConnectionTypes typ
mAuthGroupBox->hide();
mGroupBox->layout()->removeWidget( mAuthGroupBox );
}
// Adjust height
const int w = width();
adjustSize();
resize( w, height() );
connect( txtName, &QLineEdit::textChanged, this, &QgsNewHttpConnection::nameChanged );
connect( txtUrl, &QLineEdit::textChanged, this, &QgsNewHttpConnection::urlChanged );
@ -368,6 +364,12 @@ void QgsNewHttpConnection::updateServiceSpecificSettings()
txtPageSize->setText( QgsOwsConnection::settingsPagesize->value( detailsParameters ) );
}
void QgsNewHttpConnection::showEvent(QShowEvent* event)
{
QDialog::showEvent( event );
adjustSize();
}
QUrl QgsNewHttpConnection::urlTrimmed() const
{
QUrl url( txtUrl->text().trimmed() );

View File

@ -200,6 +200,11 @@ class GUI_EXPORT QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpCo
*/
void updateServiceSpecificSettings();
/**
* Adjust height of dialog to fit the content.
*/
void showEvent( QShowEvent *event ) override;
private:
ConnectionTypes mTypes = ConnectionWms;