Utils: Modernize further

Many issues, mostly in headers, were not addressed in
e38410b76c

modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default

Change-Id: I320a51726db881e582b898948d53735ebb06887a
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2018-07-23 10:45:40 +02:00
parent 00c926b6b4
commit f6943a712a
53 changed files with 117 additions and 173 deletions

View File

@@ -229,7 +229,7 @@ protected:
Container *container;
public:
typedef Container container_type;
using container_type = Container;
explicit SetInsertIterator (Container &x)
: container(&x) {}
SetInsertIterator<Container> &operator=(const typename Container::value_type &value)
@@ -253,7 +253,7 @@ template <class Container>
Container *container;
public:
typedef Container container_type;
using container_type = Container;
explicit MapInsertIterator (Container &x)
: container(&x) {}
MapInsertIterator<Container> &operator=(const std::pair<const typename Container::key_type, typename Container::mapped_type> &value)

View File

@@ -33,8 +33,8 @@ namespace Utils {
class QTCREATOR_UTILS_EXPORT FormattedText {
public:
FormattedText() { }
FormattedText(const FormattedText &other) : text(other.text), format(other.format) { }
FormattedText() = default;
FormattedText(const FormattedText &other) = default;
FormattedText(const QString &txt, const QTextCharFormat &fmt = QTextCharFormat()) :
text(txt), format(fmt)
{ }

View File

@@ -45,7 +45,7 @@ signals:
#ifdef Q_OS_WIN
protected:
virtual bool winEvent(MSG *message, long *result);
virtual bool event(QEvent *event);
bool event(QEvent *event) override;
#endif
private:

View File

@@ -110,7 +110,7 @@ template <class T> T *checkEventType(QEvent *ev)
class QTCREATOR_UTILS_EXPORT ItemViewEvent
{
public:
ItemViewEvent() {}
ItemViewEvent() = default;
ItemViewEvent(QEvent *ev, QAbstractItemView *view);
template <class T> T *as() const {

View File

@@ -49,26 +49,25 @@ public:
Copy
};
EditOp(): type(Unset), pos1(0), pos2(0), length1(0), length2(0) {}
EditOp(Type t): type(t), pos1(0), pos2(0), length1(0), length2(0) {}
EditOp() = default;
EditOp(Type t): type(t) {}
Type type;
int pos1;
int pos2;
int length1;
int length2;
Type type = Unset;
int pos1 = 0;
int pos2 = 0;
int length1 = 0;
int length2 = 0;
QString text;
};
struct Range {
Range()
: start(0), end(0) {}
Range() = default;
Range(int start, int end)
: start(start), end(end) {}
int start;
int end;
int start = 0;
int end = 0;
};
public:

View File

@@ -48,32 +48,32 @@ struct ConsoleProcessPrivate {
ConsoleProcessPrivate();
static QString m_defaultConsoleProcess;
ConsoleProcess::Mode m_mode;
ConsoleProcess::Mode m_mode = ConsoleProcess::Run;
QString m_workingDir;
Environment m_environment;
qint64 m_appPid;
qint64 m_appPid = 0;
int m_appCode;
QString m_executable;
QProcess::ExitStatus m_appStatus;
QLocalServer m_stubServer;
QLocalSocket *m_stubSocket;
QTemporaryFile *m_tempFile;
QProcess::ProcessError m_error;
QLocalSocket *m_stubSocket = nullptr;
QTemporaryFile *m_tempFile = nullptr;
QProcess::ProcessError m_error = QProcess::UnknownError;
QString m_errorString;
#ifdef Q_OS_UNIX
QProcess m_process;
QByteArray m_stubServerDir;
QSettings *m_settings;
bool m_stubConnected;
qint64 m_stubPid;
QTimer *m_stubConnectTimer;
QSettings *m_settings = nullptr;
bool m_stubConnected = false;
qint64 m_stubPid = 0;
QTimer *m_stubConnectTimer = nullptr;
#else
qint64 m_appMainThreadId;
PROCESS_INFORMATION *m_pid;
HANDLE m_hInferior;
QWinEventNotifier *inferiorFinishedNotifier;
QWinEventNotifier *processFinishedNotifier;
qint64 m_appMainThreadId = 0;
PROCESS_INFORMATION *m_pid = nullptr;
HANDLE m_hInferior = NULL;
QWinEventNotifier *inferiorFinishedNotifier = nullptr;
QWinEventNotifier *processFinishedNotifier = nullptr;
#endif
};

View File

@@ -43,18 +43,7 @@
namespace Utils {
ConsoleProcessPrivate::ConsoleProcessPrivate() :
m_mode(ConsoleProcess::Run),
m_appPid(0),
m_stubSocket(0),
m_tempFile(0),
m_error(QProcess::UnknownError),
m_settings(0),
m_stubConnected(false),
m_stubPid(0),
m_stubConnectTimer(0)
{
}
ConsoleProcessPrivate::ConsoleProcessPrivate() = default;
ConsoleProcess::ConsoleProcess(QObject *parent) :
QObject(parent), d(new ConsoleProcessPrivate)

View File

@@ -36,19 +36,7 @@
namespace Utils {
ConsoleProcessPrivate::ConsoleProcessPrivate() :
m_mode(ConsoleProcess::Run),
m_appPid(0),
m_stubSocket(nullptr),
m_tempFile(nullptr),
m_error(QProcess::UnknownError),
m_appMainThreadId(0),
m_pid(nullptr),
m_hInferior(NULL),
inferiorFinishedNotifier(nullptr),
processFinishedNotifier(nullptr)
{
}
ConsoleProcessPrivate::ConsoleProcessPrivate() = default;
ConsoleProcess::ConsoleProcess(QObject *parent) :
QObject(parent), d(new ConsoleProcessPrivate)

View File

@@ -114,7 +114,6 @@ QSize AnnotatedItemDelegate::sizeHint(const QStyleOptionViewItem &option,
PathChooserDelegate::PathChooserDelegate(QObject *parent)
: QStyledItemDelegate(parent)
, m_kind(Utils::PathChooser::ExistingDirectory)
{
}
@@ -133,7 +132,7 @@ QWidget *PathChooserDelegate::createEditor(QWidget *parent, const QStyleOptionVi
Q_UNUSED(option);
Q_UNUSED(index);
Utils::PathChooser *editor = new Utils::PathChooser(parent);
auto editor = new Utils::PathChooser(parent);
editor->setHistoryCompleter(m_historyKey);
editor->setAutoFillBackground(true); // To hide the text beneath the editor widget
@@ -157,7 +156,7 @@ void PathChooserDelegate::setEditorData(QWidget *editor, const QModelIndex &inde
void PathChooserDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
{
Utils::PathChooser *pathChooser = qobject_cast<Utils::PathChooser *>(editor);
auto pathChooser = qobject_cast<Utils::PathChooser *>(editor);
if (!pathChooser)
return;

View File

@@ -76,7 +76,7 @@ public:
void setHistoryCompleter(const QString &key);
private:
PathChooser::Kind m_kind;
PathChooser::Kind m_kind = PathChooser::ExistingDirectory;
QString m_filter;
QString m_historyKey;
};

View File

@@ -51,7 +51,7 @@ public:
int column;
};
// returns true if the event should be accepted
typedef std::function<bool(QDropEvent*,DropSupport*)> DropFilterFunction;
using DropFilterFunction = std::function<bool(QDropEvent*, DropSupport*)>;
DropSupport(QWidget *parentWidget, const DropFilterFunction &filterFunction = DropFilterFunction());

View File

@@ -137,7 +137,7 @@ public:
class QTCREATOR_UTILS_EXPORT ElfData
{
public:
ElfData() : symbolsType(UnknownSymbols) {}
ElfData() = default;
int indexOf(const QByteArray &name) const;
public:
@@ -148,7 +148,7 @@ public:
quint64 entryPoint;
QByteArray debugLink;
QByteArray buildId;
DebugSymbolsType symbolsType;
DebugSymbolsType symbolsType = UnknownSymbols;
QVector<ElfSectionHeader> sectionHeaders;
QVector<ElfProgramHeader> programHeaders;
};

View File

@@ -82,7 +82,7 @@ QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug debug, const EnvironmentItem &i)
class QTCREATOR_UTILS_EXPORT Environment
{
public:
typedef QMap<QString, QString>::const_iterator const_iterator;
using const_iterator = QMap<QString, QString>::const_iterator;
explicit Environment(OsType osType = HostOsInfo::hostOs()) : m_osType(osType) {}
explicit Environment(const QStringList &env, OsType osType = HostOsInfo::hostOs());

View File

@@ -121,7 +121,7 @@ public:
// Validation
// line edit, (out)errorMessage -> valid?
typedef std::function<bool(FancyLineEdit *, QString *)> ValidationFunction;
using ValidationFunction = std::function<bool(FancyLineEdit *, QString *)>;
enum State { Invalid, DisplayingPlaceholderText, Valid };
State state() const;

View File

@@ -65,26 +65,26 @@ public:
class Item
{
public:
Item() : encoding(nullptr) { }
Item() = default;
Item(const QString &path, QTextCodec *codec)
: filePath(path), encoding(codec)
{}
QString filePath;
QTextCodec *encoding;
QTextCodec *encoding = nullptr;
};
typedef Item value_type;
using value_type = Item;
class const_iterator
{
public:
typedef std::forward_iterator_tag iterator_category;
typedef Item value_type;
typedef std::ptrdiff_t difference_type;
typedef const value_type *pointer;
typedef const value_type &reference;
using iterator_category = std::forward_iterator_tag;
using value_type = Item;
using difference_type = std::ptrdiff_t;
using pointer = const value_type*;
using reference = const value_type&;
const_iterator() : m_parent(nullptr), m_index(-1) { }
const_iterator() = default;
const_iterator(const FileIterator *parent, int id)
: m_parent(parent), m_index(id)
{}
@@ -100,11 +100,11 @@ public:
}
bool operator!=(const const_iterator &other) const { return !operator==(other); }
const FileIterator *m_parent;
int m_index; // -1 == end
const FileIterator *m_parent = nullptr;
int m_index = -1; // -1 == end
};
virtual ~FileIterator() {}
virtual ~FileIterator() = default;
const_iterator begin() const;
const_iterator end() const;
@@ -169,7 +169,7 @@ private:
class QTCREATOR_UTILS_EXPORT FileSearchResult
{
public:
FileSearchResult() {}
FileSearchResult() = default;
FileSearchResult(const QString &fileName, int lineNumber, const QString &matchingLine,
int matchStart, int matchLength,
const QStringList &regexpCapturedTexts)
@@ -189,7 +189,7 @@ public:
QStringList regexpCapturedTexts;
};
typedef QList<FileSearchResult> FileSearchResultList;
using FileSearchResultList = QList<FileSearchResult>;
QTCREATOR_UTILS_EXPORT QFuture<FileSearchResultList> findInFiles(const QString &searchTerm, FileIterator *files,
QTextDocument::FindFlags flags, const QMap<QString, QString> &fileToContentsMap = QMap<QString, QString>());

View File

@@ -395,10 +395,7 @@ bool FileReader::fetch(const QString &fileName, QIODevice::OpenMode mode, QWidge
}
#endif // QT_GUI_LIB
FileSaverBase::FileSaverBase()
: m_hasError(false)
{
}
FileSaverBase::FileSaverBase() = default;
FileSaverBase::~FileSaverBase() = default;
@@ -526,7 +523,6 @@ bool FileSaver::finalize()
}
TempFileSaver::TempFileSaver(const QString &templ)
: m_autoRemove(true)
{
m_file.reset(new QTemporaryFile{});
auto tempFile = static_cast<QTemporaryFile *>(m_file.get());

View File

@@ -206,7 +206,7 @@ protected:
std::unique_ptr<QFile> m_file;
QString m_fileName;
QString m_errorString;
bool m_hasError;
bool m_hasError = false;
private:
Q_DISABLE_COPY(FileSaverBase)
@@ -236,7 +236,7 @@ public:
void setAutoRemove(bool on) { m_autoRemove = on; }
private:
bool m_autoRemove;
bool m_autoRemove = true;
};
} // namespace Utils

View File

@@ -58,7 +58,6 @@ namespace Utils {
*/
FixedSizeClickLabel::FixedSizeClickLabel(QWidget *parent)
: QLabel(parent)
, m_pressed(false)
{
}

View File

@@ -54,7 +54,7 @@ signals:
private:
QString m_maxText;
bool m_pressed;
bool m_pressed = false;
};
} // namespace Utils

View File

@@ -38,10 +38,7 @@ namespace {
}
}
HtmlDocExtractor::HtmlDocExtractor() :
m_formatContents(true),
m_mode(FirstParagraph)
{}
HtmlDocExtractor::HtmlDocExtractor() = default;
void HtmlDocExtractor::setMode(Mode mode)
{ m_mode = mode; }

View File

@@ -81,8 +81,8 @@ private:
static void replaceTablesForSimpleLines(QString *html);
static void replaceListsForSimpleLines(QString *html);
bool m_formatContents;
Mode m_mode;
bool m_formatContents = true;
Mode m_mode = FirstParagraph;
};
} // namespace Utils

View File

@@ -38,7 +38,7 @@ QT_FORWARD_DECLARE_CLASS(QString)
namespace Utils {
typedef QPair<QString, Theme::Color> IconMaskAndColor;
using IconMaskAndColor = QPair<QString, Theme::Color>;
// Returns a recolored icon with shadow and custom disabled state for a
// series of grayscalemask|Theme::Color mask pairs

View File

@@ -51,7 +51,7 @@ public:
inline void *allocate(size_t size)
{
char *obj = new char[size];
auto obj = new char[size];
_objs.append(obj);
return obj;
}

View File

@@ -35,9 +35,7 @@ namespace Utils {
struct Link
{
Link(const QString &fileName = QString(), int line = 0, int column = 0)
: linkTextStart(-1)
, linkTextEnd(-1)
, targetFileName(fileName)
: targetFileName(fileName)
, targetLine(line)
, targetColumn(column)
{}
@@ -51,8 +49,8 @@ struct Link
bool operator==(const Link &other) const
{ return linkTextStart == other.linkTextStart && linkTextEnd == other.linkTextEnd; }
int linkTextStart;
int linkTextEnd;
int linkTextStart = 1;
int linkTextEnd = -1;
QString targetFileName;
int targetLine;

View File

@@ -38,8 +38,8 @@ namespace Utils {
namespace Internal { class MacroExpanderPrivate; }
class MacroExpander;
typedef std::function<MacroExpander *()> MacroExpanderProvider;
typedef QVector<MacroExpanderProvider> MacroExpanderProviders;
using MacroExpanderProvider = std::function<MacroExpander *()>;
using MacroExpanderProviders = QVector<MacroExpanderProvider>;
class QTCREATOR_UTILS_EXPORT MacroExpander
{
@@ -59,10 +59,10 @@ public:
QString expandProcessArgs(const QString &argsWithVariables) const;
typedef std::function<QString(QString)> PrefixFunction;
typedef std::function<bool(QString, QString *)> ResolverFunction;
typedef std::function<QString()> StringFunction;
typedef std::function<int()> IntFunction;
using PrefixFunction = std::function<QString(QString)>;
using ResolverFunction = std::function<bool(QString, QString *)>;
using StringFunction = std::function<QString()>;
using IntFunction = std::function<int()>;
void registerPrefix(const QByteArray &prefix,
const QString &description, const PrefixFunction &value);

View File

@@ -30,7 +30,7 @@
using namespace Utils;
OverrideCursor::OverrideCursor(const QCursor &cursor)
: m_set(true), m_cursor(cursor)
: m_cursor(cursor)
{
QApplication::setOverrideCursor(cursor);
}

View File

@@ -39,7 +39,7 @@ public:
void set();
void reset();
private:
bool m_set;
bool m_set = true;
QCursor m_cursor;
};

View File

@@ -38,7 +38,7 @@ namespace Utils {
class QTCREATOR_UTILS_EXPORT Port
{
public:
Port() : m_port(-1) {}
Port() = default;
explicit Port(quint16 port) : m_port(port) {}
explicit Port(int port) :
m_port((port < 0 || port > std::numeric_limits<quint16>::max()) ? -1 : port)
@@ -56,7 +56,7 @@ public:
QString toString() const { return QString::number(m_port); }
private:
int m_port;
int m_port = -1;
};
inline bool operator<(const Port &p1, const Port &p2) { return p1.number() < p2.number(); }

View File

@@ -28,11 +28,7 @@
using namespace Utils;
ProxyAction::ProxyAction(QObject *parent) :
QAction(parent),
m_action(nullptr),
m_attributes(nullptr),
m_showShortcut(false),
m_block(false)
QAction(parent)
{
connect(this, &QAction::changed, this, &ProxyAction::updateToolTipWithKeySequence);
updateState();

View File

@@ -68,11 +68,11 @@ private:
void connectAction();
void update(QAction *action, bool initialize);
QPointer<QAction> m_action;
Attributes m_attributes;
bool m_showShortcut;
QPointer<QAction> m_action = nullptr;
Attributes m_attributes = {};
bool m_showShortcut = false;
QString m_toolTip;
bool m_block;
bool m_block = false;
};
} // namespace Utils

View File

@@ -668,9 +668,7 @@ bool QtcProcess::prepareCommand(const QString &command, const QString &arguments
}
QtcProcess::QtcProcess(QObject *parent)
: QProcess(parent),
m_haveEnv(false),
m_useCtrlCStub(false)
: QProcess(parent)
{
static int qProcessExitStatusMeta = qRegisterMetaType<QProcess::ExitStatus>();
static int qProcessProcessErrorMeta = qRegisterMetaType<QProcess::ProcessError>();

View File

@@ -106,7 +106,7 @@ public:
class QTCREATOR_UTILS_EXPORT ArgIterator {
public:
ArgIterator(QString *str, OsType osType = HostOsInfo::hostOs())
: m_str(str), m_pos(0), m_prev(-1), m_osType(osType)
: m_str(str), m_osType(osType)
{}
//! Get the next argument. Returns false on encountering end of first command.
bool next();
@@ -121,7 +121,8 @@ public:
void appendArg(const QString &str);
private:
QString *m_str, m_value;
int m_pos, m_prev;
int m_pos = 0;
int m_prev = -1;
bool m_simple;
OsType m_osType;
};
@@ -143,8 +144,8 @@ private:
QString m_command;
QString m_arguments;
Environment m_environment;
bool m_haveEnv;
bool m_useCtrlCStub;
bool m_haveEnv = false;
bool m_useCtrlCStub = false;
};
} // namespace Utils

View File

@@ -56,7 +56,6 @@ namespace Utils {
SavedAction::SavedAction(QObject *parent)
: QAction(parent)
{
m_widget = nullptr;
connect(this, &QAction::triggered, this, &SavedAction::actionTriggered);
}

View File

@@ -83,14 +83,14 @@ private:
QString m_settingsKey;
QString m_settingsGroup;
QString m_dialogText;
QWidget *m_widget;
QWidget *m_widget = nullptr;
};
class QTCREATOR_UTILS_EXPORT SavedActionSet
{
public:
SavedActionSet() {}
~SavedActionSet() {}
SavedActionSet() = default;
~SavedActionSet() = default;
void insert(SavedAction *action, QWidget *widget);
void apply(QSettings *settings);

View File

@@ -39,7 +39,7 @@ namespace Utils {
QFile::Permissions SaveFile::m_umask = nullptr;
SaveFile::SaveFile(const QString &filename) :
m_finalFileName(filename), m_finalized(true)
m_finalFileName(filename)
{
}

View File

@@ -51,7 +51,7 @@ public:
private:
const QString m_finalFileName;
std::unique_ptr<QTemporaryFile> m_tempFile;
bool m_finalized;
bool m_finalized = true;
static QFile::Permissions m_umask;
};

View File

@@ -49,6 +49,6 @@ public:
}
};
typedef ScopedSwap<bool> ScopedBoolSwap;
using ScopedBoolSwap = ScopedSwap<bool>;
} // Utils namespace

View File

@@ -78,7 +78,7 @@ public:
virtual ~SettingsAccessor() = default;
enum ProceedInfo { Continue, DiscardAndContinue };
typedef QHash<QMessageBox::StandardButton, ProceedInfo> ButtonMap;
using ButtonMap = QHash<QMessageBox::StandardButton, ProceedInfo>;
class Issue {
public:
enum class Type { ERROR, WARNING };
@@ -224,7 +224,7 @@ public:
virtual QVariantMap upgrade(const QVariantMap &data) = 0;
protected:
typedef QPair<QLatin1String,QLatin1String> Change;
using Change = QPair<QLatin1String,QLatin1String>;
QVariantMap renameKeys(const QList<Change> &changes, QVariantMap map) const;
private:

View File

@@ -46,8 +46,8 @@ class QTCREATOR_UTILS_EXPORT SettingsSelector : public QWidget
Q_OBJECT
public:
explicit SettingsSelector(QWidget *parent = 0);
~SettingsSelector();
explicit SettingsSelector(QWidget *parent = nullptr);
~SettingsSelector() override;
void setConfigurationModel(QAbstractItemModel *model);
QAbstractItemModel *configurationModel() const;

View File

@@ -503,7 +503,6 @@ void ShellCommand::setOutputProxyFactory(const std::function<OutputProxy *()> &f
}
ProgressParser::ProgressParser() :
m_future(nullptr),
m_futureMutex(new QMutex)
{ }

View File

@@ -63,7 +63,7 @@ private:
void setFuture(QFutureInterface<void> *future);
QFutureInterface<void> *m_future;
QMutex *m_futureMutex;
QMutex *m_futureMutex = nullptr;
friend class ShellCommand;
};

View File

@@ -35,7 +35,7 @@
namespace Utils {
StatusLabel::StatusLabel(QWidget *parent) : QLabel(parent), m_timer(nullptr)
StatusLabel::StatusLabel(QWidget *parent) : QLabel(parent)
{
// A manual size let's us shrink below minimum text width which is what
// we want in [fake] status bars.

View File

@@ -47,7 +47,7 @@ private:
void slotTimeout();
void stopTimer();
QTimer *m_timer;
QTimer *m_timer = nullptr;
QString m_lastPermanentStatusMessage;
};

View File

@@ -84,7 +84,7 @@ namespace Utils {
// A special QProcess derivative allowing for terminal control.
class TerminalControllingProcess : public QProcess {
public:
TerminalControllingProcess() : m_flags(0) {}
TerminalControllingProcess() = default;
unsigned flags() const { return m_flags; }
void setFlags(unsigned tc) { m_flags = tc; }
@@ -93,7 +93,7 @@ protected:
void setupChildProcess() override;
private:
unsigned m_flags;
unsigned m_flags = 0;
};
void TerminalControllingProcess::setupChildProcess()

View File

@@ -68,10 +68,7 @@ QDebug operator<<(QDebug d, const TextFileFormat &format)
as strings or string lists and to write out files.
*/
TextFileFormat::TextFileFormat() :
lineTerminationMode(NativeLineTerminator), hasUtf8Bom(false), codec(nullptr)
{
}
TextFileFormat::TextFileFormat() = default;
/*!
Detects the format of text data.

View File

@@ -78,9 +78,9 @@ public:
static QByteArray decodingErrorSample(const QByteArray &data);
LineTerminationMode lineTerminationMode;
bool hasUtf8Bom;
const QTextCodec *codec;
LineTerminationMode lineTerminationMode = NativeLineTerminator;
bool hasUtf8Bom = false;
const QTextCodec *codec = nullptr;
};
} // namespace Utils

View File

@@ -605,10 +605,7 @@ namespace Utils {
//
// TreeItem
//
TreeItem::TreeItem()
: m_parent(nullptr), m_model(nullptr)
{
}
TreeItem::TreeItem() = default;
TreeItem::~TreeItem()
{

View File

@@ -99,8 +99,8 @@ private:
void removeItemAt(int pos);
void propagateModel(BaseTreeModel *m);
TreeItem *m_parent; // Not owned.
BaseTreeModel *m_model; // Not owned.
TreeItem *m_parent = nullptr; // Not owned.
BaseTreeModel *m_model = nullptr; // Not owned.
QVector<TreeItem *> m_children; // Owned.
friend class BaseTreeModel;
};

View File

@@ -44,7 +44,7 @@ void TreeViewComboBoxView::adjustWidth(int width)
TreeViewComboBox::TreeViewComboBox(QWidget *parent)
: QComboBox(parent), m_skipNextHide(false)
: QComboBox(parent)
{
m_view = new TreeViewComboBoxView;
m_view->setHeaderHidden(true);

View File

@@ -61,6 +61,6 @@ private:
QModelIndex lastIndex(const QModelIndex &index);
TreeViewComboBoxView *m_view;
bool m_skipNextHide;
bool m_skipNextHide = false;
};
}

View File

@@ -32,14 +32,11 @@ using namespace Utils;
CommentDefinition CommentDefinition::CppStyle = CommentDefinition("//", "/*", "*/");
CommentDefinition CommentDefinition::HashStyle = CommentDefinition("#");
CommentDefinition::CommentDefinition() :
isAfterWhiteSpaces(false)
{}
CommentDefinition::CommentDefinition() = default;
CommentDefinition::CommentDefinition(const QString &single, const QString &multiStart,
const QString &multiEnd)
: isAfterWhiteSpaces(false),
singleLine(single),
: singleLine(single),
multiLineStart(multiStart),
multiLineEnd(multiEnd)
{

View File

@@ -50,7 +50,7 @@ public:
bool hasMultiLineStyle() const;
public:
bool isAfterWhiteSpaces;
bool isAfterWhiteSpaces = false;
QString singleLine;
QString multiLineStart;
QString multiLineEnd;

View File

@@ -565,12 +565,7 @@ class WizardProgressPrivate
Q_DECLARE_PUBLIC(WizardProgress)
public:
WizardProgressPrivate()
:
m_currentItem(nullptr),
m_startItem(nullptr)
{
}
WizardProgressPrivate() = default;
bool isNextItem(WizardProgressItem *item, WizardProgressItem *nextItem) const;
// if multiple paths are possible the empty list is returned
@@ -585,8 +580,8 @@ public:
QList<WizardProgressItem *> m_visitedItems;
QList<WizardProgressItem *> m_reachableItems;
WizardProgressItem *m_currentItem;
WizardProgressItem *m_startItem;
WizardProgressItem *m_currentItem = nullptr;
WizardProgressItem *m_startItem = nullptr;
};
class WizardProgressItemPrivate