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