QmakeProjectManager: Replace QSharedPointer with std::shared_ptr

According to https://wiki.qt.io/Things_To_Look_Out_For_In_Reviews
QSharedPointer impl is poor and it's going to be removed from Qt 7.

Change-Id: Ia94370bef54b4c73984ab2d5caa3565c6dea54e3
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2024-02-01 16:47:37 +01:00
parent f8e14c9fce
commit 9e966706dd
4 changed files with 6 additions and 10 deletions

View File

@@ -102,9 +102,9 @@ void CustomWidgetPluginWizardPage::setCollectionEnabled(bool enColl)
m_collectionSourceEdit->setEnabled(enColl); m_collectionSourceEdit->setEnabled(enColl);
} }
QSharedPointer<PluginOptions> CustomWidgetPluginWizardPage::basicPluginOptions() const std::shared_ptr<PluginOptions> CustomWidgetPluginWizardPage::basicPluginOptions() const
{ {
QSharedPointer<PluginOptions> po(new PluginOptions); std::shared_ptr<PluginOptions> po(new PluginOptions);
po->pluginName = pluginName(); po->pluginName = pluginName();
po->resourceFile = m_resourceFileEdit->text(); po->resourceFile = m_resourceFileEdit->text();
po->collectionClassName = collectionClassName(); po->collectionClassName = collectionClassName();

View File

@@ -6,7 +6,6 @@
#include "filenamingparameters.h" #include "filenamingparameters.h"
#include <QWizardPage> #include <QWizardPage>
#include <QSharedPointer>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QLineEdit; class QLineEdit;
@@ -34,7 +33,7 @@ public:
void setFileNamingParameters(const FileNamingParameters &fnp) {m_fileNamingParameters = fnp; } void setFileNamingParameters(const FileNamingParameters &fnp) {m_fileNamingParameters = fnp; }
// Fills the plugin fields, excluding widget list. // Fills the plugin fields, excluding widget list.
QSharedPointer<PluginOptions> basicPluginOptions() const; std::shared_ptr<PluginOptions> basicPluginOptions() const;
private: private:
void slotCheckCompleteness(); void slotCheckCompleteness();

View File

@@ -57,9 +57,9 @@ void CustomWidgetWizardDialog::slotCurrentIdChanged(int id)
m_pluginPage->init(m_widgetsPage); m_pluginPage->init(m_widgetsPage);
} }
QSharedPointer<PluginOptions> CustomWidgetWizardDialog::pluginOptions() const std::shared_ptr<PluginOptions> CustomWidgetWizardDialog::pluginOptions() const
{ {
QSharedPointer<PluginOptions> rc = m_pluginPage->basicPluginOptions(); std::shared_ptr<PluginOptions> rc = m_pluginPage->basicPluginOptions();
rc->widgetOptions = m_widgetsPage->widgetOptions(); rc->widgetOptions = m_widgetsPage->widgetOptions();
return rc; return rc;
} }

View File

@@ -5,8 +5,6 @@
#include "../wizards/qtwizard.h" #include "../wizards/qtwizard.h"
#include <QSharedPointer>
namespace QmakeProjectManager { namespace QmakeProjectManager {
namespace Internal { namespace Internal {
@@ -24,8 +22,7 @@ public:
QWidget *parent, QWidget *parent,
const Core::WizardDialogParameters &parameters); const Core::WizardDialogParameters &parameters);
QSharedPointer<PluginOptions> pluginOptions() const; std::shared_ptr<PluginOptions> pluginOptions() const;
FileNamingParameters fileNamingParameters() const; FileNamingParameters fileNamingParameters() const;
void setFileNamingParameters(const FileNamingParameters &fnp); void setFileNamingParameters(const FileNamingParameters &fnp);