forked from qt-creator/qt-creator
Utils: Replace QVector with QList
Make usages of QList consistent. In some cases the declaration contained QVector arg, while the definition had QList arg. Remove some unneeded includes of QList. Change-Id: I7c15b39f261cefdeec6aaaf506ff4cc981432855 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -637,7 +637,7 @@ public:
|
|||||||
|
|
||||||
SelectionAspect::DisplayStyle m_displayStyle
|
SelectionAspect::DisplayStyle m_displayStyle
|
||||||
= SelectionAspect::DisplayStyle::RadioButtons;
|
= SelectionAspect::DisplayStyle::RadioButtons;
|
||||||
QVector<SelectionAspect::Option> m_options;
|
QList<SelectionAspect::Option> m_options;
|
||||||
|
|
||||||
// These are all owned by the configuration widget.
|
// These are all owned by the configuration widget.
|
||||||
QList<QPointer<QRadioButton>> m_buttons;
|
QList<QPointer<QRadioButton>> m_buttons;
|
||||||
|
@@ -8,7 +8,6 @@
|
|||||||
#include "filepath.h"
|
#include "filepath.h"
|
||||||
#include "hostosinfo.h"
|
#include "hostosinfo.h"
|
||||||
|
|
||||||
#include <QList>
|
|
||||||
#include <QPair>
|
#include <QPair>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
|
@@ -13,7 +13,6 @@ publication by Neil Fraser: http://neil.fraser.name/writing/diff/
|
|||||||
|
|
||||||
#include "utilstr.h"
|
#include "utilstr.h"
|
||||||
|
|
||||||
#include <QList>
|
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QPair>
|
#include <QPair>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
@@ -10,8 +10,8 @@
|
|||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QList>
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
#include <QVector>
|
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
@@ -130,8 +130,8 @@ public:
|
|||||||
QByteArray debugLink;
|
QByteArray debugLink;
|
||||||
QByteArray buildId;
|
QByteArray buildId;
|
||||||
DebugSymbolsType symbolsType = UnknownSymbols;
|
DebugSymbolsType symbolsType = UnknownSymbols;
|
||||||
QVector<ElfSectionHeader> sectionHeaders;
|
QList<ElfSectionHeader> sectionHeaders;
|
||||||
QVector<ElfProgramHeader> programHeaders;
|
QList<ElfProgramHeader> programHeaders;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QTCREATOR_UTILS_EXPORT ElfReader
|
class QTCREATOR_UTILS_EXPORT ElfReader
|
||||||
|
@@ -24,7 +24,7 @@ namespace Utils {
|
|||||||
static QReadWriteLock s_envMutex;
|
static QReadWriteLock s_envMutex;
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(Environment, staticSystemEnvironment,
|
Q_GLOBAL_STATIC_WITH_ARGS(Environment, staticSystemEnvironment,
|
||||||
(QProcessEnvironment::systemEnvironment().toStringList()))
|
(QProcessEnvironment::systemEnvironment().toStringList()))
|
||||||
Q_GLOBAL_STATIC(QVector<EnvironmentProvider>, environmentProviders)
|
Q_GLOBAL_STATIC(QList<EnvironmentProvider>, environmentProviders)
|
||||||
|
|
||||||
Environment::Environment()
|
Environment::Environment()
|
||||||
: m_dict(HostOsInfo::hostOs())
|
: m_dict(HostOsInfo::hostOs())
|
||||||
@@ -352,7 +352,7 @@ void EnvironmentProvider::addProvider(EnvironmentProvider &&provider)
|
|||||||
environmentProviders->append(std::move(provider));
|
environmentProviders->append(std::move(provider));
|
||||||
}
|
}
|
||||||
|
|
||||||
const QVector<EnvironmentProvider> EnvironmentProvider::providers()
|
const QList<EnvironmentProvider> EnvironmentProvider::providers()
|
||||||
{
|
{
|
||||||
return *environmentProviders;
|
return *environmentProviders;
|
||||||
}
|
}
|
||||||
|
@@ -134,7 +134,7 @@ public:
|
|||||||
std::function<Environment()> environment;
|
std::function<Environment()> environment;
|
||||||
|
|
||||||
static void addProvider(EnvironmentProvider &&provider);
|
static void addProvider(EnvironmentProvider &&provider);
|
||||||
static const QVector<EnvironmentProvider> providers();
|
static const QList<EnvironmentProvider> providers();
|
||||||
static std::optional<EnvironmentProvider> provider(const QByteArray &id);
|
static std::optional<EnvironmentProvider> provider(const QByteArray &id);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QVector>
|
#include <QList>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QTreeView;
|
class QTreeView;
|
||||||
@@ -12,7 +12,7 @@ QT_END_NAMESPACE
|
|||||||
namespace Utils {
|
namespace Utils {
|
||||||
class NameValueDictionary;
|
class NameValueDictionary;
|
||||||
class NameValueItem;
|
class NameValueItem;
|
||||||
using NameValueItems = QVector<NameValueItem>;
|
using NameValueItems = QList<NameValueItem>;
|
||||||
|
|
||||||
class Environment;
|
class Environment;
|
||||||
using EnvironmentItem = NameValueItem;
|
using EnvironmentItem = NameValueItem;
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
#include <QVector>
|
#include <QList>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QRegularExpression;
|
class QRegularExpression;
|
||||||
@@ -26,8 +26,8 @@ public:
|
|||||||
|
|
||||||
class HighlightingPositions {
|
class HighlightingPositions {
|
||||||
public:
|
public:
|
||||||
QVector<int> starts;
|
QList<int> starts;
|
||||||
QVector<int> lengths;
|
QList<int> lengths;
|
||||||
};
|
};
|
||||||
|
|
||||||
static QRegularExpression createRegExp(
|
static QRegularExpression createRegExp(
|
||||||
|
@@ -134,12 +134,12 @@ void HighlightingItemDelegate::drawText(QPainter *painter,
|
|||||||
if (index.model()->hasChildren(index))
|
if (index.model()->hasChildren(index))
|
||||||
text += " (" + QString::number(index.model()->rowCount(index)) + ')';
|
text += " (" + QString::number(index.model()->rowCount(index)) + ')';
|
||||||
|
|
||||||
QVector<int> searchTermStarts =
|
QList<int> searchTermStarts
|
||||||
index.model()->data(index, int(HighlightingItemRole::StartColumn)).value<QVector<int>>();
|
= index.model()->data(index, int(HighlightingItemRole::StartColumn)).value<QList<int>>();
|
||||||
QVector<int> searchTermLengths =
|
QList<int> searchTermLengths
|
||||||
index.model()->data(index, int(HighlightingItemRole::Length)).value<QVector<int>>();
|
= index.model()->data(index, int(HighlightingItemRole::Length)).value<QList<int>>();
|
||||||
|
|
||||||
QVector<QTextLayout::FormatRange> formats;
|
QList<QTextLayout::FormatRange> formats;
|
||||||
|
|
||||||
const QString extraText
|
const QString extraText
|
||||||
= index.model()->data(index, int(HighlightingItemRole::DisplayExtra)).toString();
|
= index.model()->data(index, int(HighlightingItemRole::DisplayExtra)).toString();
|
||||||
@@ -230,7 +230,7 @@ QSizeF doTextLayout(QTextLayout *textLayout, int lineWidth)
|
|||||||
void HighlightingItemDelegate::drawDisplay(QPainter *painter,
|
void HighlightingItemDelegate::drawDisplay(QPainter *painter,
|
||||||
const QStyleOptionViewItem &option,
|
const QStyleOptionViewItem &option,
|
||||||
const QRect &rect, const QString &text,
|
const QRect &rect, const QString &text,
|
||||||
const QVector<QTextLayout::FormatRange> &format) const
|
const QList<QTextLayout::FormatRange> &format) const
|
||||||
{
|
{
|
||||||
QPalette::ColorGroup cg = option.state & QStyle::State_Enabled
|
QPalette::ColorGroup cg = option.state & QStyle::State_Enabled
|
||||||
? QPalette::Normal : QPalette::Disabled;
|
? QPalette::Normal : QPalette::Disabled;
|
||||||
|
@@ -36,7 +36,7 @@ private:
|
|||||||
const QRect &rect, const QModelIndex &index) const;
|
const QRect &rect, const QModelIndex &index) const;
|
||||||
using QItemDelegate::drawDisplay;
|
using QItemDelegate::drawDisplay;
|
||||||
void drawDisplay(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect,
|
void drawDisplay(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect,
|
||||||
const QString &text, const QVector<QTextLayout::FormatRange> &format) const;
|
const QString &text, const QList<QTextLayout::FormatRange> &format) const;
|
||||||
QString m_tabString;
|
QString m_tabString;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -36,7 +36,7 @@ static QPixmap maskToColorAndAlpha(const QPixmap &mask, const QColor &color)
|
|||||||
|
|
||||||
using MaskAndColor = QPair<QPixmap, QColor>;
|
using MaskAndColor = QPair<QPixmap, QColor>;
|
||||||
using MasksAndColors = QList<MaskAndColor>;
|
using MasksAndColors = QList<MaskAndColor>;
|
||||||
static MasksAndColors masksAndColors(const QVector<IconMaskAndColor> &icon, int dpr)
|
static MasksAndColors masksAndColors(const QList<IconMaskAndColor> &icon, int dpr)
|
||||||
{
|
{
|
||||||
MasksAndColors result;
|
MasksAndColors result;
|
||||||
for (const IconMaskAndColor &i: icon) {
|
for (const IconMaskAndColor &i: icon) {
|
||||||
@@ -134,7 +134,7 @@ static QPixmap masksToIcon(const MasksAndColors &masks, const QPixmap &combinedM
|
|||||||
|
|
||||||
Icon::Icon() = default;
|
Icon::Icon() = default;
|
||||||
|
|
||||||
Icon::Icon(QVector<IconMaskAndColor> args, Icon::IconStyleOptions style)
|
Icon::Icon(QList<IconMaskAndColor> args, Icon::IconStyleOptions style)
|
||||||
: m_iconSourceList(std::move(args))
|
: m_iconSourceList(std::move(args))
|
||||||
, m_style(style)
|
, m_style(style)
|
||||||
{
|
{
|
||||||
|
@@ -9,8 +9,8 @@
|
|||||||
#include "theme/theme.h"
|
#include "theme/theme.h"
|
||||||
|
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
#include <QList>
|
||||||
#include <QPair>
|
#include <QPair>
|
||||||
#include <QVector>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QColor;
|
class QColor;
|
||||||
@@ -40,7 +40,7 @@ public:
|
|||||||
Q_DECLARE_FLAGS(IconStyleOptions, IconStyleOption)
|
Q_DECLARE_FLAGS(IconStyleOptions, IconStyleOption)
|
||||||
|
|
||||||
Icon();
|
Icon();
|
||||||
Icon(QVector<IconMaskAndColor> args, IconStyleOptions style = ToolBarStyle);
|
Icon(QList<IconMaskAndColor> args, IconStyleOptions style = ToolBarStyle);
|
||||||
Icon(const FilePath &imageFileName);
|
Icon(const FilePath &imageFileName);
|
||||||
|
|
||||||
QIcon icon() const;
|
QIcon icon() const;
|
||||||
@@ -62,7 +62,7 @@ public:
|
|||||||
static QIcon combinedIcon(const QList<Icon> &icons);
|
static QIcon combinedIcon(const QList<Icon> &icons);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVector<IconMaskAndColor> m_iconSourceList;
|
QList<IconMaskAndColor> m_iconSourceList;
|
||||||
IconStyleOptions m_style = None;
|
IconStyleOptions m_style = None;
|
||||||
mutable int m_lastDevicePixelRatio = -1;
|
mutable int m_lastDevicePixelRatio = -1;
|
||||||
mutable QIcon m_lastIcon;
|
mutable QIcon m_lastIcon;
|
||||||
|
@@ -8,7 +8,6 @@
|
|||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QVector>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QVariant;
|
class QVariant;
|
||||||
@@ -37,7 +36,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVector<char *> _objs;
|
QList<char *> _objs;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -359,7 +358,7 @@ private:
|
|||||||
int m_index;
|
int m_index;
|
||||||
};
|
};
|
||||||
|
|
||||||
QVector<Context> m_schemas;
|
QList<Context> m_schemas;
|
||||||
const JsonSchemaManager *m_manager;
|
const JsonSchemaManager *m_manager;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <QFormLayout>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QFormLayout>
|
|
||||||
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
|
||||||
|
@@ -88,10 +88,10 @@ public:
|
|||||||
|
|
||||||
QHash<QByteArray, MacroExpander::StringFunction> m_map;
|
QHash<QByteArray, MacroExpander::StringFunction> m_map;
|
||||||
QHash<QByteArray, MacroExpander::PrefixFunction> m_prefixMap;
|
QHash<QByteArray, MacroExpander::PrefixFunction> m_prefixMap;
|
||||||
QVector<MacroExpander::ResolverFunction> m_extraResolvers;
|
QList<MacroExpander::ResolverFunction> m_extraResolvers;
|
||||||
QMap<QByteArray, QString> m_descriptions;
|
QMap<QByteArray, QString> m_descriptions;
|
||||||
QString m_displayName;
|
QString m_displayName;
|
||||||
QVector<MacroExpanderProvider> m_subProviders;
|
QList<MacroExpanderProvider> m_subProviders;
|
||||||
bool m_accumulating = false;
|
bool m_accumulating = false;
|
||||||
|
|
||||||
bool m_aborted = false;
|
bool m_aborted = false;
|
||||||
|
@@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QVector>
|
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
@@ -18,7 +17,7 @@ namespace Internal { class MacroExpanderPrivate; }
|
|||||||
class FilePath;
|
class FilePath;
|
||||||
class MacroExpander;
|
class MacroExpander;
|
||||||
using MacroExpanderProvider = std::function<MacroExpander *()>;
|
using MacroExpanderProvider = std::function<MacroExpander *()>;
|
||||||
using MacroExpanderProviders = QVector<MacroExpanderProvider>;
|
using MacroExpanderProviders = QList<MacroExpanderProvider>;
|
||||||
|
|
||||||
class QTCREATOR_UTILS_EXPORT MacroExpander
|
class QTCREATOR_UTILS_EXPORT MacroExpander
|
||||||
{
|
{
|
||||||
|
@@ -30,7 +30,7 @@ inline bool operator<(const DictKey &k1, const DictKey &k2)
|
|||||||
inline bool operator>(const DictKey &k1, const DictKey &k2) { return k2 < k1; }
|
inline bool operator>(const DictKey &k1, const DictKey &k2) { return k2 < k1; }
|
||||||
|
|
||||||
using NameValuePair = std::pair<QString, QString>;
|
using NameValuePair = std::pair<QString, QString>;
|
||||||
using NameValuePairs = QVector<NameValuePair>;
|
using NameValuePairs = QList<NameValuePair>;
|
||||||
using NameValueMap = QMap<DictKey, QPair<QString, bool>>;
|
using NameValueMap = QMap<DictKey, QPair<QString, bool>>;
|
||||||
|
|
||||||
class QTCREATOR_UTILS_EXPORT NameValueDictionary
|
class QTCREATOR_UTILS_EXPORT NameValueDictionary
|
||||||
|
@@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QVariantList>
|
#include <QVariantList>
|
||||||
#include <QVector>
|
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
|
@@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
#include <QMetaType>
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
#include <QMetaType>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
@@ -45,7 +45,7 @@ void TerminalCommand::setSettings(QSettings *settings)
|
|||||||
s_settings = settings;
|
s_settings = settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(const QVector<TerminalCommand>, knownTerminals, (
|
Q_GLOBAL_STATIC_WITH_ARGS(const QList<TerminalCommand>, knownTerminals, (
|
||||||
{
|
{
|
||||||
{"x-terminal-emulator", "", "-e"},
|
{"x-terminal-emulator", "", "-e"},
|
||||||
{"xdg-terminal", "", "", true},
|
{"xdg-terminal", "", "", true},
|
||||||
@@ -82,9 +82,9 @@ TerminalCommand TerminalCommand::defaultTerminalEmulator()
|
|||||||
return defaultTerm;
|
return defaultTerm;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<TerminalCommand> TerminalCommand::availableTerminalEmulators()
|
QList<TerminalCommand> TerminalCommand::availableTerminalEmulators()
|
||||||
{
|
{
|
||||||
QVector<TerminalCommand> result;
|
QList<TerminalCommand> result;
|
||||||
|
|
||||||
if (HostOsInfo::isAnyUnixHost()) {
|
if (HostOsInfo::isAnyUnixHost()) {
|
||||||
const Environment env = Environment::systemEnvironment();
|
const Environment env = Environment::systemEnvironment();
|
||||||
|
@@ -7,8 +7,8 @@
|
|||||||
|
|
||||||
#include "filepath.h"
|
#include "filepath.h"
|
||||||
|
|
||||||
|
#include <QList>
|
||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
#include <QVector>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QSettings;
|
class QSettings;
|
||||||
@@ -35,7 +35,7 @@ public:
|
|||||||
|
|
||||||
static void setSettings(QSettings *settings);
|
static void setSettings(QSettings *settings);
|
||||||
static TerminalCommand defaultTerminalEmulator();
|
static TerminalCommand defaultTerminalEmulator();
|
||||||
static QVector<TerminalCommand> availableTerminalEmulators();
|
static QList<TerminalCommand> availableTerminalEmulators();
|
||||||
static TerminalCommand terminalEmulator();
|
static TerminalCommand terminalEmulator();
|
||||||
static void setTerminalEmulator(const TerminalCommand &term);
|
static void setTerminalEmulator(const TerminalCommand &term);
|
||||||
};
|
};
|
||||||
|
@@ -23,9 +23,9 @@ public:
|
|||||||
QStringList preferredStyles;
|
QStringList preferredStyles;
|
||||||
QString defaultTextEditorColorScheme;
|
QString defaultTextEditorColorScheme;
|
||||||
QString enforceAccentColorOnMacOS;
|
QString enforceAccentColorOnMacOS;
|
||||||
QVector<QPair<QColor, QString> > colors;
|
QList<QPair<QColor, QString> > colors;
|
||||||
QVector<QString> imageFiles;
|
QList<QString> imageFiles;
|
||||||
QVector<bool> flags;
|
QList<bool> flags;
|
||||||
QMap<QString, QColor> palette;
|
QMap<QString, QColor> palette;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -717,7 +717,7 @@ void TreeItem::sortChildren(const std::function<bool(const TreeItem *, const Tre
|
|||||||
{
|
{
|
||||||
if (m_model) {
|
if (m_model) {
|
||||||
if (const int n = childCount()) {
|
if (const int n = childCount()) {
|
||||||
QVector<TreeItem *> tmp = m_children;
|
QList<TreeItem *> tmp = m_children;
|
||||||
std::sort(tmp.begin(), tmp.end(), cmp);
|
std::sort(tmp.begin(), tmp.end(), cmp);
|
||||||
if (tmp == m_children) {
|
if (tmp == m_children) {
|
||||||
// Nothing changed.
|
// Nothing changed.
|
||||||
|
@@ -49,7 +49,7 @@ public:
|
|||||||
TreeItem *lastChild() const;
|
TreeItem *lastChild() const;
|
||||||
int level() const;
|
int level() const;
|
||||||
|
|
||||||
using const_iterator = QVector<TreeItem *>::const_iterator;
|
using const_iterator = QList<TreeItem *>::const_iterator;
|
||||||
using value_type = TreeItem *;
|
using value_type = TreeItem *;
|
||||||
int childCount() const { return m_children.size(); }
|
int childCount() const { return m_children.size(); }
|
||||||
int indexInParent() const;
|
int indexInParent() const;
|
||||||
@@ -81,7 +81,7 @@ private:
|
|||||||
|
|
||||||
TreeItem *m_parent = nullptr; // Not owned.
|
TreeItem *m_parent = nullptr; // Not owned.
|
||||||
BaseTreeModel *m_model = nullptr; // Not owned.
|
BaseTreeModel *m_model = nullptr; // Not owned.
|
||||||
QVector<TreeItem *> m_children; // Owned.
|
QList<TreeItem *> m_children; // Owned.
|
||||||
friend class BaseTreeModel;
|
friend class BaseTreeModel;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user