EnvironmentWidget: Devirtualize aspect() method

The RemoteLinuxEnvironmentAspectWidget subclass was
overloading it, however, it was returning the
subclass of EnvironmentAspect (i.e. returning
RemoteLinuxEnvironmentAspect).

Instead, we use the base aspect() method in
RemoteLinuxEnvironmentAspectWidget subclass and we
cast it into expected RemoteLinuxEnvironmentAspect class.

Move some methods into protected section, as they
are used only in subclass.

Use qobject_cast instead of dynamic_cast inside
UploadAndInstallTarPackageStep.

Change-Id: Ic3119ca15d46187e0aa7b8b4013e7fc4efec4bd9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Jarek Kobus
2022-05-27 10:42:33 +02:00
parent ffe1ff2368
commit cb2894a51f
5 changed files with 8 additions and 18 deletions

View File

@@ -92,11 +92,6 @@ EnvironmentAspectWidget::EnvironmentAspectWidget(EnvironmentAspect *aspect, QWid
this, &EnvironmentAspectWidget::environmentChanged);
}
EnvironmentAspect *EnvironmentAspectWidget::aspect() const
{
return m_aspect;
}
QWidget *EnvironmentAspectWidget::additionalWidget() const
{
return m_additionalWidget;