forked from qt-creator/qt-creator
Utils: More forward declarations / drop unused headers [L-O]
Round 1 - focus on headers. For classes with initial in range [L-O]. Try to keep the same separators between different kind of headers. Drop changes to NameValueDictionary for now, as apparently environmentfwd.h is broken currently. It looks we can't forward declare the argument T inside QList<T> - the type must be complete. Change-Id: If26e88357a2ffbb91a79c4d003046443d98d5673 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -72,7 +72,7 @@ private:
|
||||
|
||||
static QString launcherSocketName()
|
||||
{
|
||||
return Utils::TemporaryDirectory::masterDirectoryPath()
|
||||
return TemporaryDirectory::masterDirectoryPath()
|
||||
+ QStringLiteral("/launcher-%1").arg(QString::number(qApp->applicationPid()));
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ void LauncherInterface::sendData(const QByteArray &data)
|
||||
instance()->m_private->socket()->sendData(data);
|
||||
}
|
||||
|
||||
Utils::Internal::CallerHandle *LauncherInterface::registerHandle(QObject *parent, quintptr token)
|
||||
Internal::CallerHandle *LauncherInterface::registerHandle(QObject *parent, quintptr token)
|
||||
{
|
||||
QMutexLocker locker(&s_instanceMutex);
|
||||
return instance()->m_private->socket()->registerHandle(parent, token);
|
||||
|
@@ -47,13 +47,13 @@ public:
|
||||
static void setPathToLauncher(const QString &pathToLauncher);
|
||||
|
||||
private:
|
||||
friend class Utils::Internal::CallerHandle;
|
||||
friend class Utils::Internal::LauncherHandle;
|
||||
friend class Utils::Internal::ProcessLauncherImpl;
|
||||
friend class Internal::CallerHandle;
|
||||
friend class Internal::LauncherHandle;
|
||||
friend class Internal::ProcessLauncherImpl;
|
||||
|
||||
static bool isStarted();
|
||||
static void sendData(const QByteArray &data);
|
||||
static Utils::Internal::CallerHandle *registerHandle(QObject *parent, quintptr token);
|
||||
static Internal::CallerHandle *registerHandle(QObject *parent, quintptr token);
|
||||
static void unregisterHandle(quintptr token);
|
||||
|
||||
LauncherInterface();
|
||||
|
@@ -25,8 +25,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "environment.h"
|
||||
#include "filepath.h"
|
||||
#include "launcherpackets.h"
|
||||
#include "processinterface.h"
|
||||
|
||||
|
@@ -25,21 +25,21 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "filepath.h"
|
||||
#include "porting.h"
|
||||
#include "utils_global.h"
|
||||
|
||||
#include "filepath.h"
|
||||
|
||||
#include <QMetaType>
|
||||
#include <QString>
|
||||
#include <qmetatype.h>
|
||||
|
||||
#include <functional>
|
||||
|
||||
|
||||
namespace Utils {
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT Link
|
||||
{
|
||||
public:
|
||||
Link(const Utils::FilePath &filePath = Utils::FilePath(), int line = 0, int column = 0)
|
||||
Link(const FilePath &filePath = FilePath(), int line = 0, int column = 0)
|
||||
: targetFilePath(filePath)
|
||||
, targetLine(line)
|
||||
, targetColumn(column)
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
int linkTextStart = -1;
|
||||
int linkTextEnd = -1;
|
||||
|
||||
Utils::FilePath targetFilePath;
|
||||
FilePath targetFilePath;
|
||||
int targetLine;
|
||||
int targetColumn;
|
||||
};
|
||||
|
@@ -25,7 +25,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "utils_global.h"
|
||||
#include "treemodel.h"
|
||||
|
||||
namespace Utils {
|
||||
|
@@ -27,11 +27,11 @@
|
||||
|
||||
#include "utils_global.h"
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QList>
|
||||
#include <QVector>
|
||||
#include <QCoreApplication>
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace Utils {
|
||||
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "utils_global.h"
|
||||
|
||||
#include "algorithm.h"
|
||||
#include "runextensions.h"
|
||||
|
||||
|
@@ -39,11 +39,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "utils_global.h"
|
||||
|
||||
#include <mimemagicrule_p.h>
|
||||
#include <mimetype.h>
|
||||
|
||||
#include <utils/utils_global.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QFileInfo;
|
||||
QT_END_NAMESPACE
|
||||
|
@@ -25,10 +25,12 @@
|
||||
|
||||
#include "minimizableinfobars.h"
|
||||
|
||||
#include "infobar.h"
|
||||
#include "qtcassert.h"
|
||||
#include "qtcsettings.h"
|
||||
#include "utilsicons.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QToolButton>
|
||||
|
||||
const char SETTINGS_PREFIX[] = "ShowInfoBarFor";
|
||||
|
@@ -28,16 +28,19 @@
|
||||
#include "utils_global.h"
|
||||
|
||||
#include "id.h"
|
||||
#include "infobar.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QHash>
|
||||
#include <QObject>
|
||||
|
||||
#include <functional>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QAction)
|
||||
|
||||
namespace Utils {
|
||||
|
||||
class InfoBar;
|
||||
class InfoBarEntry;
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT MinimizableInfoBars : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -46,32 +49,32 @@ public:
|
||||
using ActionCreator = std::function<QAction *(QWidget *widget)>;
|
||||
|
||||
public:
|
||||
explicit MinimizableInfoBars(Utils::InfoBar &infoBar);
|
||||
explicit MinimizableInfoBars(InfoBar &infoBar);
|
||||
|
||||
void setSettingsGroup(const QString &settingsGroup);
|
||||
void setPossibleInfoBarEntries(const QList<Utils::InfoBarEntry> &entries);
|
||||
void setPossibleInfoBarEntries(const QList<InfoBarEntry> &entries);
|
||||
|
||||
void createShowInfoBarActions(const ActionCreator &actionCreator) const;
|
||||
|
||||
void setInfoVisible(const Utils::Id &id, bool visible);
|
||||
void setInfoVisible(const Id &id, bool visible);
|
||||
|
||||
private:
|
||||
void createActions();
|
||||
|
||||
QString settingsKey(const Utils::Id &id) const;
|
||||
bool showInInfoBar(const Utils::Id &id) const;
|
||||
void setShowInInfoBar(const Utils::Id &id, bool show);
|
||||
QString settingsKey(const Id &id) const;
|
||||
bool showInInfoBar(const Id &id) const;
|
||||
void setShowInInfoBar(const Id &id, bool show);
|
||||
|
||||
void updateInfo(const Utils::Id &id);
|
||||
void updateInfo(const Id &id);
|
||||
|
||||
void showInfoBar(const Utils::Id &id);
|
||||
void showInfoBar(const Id &id);
|
||||
|
||||
private:
|
||||
Utils::InfoBar &m_infoBar;
|
||||
InfoBar &m_infoBar;
|
||||
QString m_settingsGroup;
|
||||
QHash<Utils::Id, QAction *> m_actions;
|
||||
QHash<Utils::Id, bool> m_isInfoVisible;
|
||||
QHash<Utils::Id, Utils::InfoBarEntry> m_infoEntries;
|
||||
QHash<Id, QAction *> m_actions;
|
||||
QHash<Id, bool> m_isInfoVisible;
|
||||
QHash<Id, InfoBarEntry> m_infoEntries;
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
|
@@ -25,6 +25,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "utils_global.h"
|
||||
|
||||
#include "hostosinfo.h"
|
||||
#include "namevalueitem.h"
|
||||
|
||||
|
@@ -25,6 +25,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "utils_global.h"
|
||||
|
||||
#include "environmentfwd.h"
|
||||
#include "utils_global.h"
|
||||
|
||||
|
@@ -25,9 +25,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "environmentfwd.h"
|
||||
#include "utils_global.h"
|
||||
|
||||
#include "environmentfwd.h"
|
||||
|
||||
#include <QAbstractTableModel>
|
||||
|
||||
#include <memory>
|
||||
|
@@ -25,19 +25,17 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "environmentfwd.h"
|
||||
#include "namevalueitem.h"
|
||||
#include "optional.h"
|
||||
#include "utils_global.h"
|
||||
|
||||
#include "environmentfwd.h"
|
||||
#include "optional.h"
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QPlainTextEdit;
|
||||
QT_END_NAMESPACE
|
||||
QT_FORWARD_DECLARE_CLASS(QPlainTextEdit)
|
||||
|
||||
namespace Utils {
|
||||
|
||||
|
@@ -32,7 +32,7 @@
|
||||
namespace Utils {
|
||||
|
||||
NameValueValidator::NameValueValidator(QWidget *parent,
|
||||
Utils::NameValueModel *model,
|
||||
NameValueModel *model,
|
||||
QTreeView *view,
|
||||
const QModelIndex &index,
|
||||
const QString &toolTipText)
|
||||
@@ -44,7 +44,7 @@ NameValueValidator::NameValueValidator(QWidget *parent,
|
||||
{
|
||||
m_hideTipTimer.setInterval(2000);
|
||||
m_hideTipTimer.setSingleShot(true);
|
||||
connect(&m_hideTipTimer, &QTimer::timeout, this, []() { Utils::ToolTip::hide(); });
|
||||
connect(&m_hideTipTimer, &QTimer::timeout, this, []() { ToolTip::hide(); });
|
||||
}
|
||||
|
||||
QValidator::State NameValueValidator::validate(QString &in, int &pos) const
|
||||
@@ -53,7 +53,7 @@ QValidator::State NameValueValidator::validate(QString &in, int &pos) const
|
||||
QModelIndex idx = m_model->variableToIndex(in);
|
||||
if (idx.isValid() && idx != m_index)
|
||||
return QValidator::Intermediate;
|
||||
Utils::ToolTip::hide();
|
||||
ToolTip::hide();
|
||||
m_hideTipTimer.stop();
|
||||
return QValidator::Acceptable;
|
||||
}
|
||||
@@ -65,8 +65,8 @@ void NameValueValidator::fixup(QString &input) const
|
||||
if (!m_index.isValid())
|
||||
return;
|
||||
QPoint pos = m_view->mapToGlobal(m_view->visualRect(m_index).topLeft());
|
||||
pos -= Utils::ToolTip::offsetFromPosition();
|
||||
Utils::ToolTip::show(pos, m_toolTipText);
|
||||
pos -= ToolTip::offsetFromPosition();
|
||||
ToolTip::show(pos, m_toolTipText);
|
||||
m_hideTipTimer.start();
|
||||
// do nothing
|
||||
}
|
||||
|
@@ -25,22 +25,26 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "environmentfwd.h"
|
||||
#include "utils_global.h"
|
||||
|
||||
#include <QModelIndex>
|
||||
#include "environmentfwd.h"
|
||||
|
||||
#include <QPersistentModelIndex>
|
||||
#include <QTimer>
|
||||
#include <QValidator>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QModelIndex)
|
||||
|
||||
namespace Utils {
|
||||
|
||||
class NameValueModel;
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT NameValueValidator : public QValidator
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
NameValueValidator(QWidget *parent,
|
||||
Utils::NameValueModel *model,
|
||||
NameValueModel *model,
|
||||
QTreeView *view,
|
||||
const QModelIndex &index,
|
||||
const QString &toolTipText);
|
||||
@@ -51,7 +55,7 @@ public:
|
||||
|
||||
private:
|
||||
const QString m_toolTipText;
|
||||
Utils::NameValueModel *m_model;
|
||||
NameValueModel *m_model;
|
||||
QTreeView *m_view;
|
||||
QPersistentModelIndex m_index;
|
||||
mutable QTimer m_hideTipTimer;
|
||||
|
@@ -26,7 +26,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "utils_global.h"
|
||||
#include "fileutils.h"
|
||||
|
||||
#include "filepath.h"
|
||||
#include "optional.h"
|
||||
#include "outputformat.h"
|
||||
|
||||
|
@@ -31,7 +31,7 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QJSEngine);
|
||||
QT_FORWARD_DECLARE_CLASS(QJSEngine)
|
||||
|
||||
namespace Utils {
|
||||
|
||||
|
Reference in New Issue
Block a user