forked from qt-creator/qt-creator
Utils: More forward declarations / drop unused headers [H-K]
Round 1 - focus on headers. For classes with initial in range [H-K]. Try to keep the same separators between different kind of headers. Change-Id: Iefb032953743be41a847ee011c30527edfa425d8 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -27,8 +27,8 @@
|
|||||||
#include "qtcassert.h"
|
#include "qtcassert.h"
|
||||||
#include "stylehelper.h"
|
#include "stylehelper.h"
|
||||||
|
|
||||||
#include <utils/icon.h>
|
#include "icon.h"
|
||||||
#include <utils/theme/theme.h>
|
#include "theme/theme.h"
|
||||||
|
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#include <QItemDelegate>
|
#include <QItemDelegate>
|
||||||
#include <QListView>
|
#include <QListView>
|
||||||
|
#include <QMouseEvent>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QWindow>
|
#include <QWindow>
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include "osspecificaspects.h"
|
#include "osspecificaspects.h"
|
||||||
|
|
||||||
#include <QString>
|
QT_FORWARD_DECLARE_CLASS(QString)
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
#define QTC_HOST_EXE_SUFFIX QTC_WIN_EXE_SUFFIX
|
#define QTC_HOST_EXE_SUFFIX QTC_WIN_EXE_SUFFIX
|
||||||
|
@@ -27,6 +27,8 @@
|
|||||||
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
|
QT_FORWARD_DECLARE_CLASS(QString)
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
class QTCREATOR_UTILS_EXPORT HtmlDocExtractor
|
class QTCREATOR_UTILS_EXPORT HtmlDocExtractor
|
||||||
|
@@ -34,6 +34,7 @@
|
|||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
|
@@ -25,10 +25,11 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "fileutils.h"
|
|
||||||
#include "theme/theme.h"
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
|
#include "filepath.h"
|
||||||
|
#include "theme/theme.h"
|
||||||
|
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QPair>
|
#include <QPair>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
@@ -241,14 +241,14 @@ Id Id::versionedId(const QByteArray &prefix, int major, int minor)
|
|||||||
|
|
||||||
QSet<Id> Id::fromStringList(const QStringList &list)
|
QSet<Id> Id::fromStringList(const QStringList &list)
|
||||||
{
|
{
|
||||||
return Utils::transform<QSet<Id>>(list, &Id::fromString);
|
return transform<QSet<Id>>(list, &Id::fromString);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList Id::toStringList(const QSet<Id> &ids)
|
QStringList Id::toStringList(const QSet<Id> &ids)
|
||||||
{
|
{
|
||||||
QList<Id> idList = Utils::toList(ids);
|
QList<Id> idList = toList(ids);
|
||||||
Utils::sort(idList);
|
sort(idList);
|
||||||
return Utils::transform(idList, &Id::toString);
|
return transform(idList, &Id::toString);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -336,12 +336,12 @@ QString Id::suffixAfter(Id baseId) const
|
|||||||
return n.startsWith(b) ? QString::fromUtf8(n.mid(b.size())) : QString();
|
return n.startsWith(b) ? QString::fromUtf8(n.mid(b.size())) : QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QDataStream &operator<<(QDataStream &ds, Utils::Id id)
|
QDataStream &operator<<(QDataStream &ds, Id id)
|
||||||
{
|
{
|
||||||
return ds << id.name();
|
return ds << id.name();
|
||||||
}
|
}
|
||||||
|
|
||||||
QDataStream &operator>>(QDataStream &ds, Utils::Id &id)
|
QDataStream &operator>>(QDataStream &ds, Id &id)
|
||||||
{
|
{
|
||||||
QByteArray ba;
|
QByteArray ba;
|
||||||
ds >> ba;
|
ds >> ba;
|
||||||
@@ -349,7 +349,7 @@ QDataStream &operator>>(QDataStream &ds, Utils::Id &id)
|
|||||||
return ds;
|
return ds;
|
||||||
}
|
}
|
||||||
|
|
||||||
QDebug operator<<(QDebug dbg, const Utils::Id &id)
|
QDebug operator<<(QDebug dbg, const Id &id)
|
||||||
{
|
{
|
||||||
return dbg << id.name();
|
return dbg << id.name();
|
||||||
}
|
}
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
#include "porting.h"
|
#include "porting.h"
|
||||||
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
@@ -75,9 +76,9 @@ public:
|
|||||||
static QStringList toStringList(const QSet<Id> &ids);
|
static QStringList toStringList(const QSet<Id> &ids);
|
||||||
|
|
||||||
friend QHashValueType qHash(Id id) { return static_cast<QHashValueType>(id.uniqueIdentifier()); }
|
friend QHashValueType qHash(Id id) { return static_cast<QHashValueType>(id.uniqueIdentifier()); }
|
||||||
friend QTCREATOR_UTILS_EXPORT QDataStream &operator<<(QDataStream &ds, Utils::Id id);
|
friend QTCREATOR_UTILS_EXPORT QDataStream &operator<<(QDataStream &ds, Id id);
|
||||||
friend QTCREATOR_UTILS_EXPORT QDataStream &operator>>(QDataStream &ds, Utils::Id &id);
|
friend QTCREATOR_UTILS_EXPORT QDataStream &operator>>(QDataStream &ds, Id &id);
|
||||||
friend QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug dbg, const Utils::Id &id);
|
friend QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug dbg, const Id &id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit Id(quintptr uid) : m_id(uid) {}
|
explicit Id(quintptr uid) : m_id(uid) {}
|
||||||
|
@@ -119,7 +119,7 @@ void InfoBarEntry::setComboInfo(const QStringList &list,
|
|||||||
const QString &tooltip,
|
const QString &tooltip,
|
||||||
int currentIndex)
|
int currentIndex)
|
||||||
{
|
{
|
||||||
auto comboInfos = Utils::transform(list, [](const QString &string) {
|
auto comboInfos = transform(list, [](const QString &string) {
|
||||||
return ComboInfo{string, string};
|
return ComboInfo{string, string};
|
||||||
});
|
});
|
||||||
setComboInfo(comboInfos, callBack, tooltip, currentIndex);
|
setComboInfo(comboInfos, callBack, tooltip, currentIndex);
|
||||||
@@ -157,14 +157,14 @@ void InfoBar::addInfo(const InfoBarEntry &info)
|
|||||||
void InfoBar::removeInfo(Id id)
|
void InfoBar::removeInfo(Id id)
|
||||||
{
|
{
|
||||||
const int size = m_infoBarEntries.size();
|
const int size = m_infoBarEntries.size();
|
||||||
Utils::erase(m_infoBarEntries, Utils::equal(&InfoBarEntry::m_id, id));
|
Utils::erase(m_infoBarEntries, equal(&InfoBarEntry::m_id, id));
|
||||||
if (size != m_infoBarEntries.size())
|
if (size != m_infoBarEntries.size())
|
||||||
emit changed();
|
emit changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InfoBar::containsInfo(Id id) const
|
bool InfoBar::containsInfo(Id id) const
|
||||||
{
|
{
|
||||||
return Utils::anyOf(m_infoBarEntries, Utils::equal(&InfoBarEntry::m_id, id));
|
return anyOf(m_infoBarEntries, equal(&InfoBarEntry::m_id, id));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove and suppress id
|
// Remove and suppress id
|
||||||
@@ -211,7 +211,7 @@ void InfoBar::initialize(QSettings *settings)
|
|||||||
|
|
||||||
if (QTC_GUARD(m_settings)) {
|
if (QTC_GUARD(m_settings)) {
|
||||||
const QStringList list = m_settings->value(QLatin1String(C_SUPPRESSED_WARNINGS)).toStringList();
|
const QStringList list = m_settings->value(QLatin1String(C_SUPPRESSED_WARNINGS)).toStringList();
|
||||||
globallySuppressed = Utils::transform<QSet>(list, Id::fromString);
|
globallySuppressed = transform<QSet>(list, Id::fromString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@ void InfoBar::writeGloballySuppressedToSettings()
|
|||||||
{
|
{
|
||||||
if (!m_settings)
|
if (!m_settings)
|
||||||
return;
|
return;
|
||||||
const QStringList list = Utils::transform<QList>(globallySuppressed, &Id::toString);
|
const QStringList list = transform<QList>(globallySuppressed, &Id::toString);
|
||||||
QtcSettings::setValueWithDefault(m_settings, C_SUPPRESSED_WARNINGS, list);
|
QtcSettings::setValueWithDefault(m_settings, C_SUPPRESSED_WARNINGS, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -386,7 +386,7 @@ void InfoBarDisplay::update()
|
|||||||
if (info.m_cancelButtonText.isEmpty()) {
|
if (info.m_cancelButtonText.isEmpty()) {
|
||||||
if (infoWidgetCloseButton) {
|
if (infoWidgetCloseButton) {
|
||||||
infoWidgetCloseButton->setAutoRaise(true);
|
infoWidgetCloseButton->setAutoRaise(true);
|
||||||
infoWidgetCloseButton->setIcon(Utils::Icons::CLOSE_FOREGROUND.icon());
|
infoWidgetCloseButton->setIcon(Icons::CLOSE_FOREGROUND.icon());
|
||||||
infoWidgetCloseButton->setToolTip(tr("Close"));
|
infoWidgetCloseButton->setToolTip(tr("Close"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -25,10 +25,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "id.h"
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
#include <QFrame>
|
#include "id.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
|
|
||||||
|
@@ -25,8 +25,8 @@
|
|||||||
|
|
||||||
#include "infolabel.h"
|
#include "infolabel.h"
|
||||||
|
|
||||||
#include <utils/icon.h>
|
#include "icon.h"
|
||||||
#include <utils/utilsicons.h>
|
#include "utilsicons.h"
|
||||||
|
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QPaintEvent>
|
#include <QPaintEvent>
|
||||||
@@ -75,7 +75,7 @@ QSize InfoLabel::minimumSizeHint() const
|
|||||||
return baseHint;
|
return baseHint;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Utils::Theme::Color fillColorForType(InfoLabel::InfoType type)
|
static Theme::Color fillColorForType(InfoLabel::InfoType type)
|
||||||
{
|
{
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
@@ -27,15 +27,13 @@
|
|||||||
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
static const char activationModeC[] = "ActivationMode";
|
#include <QKeyEvent>
|
||||||
|
|
||||||
#include <QListView>
|
#include <QListView>
|
||||||
#include <QListWidget>
|
#include <QListWidget>
|
||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
#include <QTreeWidget>
|
#include <QTreeWidget>
|
||||||
|
|
||||||
#include <QKeyEvent>
|
static const char activationModeC[] = "ActivationMode";
|
||||||
|
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
|
@@ -27,10 +27,10 @@
|
|||||||
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
#include <QHash>
|
|
||||||
#include <QVector>
|
|
||||||
#include <QStringList>
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
#include <QHash>
|
||||||
|
#include <QStringList>
|
||||||
|
#include <QVector>
|
||||||
|
|
||||||
QT_FORWARD_DECLARE_CLASS(QVariant)
|
QT_FORWARD_DECLARE_CLASS(QVariant)
|
||||||
|
|
||||||
|
@@ -28,7 +28,9 @@
|
|||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
|
|
||||||
Utils::JsonTreeItem::JsonTreeItem(const QString &displayName, const QJsonValue &value)
|
namespace Utils {
|
||||||
|
|
||||||
|
JsonTreeItem::JsonTreeItem(const QString &displayName, const QJsonValue &value)
|
||||||
: m_name(displayName)
|
: m_name(displayName)
|
||||||
, m_value(value)
|
, m_value(value)
|
||||||
{ }
|
{ }
|
||||||
@@ -37,24 +39,24 @@ static QString typeName(QJsonValue::Type type)
|
|||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case QJsonValue::Null:
|
case QJsonValue::Null:
|
||||||
return Utils::JsonTreeItem::tr("Null");
|
return JsonTreeItem::tr("Null");
|
||||||
case QJsonValue::Bool:
|
case QJsonValue::Bool:
|
||||||
return Utils::JsonTreeItem::tr("Bool");
|
return JsonTreeItem::tr("Bool");
|
||||||
case QJsonValue::Double:
|
case QJsonValue::Double:
|
||||||
return Utils::JsonTreeItem::tr("Double");
|
return JsonTreeItem::tr("Double");
|
||||||
case QJsonValue::String:
|
case QJsonValue::String:
|
||||||
return Utils::JsonTreeItem::tr("String");
|
return JsonTreeItem::tr("String");
|
||||||
case QJsonValue::Array:
|
case QJsonValue::Array:
|
||||||
return Utils::JsonTreeItem::tr("Array");
|
return JsonTreeItem::tr("Array");
|
||||||
case QJsonValue::Object:
|
case QJsonValue::Object:
|
||||||
return Utils::JsonTreeItem::tr("Object");
|
return JsonTreeItem::tr("Object");
|
||||||
case QJsonValue::Undefined:
|
case QJsonValue::Undefined:
|
||||||
return Utils::JsonTreeItem::tr("Undefined");
|
return JsonTreeItem::tr("Undefined");
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant Utils::JsonTreeItem::data(int column, int role) const
|
QVariant JsonTreeItem::data(int column, int role) const
|
||||||
{
|
{
|
||||||
if (role != Qt::DisplayRole)
|
if (role != Qt::DisplayRole)
|
||||||
return {};
|
return {};
|
||||||
@@ -69,12 +71,12 @@ QVariant Utils::JsonTreeItem::data(int column, int role) const
|
|||||||
return m_value.toVariant();
|
return m_value.toVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Utils::JsonTreeItem::canFetchMore() const
|
bool JsonTreeItem::canFetchMore() const
|
||||||
{
|
{
|
||||||
return canFetchObjectChildren() || canFetchArrayChildren();
|
return canFetchObjectChildren() || canFetchArrayChildren();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Utils::JsonTreeItem::fetchMore()
|
void JsonTreeItem::fetchMore()
|
||||||
{
|
{
|
||||||
if (canFetchObjectChildren()) {
|
if (canFetchObjectChildren()) {
|
||||||
const QJsonObject &object = m_value.toObject();
|
const QJsonObject &object = m_value.toObject();
|
||||||
@@ -88,12 +90,14 @@ void Utils::JsonTreeItem::fetchMore()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Utils::JsonTreeItem::canFetchObjectChildren() const
|
bool JsonTreeItem::canFetchObjectChildren() const
|
||||||
{
|
{
|
||||||
return m_value.isObject() && m_value.toObject().size() > childCount();
|
return m_value.isObject() && m_value.toObject().size() > childCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Utils::JsonTreeItem::canFetchArrayChildren() const
|
bool JsonTreeItem::canFetchArrayChildren() const
|
||||||
{
|
{
|
||||||
return m_value.isArray() && m_value.toArray().size() > childCount();
|
return m_value.isArray() && m_value.toArray().size() > childCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Utils
|
||||||
|
@@ -29,8 +29,8 @@
|
|||||||
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
#include <QJsonValue>
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
#include <QJsonValue>
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
|
@@ -25,9 +25,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "icon.h"
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
|
#include "icon.h"
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
namespace Icons {
|
namespace Icons {
|
||||||
|
|
||||||
|
@@ -38,7 +38,6 @@
|
|||||||
#include "testsettingspage.h"
|
#include "testsettingspage.h"
|
||||||
#include "testtreeitem.h"
|
#include "testtreeitem.h"
|
||||||
#include "testtreemodel.h"
|
#include "testtreemodel.h"
|
||||||
#include "testtreeview.h"
|
|
||||||
|
|
||||||
#include "boost/boosttestframework.h"
|
#include "boost/boosttestframework.h"
|
||||||
#include "catch/catchframework.h"
|
#include "catch/catchframework.h"
|
||||||
|
@@ -30,6 +30,7 @@
|
|||||||
#include "ui_docsettingspage.h"
|
#include "ui_docsettingspage.h"
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
|
#include <utils/fileutils.h>
|
||||||
|
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "seekerslider.h"
|
#include "seekerslider.h"
|
||||||
|
|
||||||
#include <utils/icon.h>
|
#include <utils/icon.h>
|
||||||
|
|
||||||
#include <QStyleOption>
|
#include <QStyleOption>
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "actionhandler.h"
|
#include "actionhandler.h"
|
||||||
|
|
||||||
#include "mytypes.h"
|
#include "mytypes.h"
|
||||||
|
|
||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
|
@@ -23,12 +23,13 @@
|
|||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "todoicons.h"
|
||||||
|
|
||||||
#include <utils/icon.h>
|
#include <utils/icon.h>
|
||||||
#include <utils/theme/theme.h>
|
#include <utils/theme/theme.h>
|
||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
|
|
||||||
#include "todoicons.h"
|
|
||||||
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace Todo {
|
namespace Todo {
|
||||||
|
Reference in New Issue
Block a user