QmakeProjectManager: Modernize

modernize-*

Change-Id: Ib1d4527e223704f81f9470201735e8c2ebb2d89c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Alessandro Portale
2018-11-24 01:08:18 +01:00
parent a83330ca26
commit 813d08b338
8 changed files with 20 additions and 22 deletions

View File

@@ -39,7 +39,7 @@ class ClassDefinition : public QTabWidget
Q_OBJECT
public:
explicit ClassDefinition(QWidget *parent = 0);
explicit ClassDefinition(QWidget *parent = nullptr);
void setClassName(const QString &name);
FileNamingParameters fileNamingParameters() const { return m_fileNamingParameters; }

View File

@@ -43,12 +43,12 @@ class CustomWidgetPluginWizardPage : public QWizardPage
Q_OBJECT
public:
explicit CustomWidgetPluginWizardPage(QWidget *parent = 0);
virtual ~CustomWidgetPluginWizardPage();
explicit CustomWidgetPluginWizardPage(QWidget *parent = nullptr);
~CustomWidgetPluginWizardPage() override;
void init(const CustomWidgetWidgetsWizardPage *widgetsPage);
virtual bool isComplete() const;
bool isComplete() const override;
FileNamingParameters fileNamingParameters() const { return m_fileNamingParameters; }
void setFileNamingParameters(const FileNamingParameters &fnp) {m_fileNamingParameters = fnp; }

View File

@@ -48,12 +48,12 @@ class CustomWidgetWidgetsWizardPage : public QWizardPage
Q_OBJECT
public:
explicit CustomWidgetWidgetsWizardPage(QWidget *parent = 0);
virtual ~CustomWidgetWidgetsWizardPage();
explicit CustomWidgetWidgetsWizardPage(QWidget *parent = nullptr);
~CustomWidgetWidgetsWizardPage() override;
QList<PluginOptions::WidgetOptions> widgetOptions() const;
virtual bool isComplete() const;
bool isComplete() const override;
FileNamingParameters fileNamingParameters() const { return m_fileNamingParameters; }
void setFileNamingParameters(const FileNamingParameters &fnp) {m_fileNamingParameters = fnp; }
@@ -61,7 +61,7 @@ public:
int classCount() const { return m_uiClassDefs.size(); }
QString classNameAt(int i) const;
virtual void initializePage();
void initializePage() override;
private Q_SLOTS:
void on_classList_classAdded(const QString &name);

View File

@@ -38,9 +38,10 @@ public:
CustomWidgetWizard();
protected:
Core::BaseFileWizard *create(QWidget *parent, const Core::WizardDialogParameters &parameters) const;
Core::BaseFileWizard *create(QWidget *parent,
const Core::WizardDialogParameters &parameters) const override;
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const override;
};
} // namespace Internal

View File

@@ -103,12 +103,12 @@ QmakeStaticData::QmakeStaticData()
const unsigned count = sizeof(fileTypeDataStorage)/sizeof(FileTypeDataStorage);
fileTypeData.reserve(count);
for (unsigned i = 0 ; i < count; ++i) {
const QString desc = QCoreApplication::translate("QmakeProjectManager::QmakePriFile", fileTypeDataStorage[i].typeName);
const QString filter = QString::fromUtf8(fileTypeDataStorage[i].addFileFilter);
fileTypeData.push_back(QmakeStaticData::FileTypeData(fileTypeDataStorage[i].type,
for (const FileTypeDataStorage &fileType : fileTypeDataStorage) {
const QString desc = QCoreApplication::translate("QmakeProjectManager::QmakePriFile", fileType.typeName);
const QString filter = QString::fromUtf8(fileType.addFileFilter);
fileTypeData.push_back(QmakeStaticData::FileTypeData(fileType.type,
desc, filter,
Core::FileIconProvider::directoryIcon(QLatin1String(fileTypeDataStorage[i].icon))));
Core::FileIconProvider::directoryIcon(QLatin1String(fileType.icon))));
}
// Project icon
projectIcon = Core::FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_QT);

View File

@@ -58,9 +58,8 @@ static const char *baseClassesC[] = {"QMainWindow", "QWidget", "QDialog"};
static inline QStringList baseClasses()
{
QStringList rc;
const int baseClassCount = sizeof(baseClassesC)/sizeof(const char *);
for (int i = 0; i < baseClassCount; i++)
rc.push_back(QLatin1String(baseClassesC[i]));
for (auto baseClass : baseClassesC)
rc.push_back(QLatin1String(baseClass));
return rc;
}

View File

@@ -284,8 +284,8 @@ void LibraryWizardDialog::setupFilesPage()
QStringList baseClasses;
const int pluginBaseClassCount = sizeof(pluginBaseClasses)/sizeof(PluginBaseClasses);
Q_ASSERT(defaultPluginBaseClass < pluginBaseClassCount);
for (int i = 0; i < pluginBaseClassCount; i++)
baseClasses.push_back(QLatin1String(pluginBaseClasses[i].name));
for (const PluginBaseClasses &pluginBaseClasse : pluginBaseClasses)
baseClasses.push_back(QLatin1String(pluginBaseClasse.name));
m_filesPage->setBaseClassChoices(baseClasses);
m_filesPage->setBaseClassName(baseClasses.at(defaultPluginBaseClass));
m_pluginBaseClassesInitialized = true;

View File

@@ -36,8 +36,6 @@
#include <QLayout>
#include <QWidget>
#include <math.h>
using namespace QmakeProjectManager::Internal;
ModulesPage::ModulesPage(QWidget *parent)