forked from qt-creator/qt-creator
Utils: Use dialogParent() more directly in wizards
Change-Id: Icfb8e7bdba1ba44fb64cc80ef9a2c20e59df755c Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "wizard.h"
|
||||
|
||||
#include "algorithm.h"
|
||||
#include "guiutils.h"
|
||||
#include "hostosinfo.h"
|
||||
#include "icon.h"
|
||||
#include "qtcassert.h"
|
||||
@@ -281,8 +282,8 @@ public:
|
||||
bool m_skipForSubproject = false;
|
||||
};
|
||||
|
||||
Wizard::Wizard(QWidget *parent, Qt::WindowFlags flags) :
|
||||
QWizard(parent, flags), d_ptr(new WizardPrivate)
|
||||
Wizard::Wizard(Qt::WindowFlags flags)
|
||||
: QWizard(dialogParent(), flags), d_ptr(new WizardPrivate)
|
||||
{
|
||||
d_ptr->m_wizardProgress = new WizardProgress(this);
|
||||
connect(this, &QWizard::currentIdChanged, this, &Wizard::_q_currentPageChanged);
|
||||
|
@@ -21,7 +21,7 @@ class QTCREATOR_UTILS_EXPORT Wizard : public QWizard
|
||||
Q_PROPERTY(bool automaticProgressCreationEnabled READ isAutomaticProgressCreationEnabled WRITE setAutomaticProgressCreationEnabled)
|
||||
|
||||
public:
|
||||
explicit Wizard(QWidget *parent = nullptr, Qt::WindowFlags flags = {});
|
||||
explicit Wizard(Qt::WindowFlags flags = {});
|
||||
~Wizard() override;
|
||||
|
||||
bool isAutomaticProgressCreationEnabled() const;
|
||||
|
@@ -8,7 +8,6 @@
|
||||
#include "androidutils.h"
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <projectexplorer/buildsystem.h>
|
||||
#include <projectexplorer/project.h>
|
||||
@@ -231,8 +230,7 @@ void ChooseDirectoryPage::initializePage()
|
||||
}
|
||||
|
||||
CreateAndroidManifestWizard::CreateAndroidManifestWizard(BuildSystem *buildSystem)
|
||||
: Wizard(Core::ICore::dialogParent())
|
||||
, m_buildSystem(buildSystem)
|
||||
: m_buildSystem(buildSystem)
|
||||
{
|
||||
setWindowTitle(Tr::tr("Create Android Template Files Wizard"));
|
||||
|
||||
|
@@ -13,9 +13,8 @@ namespace BareMetal::Internal {
|
||||
|
||||
enum PageId { SetupPageId };
|
||||
|
||||
BareMetalDeviceConfigurationWizard::BareMetalDeviceConfigurationWizard(QWidget *parent) :
|
||||
Utils::Wizard(parent),
|
||||
m_setupPage(new BareMetalDeviceConfigurationWizardSetupPage(this))
|
||||
BareMetalDeviceConfigurationWizard::BareMetalDeviceConfigurationWizard()
|
||||
: m_setupPage(new BareMetalDeviceConfigurationWizardSetupPage(this))
|
||||
{
|
||||
setWindowTitle(Tr::tr("New Bare Metal Device Configuration Setup"));
|
||||
setPage(SetupPageId, m_setupPage);
|
||||
|
@@ -13,7 +13,7 @@ class BareMetalDeviceConfigurationWizardSetupPage;
|
||||
class BareMetalDeviceConfigurationWizard final : public Utils::Wizard
|
||||
{
|
||||
public:
|
||||
explicit BareMetalDeviceConfigurationWizard(QWidget *parent = nullptr);
|
||||
BareMetalDeviceConfigurationWizard();
|
||||
|
||||
ProjectExplorer::IDevicePtr device() const;
|
||||
|
||||
|
@@ -25,12 +25,8 @@ IFileWizardExtension::~IFileWizardExtension()
|
||||
g_fileWizardExtensions.removeOne(this);
|
||||
}
|
||||
|
||||
BaseFileWizard::BaseFileWizard(const BaseFileWizardFactory *factory,
|
||||
const QVariantMap &extraValues,
|
||||
QWidget *parent) :
|
||||
Wizard(parent),
|
||||
m_extraValues(extraValues),
|
||||
m_factory(factory)
|
||||
BaseFileWizard::BaseFileWizard(const BaseFileWizardFactory *factory, const QVariantMap &extraValues)
|
||||
: m_extraValues(extraValues), m_factory(factory)
|
||||
{
|
||||
for (IFileWizardExtension *extension : std::as_const(g_fileWizardExtensions))
|
||||
m_extensionPages += extension->extensionPages(factory);
|
||||
|
@@ -20,8 +20,7 @@ class CORE_EXPORT BaseFileWizard : public Utils::Wizard
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BaseFileWizard(const BaseFileWizardFactory *factory, const QVariantMap &extraValues,
|
||||
QWidget *parent = nullptr);
|
||||
explicit BaseFileWizard(const BaseFileWizardFactory *factory, const QVariantMap &extraValues);
|
||||
|
||||
void initializePage(int id) override;
|
||||
|
||||
|
@@ -502,7 +502,7 @@ static bool copyPluginFile(const FilePath &src, const FilePath &dest)
|
||||
|
||||
bool executePluginInstallWizard(const FilePath &archive)
|
||||
{
|
||||
Wizard wizard(ICore::dialogParent());
|
||||
Wizard wizard;
|
||||
wizard.setWindowTitle(Tr::tr("Install Plugin"));
|
||||
|
||||
Data data;
|
||||
|
@@ -15,17 +15,14 @@
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace Designer::Internal {
|
||||
|
||||
enum { FormPageId, ClassPageId };
|
||||
|
||||
namespace Designer {
|
||||
namespace Internal {
|
||||
|
||||
// ----------------- FormClassWizardDialog
|
||||
FormClassWizardDialog::FormClassWizardDialog(const Core::BaseFileWizardFactory *factory,
|
||||
QWidget *parent) :
|
||||
Core::BaseFileWizard(factory, QVariantMap(), parent),
|
||||
m_formPage(new FormTemplateWizardPage),
|
||||
m_classPage(new FormClassWizardPage)
|
||||
FormClassWizardDialog::FormClassWizardDialog(const Core::BaseFileWizardFactory *factory)
|
||||
: Core::BaseFileWizard(factory, QVariantMap())
|
||||
, m_formPage(new FormTemplateWizardPage)
|
||||
, m_classPage(new FormClassWizardPage)
|
||||
{
|
||||
setWindowTitle(Tr::tr("Qt Widgets Designer Form Class"));
|
||||
|
||||
@@ -74,5 +71,4 @@ FormClassWizardParameters FormClassWizardDialog::parameters() const
|
||||
return rc;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Designer
|
||||
} // namespace Designer::Internal
|
||||
|
@@ -21,7 +21,7 @@ class FormClassWizardDialog : public Core::BaseFileWizard
|
||||
public:
|
||||
typedef QList<QWizardPage *> WizardPageList;
|
||||
|
||||
explicit FormClassWizardDialog(const Core::BaseFileWizardFactory *factory, QWidget *parent = nullptr);
|
||||
explicit FormClassWizardDialog(const Core::BaseFileWizardFactory *factory);
|
||||
|
||||
Utils::FilePath filePath() const;
|
||||
void setFilePath(const Utils::FilePath &);
|
||||
|
@@ -7,7 +7,6 @@
|
||||
#include "genericprojectmanagertr.h"
|
||||
|
||||
#include <coreplugin/basefilewizard.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/iwizardfactory.h>
|
||||
|
||||
#include <projectexplorer/customwizard/customwizard.h>
|
||||
@@ -99,7 +98,7 @@ class GenericProjectWizard final : public BaseFileWizard
|
||||
|
||||
public:
|
||||
GenericProjectWizard(const BaseFileWizardFactory *factory)
|
||||
: BaseFileWizard(factory, QVariantMap(), Core::ICore::dialogParent())
|
||||
: BaseFileWizard(factory, QVariantMap())
|
||||
{
|
||||
setWindowTitle(Tr::tr("Import Existing Project"));
|
||||
|
||||
|
@@ -129,7 +129,6 @@ private:
|
||||
} // namespace Internal
|
||||
|
||||
JsonWizard::JsonWizard()
|
||||
: Wizard(Core::ICore::dialogParent())
|
||||
{
|
||||
setMinimumSize(800, 500);
|
||||
m_expander.registerExtraResolver([this](const QString &name, QString *ret) -> bool {
|
||||
|
@@ -64,9 +64,8 @@ static FancyLineEdit::AsyncValidationResult validateLibraryPath(const QString &i
|
||||
return make_unexpected(::QmakeProjectManager::Tr::tr("File does not match filter."));
|
||||
}
|
||||
|
||||
AddLibraryWizard::AddLibraryWizard(const FilePath &proFile, QWidget *parent)
|
||||
: Wizard(parent)
|
||||
, m_proFile(proFile)
|
||||
AddLibraryWizard::AddLibraryWizard(const FilePath &proFile)
|
||||
: m_proFile(proFile)
|
||||
{
|
||||
setWindowTitle(Tr::tr("Add Library"));
|
||||
m_libraryTypePage = new LibraryTypePage(this);
|
||||
|
@@ -90,7 +90,7 @@ public:
|
||||
|
||||
Q_DECLARE_FLAGS(Platforms, Platform)
|
||||
|
||||
explicit AddLibraryWizard(const Utils::FilePath &proFile, QWidget *parent = nullptr);
|
||||
explicit AddLibraryWizard(const Utils::FilePath &proFile);
|
||||
~AddLibraryWizard() override;
|
||||
|
||||
LibraryKind libraryKind() const;
|
||||
|
@@ -15,7 +15,6 @@
|
||||
#include "qmakestep.h"
|
||||
#include "wizards/subdirsprojectwizard.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||
@@ -348,7 +347,7 @@ void QmakeProjectManagerPluginPrivate::addLibraryImpl(const FilePath &filePath,
|
||||
if (filePath.isEmpty())
|
||||
return;
|
||||
|
||||
Internal::AddLibraryWizard wizard(filePath, Core::ICore::dialogParent());
|
||||
Internal::AddLibraryWizard wizard(filePath);
|
||||
if (wizard.exec() != QDialog::Accepted)
|
||||
return;
|
||||
|
||||
|
@@ -7,8 +7,6 @@
|
||||
#include "remotelinuxtr.h"
|
||||
#include "sshkeycreationdialog.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <projectexplorer/devicesupport/idevice.h>
|
||||
#include <projectexplorer/devicesupport/sshparameters.h>
|
||||
|
||||
@@ -194,7 +192,6 @@ public:
|
||||
};
|
||||
|
||||
SshDeviceWizard::SshDeviceWizard(const QString &title, const DeviceRef &device)
|
||||
: Wizard(Core::ICore::dialogParent())
|
||||
{
|
||||
setWindowTitle(title);
|
||||
|
||||
|
Reference in New Issue
Block a user