diff --git a/src/plugins/projectexplorer/environmentaspectwidget.cpp b/src/plugins/projectexplorer/environmentaspectwidget.cpp index 280cc5ac9da..bb84a49f6a6 100644 --- a/src/plugins/projectexplorer/environmentaspectwidget.cpp +++ b/src/plugins/projectexplorer/environmentaspectwidget.cpp @@ -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; diff --git a/src/plugins/projectexplorer/environmentaspectwidget.h b/src/plugins/projectexplorer/environmentaspectwidget.h index 44acee2f616..bb51a14bee8 100644 --- a/src/plugins/projectexplorer/environmentaspectwidget.h +++ b/src/plugins/projectexplorer/environmentaspectwidget.h @@ -52,9 +52,9 @@ class PROJECTEXPLORER_EXPORT EnvironmentAspectWidget : public QWidget public: explicit EnvironmentAspectWidget(EnvironmentAspect *aspect, QWidget *additionalWidget = nullptr); - virtual EnvironmentAspect *aspect() const; +protected: + EnvironmentAspect *aspect() const { return m_aspect; } EnvironmentWidget *envWidget() const { return m_environmentWidget; } - QWidget *additionalWidget() const; private: diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.cpp b/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.cpp index 0aab43c44ab..309509ec149 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.cpp +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.cpp @@ -52,8 +52,8 @@ const QString FetchEnvButtonText namespace RemoteLinux { RemoteLinuxEnvironmentAspectWidget::RemoteLinuxEnvironmentAspectWidget - (RemoteLinuxEnvironmentAspect *aspect, Target *target) : - EnvironmentAspectWidget(aspect, new QPushButton) + (RemoteLinuxEnvironmentAspect *aspect, Target *target) + : EnvironmentAspectWidget(aspect, new QPushButton) { IDevice::ConstPtr device = DeviceKitAspect::device(target->kit()); @@ -85,11 +85,6 @@ RemoteLinuxEnvironmentAspectWidget::RemoteLinuxEnvironmentAspectWidget envWidget()->setOpenTerminalFunc(openTerminalFunc); } -RemoteLinuxEnvironmentAspect *RemoteLinuxEnvironmentAspectWidget::aspect() const -{ - return dynamic_cast(EnvironmentAspectWidget::aspect()); -} - QPushButton *RemoteLinuxEnvironmentAspectWidget::fetchButton() const { return qobject_cast(additionalWidget()); @@ -114,7 +109,8 @@ void RemoteLinuxEnvironmentAspectWidget::fetchEnvironmentFinished() connect(button, &QPushButton::clicked, this, &RemoteLinuxEnvironmentAspectWidget::fetchEnvironment); button->setText(FetchEnvButtonText); - aspect()->setRemoteEnvironment(deviceEnvReader->remoteEnvironment()); + qobject_cast(aspect())->setRemoteEnvironment( + deviceEnvReader->remoteEnvironment()); } void RemoteLinuxEnvironmentAspectWidget::fetchEnvironmentError(const QString &error) diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.h b/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.h index ae254fda62b..cc03d7e75c0 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.h +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.h @@ -43,10 +43,9 @@ public: RemoteLinuxEnvironmentAspectWidget(RemoteLinuxEnvironmentAspect *aspect, ProjectExplorer::Target *target); - RemoteLinuxEnvironmentAspect *aspect() const override; +private: QPushButton *fetchButton() const; -private: void fetchEnvironment(); void fetchEnvironmentFinished(); void fetchEnvironmentError(const QString &error); diff --git a/src/plugins/remotelinux/uploadandinstalltarpackagestep.cpp b/src/plugins/remotelinux/uploadandinstalltarpackagestep.cpp index a1bcfe58a6e..c320fc68cd1 100644 --- a/src/plugins/remotelinux/uploadandinstalltarpackagestep.cpp +++ b/src/plugins/remotelinux/uploadandinstalltarpackagestep.cpp @@ -185,7 +185,7 @@ UploadAndInstallTarPackageStep::UploadAndInstallTarPackageStep(BuildStepList *bs for (BuildStep *step : deployConfiguration()->stepList()->steps()) { if (step == this) break; - if ((pStep = dynamic_cast(step))) + if ((pStep = qobject_cast(step))) break; } if (!pStep)