forked from qt-creator/qt-creator
Utils: Fix compilation with namespaced Qt
Change-Id: I5e9ce4a637672fece8884d88c87fc8aaee7d9cc3 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -12,10 +12,10 @@ class QSpinBox;
|
|||||||
class QDoubleSpinBox;
|
class QDoubleSpinBox;
|
||||||
class QGraphicsView;
|
class QGraphicsView;
|
||||||
class QVariant;
|
class QVariant;
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
class EasingGraph;
|
class EasingGraph;
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace QmlJS { class PropertyReader; }
|
namespace QmlJS { class PropertyReader; }
|
||||||
|
|
||||||
namespace QmlEditorWidgets {
|
namespace QmlEditorWidgets {
|
||||||
|
|||||||
@@ -20,9 +20,11 @@
|
|||||||
#include <QtCore/qstring.h>
|
#include <QtCore/qstring.h>
|
||||||
#include <QtCore/qstack.h>
|
#include <QtCore/qstack.h>
|
||||||
|
|
||||||
QT_QML_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QDebug;
|
class QDebug;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
QT_QML_BEGIN_NAMESPACE
|
||||||
|
|
||||||
namespace QmlJS {
|
namespace QmlJS {
|
||||||
|
|
||||||
|
|||||||
@@ -516,9 +516,6 @@ void MimeType::setPreferredSuffix(const QString &suffix)
|
|||||||
d->globPatterns.prepend(QLatin1String("*.") + suffix);
|
d->globPatterns.prepend(QLatin1String("*.") + suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Utils
|
|
||||||
|
|
||||||
#ifndef QT_NO_DEBUG_STREAM
|
|
||||||
QDebug operator<<(QDebug debug, const Utils::MimeType &mime)
|
QDebug operator<<(QDebug debug, const Utils::MimeType &mime)
|
||||||
{
|
{
|
||||||
QDebugStateSaver saver(debug);
|
QDebugStateSaver saver(debug);
|
||||||
@@ -529,6 +526,8 @@ QDebug operator<<(QDebug debug, const Utils::MimeType &mime)
|
|||||||
}
|
}
|
||||||
return debug;
|
return debug;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
} // namespace Utils
|
||||||
|
|
||||||
|
|
||||||
#include "moc_mimetype.cpp"
|
#include "moc_mimetype.cpp"
|
||||||
|
|||||||
@@ -11,13 +11,15 @@
|
|||||||
#include <QtCore/qstring.h>
|
#include <QtCore/qstring.h>
|
||||||
#include <QtCore/qstringlist.h>
|
#include <QtCore/qstringlist.h>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
class QDebug;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
class MimeTypePrivate;
|
class MimeTypePrivate;
|
||||||
class MimeType;
|
class MimeType;
|
||||||
|
|
||||||
QTCREATOR_UTILS_EXPORT size_t qHash(const MimeType &key, size_t seed = 0) noexcept;
|
|
||||||
|
|
||||||
class QTCREATOR_UTILS_EXPORT MimeType
|
class QTCREATOR_UTILS_EXPORT MimeType
|
||||||
{
|
{
|
||||||
Q_GADGET
|
Q_GADGET
|
||||||
@@ -89,18 +91,13 @@ protected:
|
|||||||
friend class MimeBinaryProvider;
|
friend class MimeBinaryProvider;
|
||||||
friend class MimeTypePrivate;
|
friend class MimeTypePrivate;
|
||||||
friend QTCREATOR_UTILS_EXPORT size_t qHash(const MimeType &key, size_t seed) noexcept;
|
friend QTCREATOR_UTILS_EXPORT size_t qHash(const MimeType &key, size_t seed) noexcept;
|
||||||
|
friend QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug debug, const MimeType &mime);
|
||||||
|
|
||||||
QExplicitlySharedDataPointer<MimeTypePrivate> d;
|
QExplicitlySharedDataPointer<MimeTypePrivate> d;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} // namespace Utils
|
} // namespace Utils
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
#ifndef QT_NO_DEBUG_STREAM
|
|
||||||
class QDebug;
|
|
||||||
QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug debug, const Utils::MimeType &mime);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Q_DECLARE_SHARED(Utils::MimeType)
|
Q_DECLARE_SHARED(Utils::MimeType)
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|||||||
@@ -5,7 +5,9 @@
|
|||||||
|
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
class QStyleOptionMenuItem;
|
class QStyleOptionMenuItem;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,10 @@
|
|||||||
#include <QWidgetAction>
|
#include <QWidgetAction>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
class QWidgetAction;
|
class QWidgetAction;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
using SelectionContextOperation = std::function<void(const SelectionContext &)>;
|
using SelectionContextOperation = std::function<void(const SelectionContext &)>;
|
||||||
|
|||||||
@@ -7,8 +7,10 @@
|
|||||||
#include <QKeySequence>
|
#include <QKeySequence>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
class QKeyEvent;
|
class QKeyEvent;
|
||||||
class QObject;
|
class QObject;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Terminal::Internal {
|
namespace Terminal::Internal {
|
||||||
|
|
||||||
|
|||||||
@@ -45,12 +45,11 @@ public:
|
|||||||
int exitCode = 0;
|
int exitCode = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
QMAKE_EXPORT std::function<void(ProcessData *data)> &theProcessRunner();
|
QMAKE_EXPORT std::function<void(ProcessData *data)> &theProcessRunner();
|
||||||
QMAKE_EXPORT QString removeHostAndScheme(const QString &remotePath);
|
QMAKE_EXPORT QString removeHostAndScheme(const QString &remotePath);
|
||||||
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
class QMakeGlobals;
|
class QMakeGlobals;
|
||||||
|
|
||||||
class QMAKE_EXPORT QMakeHandler : public QMakeParserHandler
|
class QMAKE_EXPORT QMakeHandler : public QMakeParserHandler
|
||||||
|
|||||||
@@ -9,15 +9,17 @@
|
|||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/link.h>
|
#include <utils/link.h>
|
||||||
|
|
||||||
using namespace Utils;
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
namespace QTest {
|
namespace QTest {
|
||||||
template<>
|
template<>
|
||||||
char *toString(const FilePath &filePath)
|
char *toString(const Utils::FilePath &filePath)
|
||||||
{
|
{
|
||||||
return qstrdup(filePath.toString().toLocal8Bit().constData());
|
return qstrdup(filePath.toString().toLocal8Bit().constData());
|
||||||
}
|
}
|
||||||
} // namespace QTest
|
} // namespace QTest
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
namespace Utils {
|
||||||
|
|
||||||
class tst_filepath : public QObject
|
class tst_filepath : public QObject
|
||||||
{
|
{
|
||||||
@@ -737,7 +739,12 @@ public:
|
|||||||
ExpectedPass expectedPass = PassEverywhere;
|
ExpectedPass expectedPass = PassEverywhere;
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(FromStringData);
|
} // Utils
|
||||||
|
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(Utils::FromStringData);
|
||||||
|
|
||||||
|
namespace Utils {
|
||||||
|
|
||||||
void tst_filepath::fromString_data()
|
void tst_filepath::fromString_data()
|
||||||
{
|
{
|
||||||
@@ -1683,6 +1690,8 @@ void tst_filepath::sort_data()
|
|||||||
<< QStringList{"b://b//b", "a://b//b", "a://a//b", "a://b//a", "a://a//a"};
|
<< QStringList{"b://b//b", "a://b//b", "a://a//b", "a://b//a", "a://a//a"};
|
||||||
}
|
}
|
||||||
|
|
||||||
QTEST_GUILESS_MAIN(tst_filepath)
|
} // Utils
|
||||||
|
|
||||||
|
QTEST_GUILESS_MAIN(Utils::tst_filepath)
|
||||||
|
|
||||||
#include "tst_filepath.moc"
|
#include "tst_filepath.moc"
|
||||||
|
|||||||
@@ -7,15 +7,33 @@
|
|||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
|
|
||||||
//TESTED_COMPONENT=src/libs/utils
|
//TESTED_COMPONENT=src/libs/utils
|
||||||
using namespace Utils;
|
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
namespace QTest {
|
namespace QTest {
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
char *toString(const FilePath &filePath)
|
char *toString(const Utils::FilePath &filePath)
|
||||||
{
|
{
|
||||||
return qstrdup(filePath.toString().toLocal8Bit().constData());
|
return qstrdup(filePath.toString().toLocal8Bit().constData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
char *toString(const Utils::FilePathInfo &filePathInfo)
|
||||||
|
{
|
||||||
|
QByteArray ba = "FilePathInfo(";
|
||||||
|
ba += QByteArray::number(filePathInfo.fileSize);
|
||||||
|
ba += ", ";
|
||||||
|
ba += QByteArray::number(filePathInfo.fileFlags, 16);
|
||||||
|
ba += ", ";
|
||||||
|
ba += filePathInfo.lastModified.toString().toUtf8();
|
||||||
|
ba += ")";
|
||||||
|
return qstrdup(ba.constData());
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace QTest
|
} // namespace QTest
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
using namespace Utils;
|
||||||
|
|
||||||
class tst_fileutils : public QObject
|
class tst_fileutils : public QObject
|
||||||
{
|
{
|
||||||
@@ -183,23 +201,6 @@ void tst_fileutils::filePathInfoFromTriple()
|
|||||||
QCOMPARE(result, expected);
|
QCOMPARE(result, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
namespace QTest {
|
|
||||||
template<>
|
|
||||||
char *toString(const FilePathInfo &filePathInfo)
|
|
||||||
{
|
|
||||||
QByteArray ba = "FilePathInfo(";
|
|
||||||
ba += QByteArray::number(filePathInfo.fileSize);
|
|
||||||
ba += ", ";
|
|
||||||
ba += QByteArray::number(filePathInfo.fileFlags, 16);
|
|
||||||
ba += ", ";
|
|
||||||
ba += filePathInfo.lastModified.toString().toUtf8();
|
|
||||||
ba += ")";
|
|
||||||
return qstrdup(ba.constData());
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace QTest
|
|
||||||
|
|
||||||
QTEST_GUILESS_MAIN(tst_fileutils)
|
QTEST_GUILESS_MAIN(tst_fileutils)
|
||||||
|
|
||||||
#include "tst_fileutils.moc"
|
#include "tst_fileutils.moc"
|
||||||
|
|||||||
@@ -12,15 +12,18 @@
|
|||||||
#include <utils/link.h>
|
#include <utils/link.h>
|
||||||
|
|
||||||
//TESTED_COMPONENT=src/libs/utils
|
//TESTED_COMPONENT=src/libs/utils
|
||||||
using namespace Utils;
|
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
namespace QTest {
|
namespace QTest {
|
||||||
template<>
|
template<>
|
||||||
char *toString(const FilePath &filePath)
|
char *toString(const Utils::FilePath &filePath)
|
||||||
{
|
{
|
||||||
return qstrdup(filePath.toString().toLocal8Bit().constData());
|
return qstrdup(filePath.toString().toLocal8Bit().constData());
|
||||||
}
|
}
|
||||||
} // namespace QTest
|
} // namespace QTest
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
using namespace Utils;
|
||||||
|
|
||||||
class TestDFA : public UnixDeviceFileAccess
|
class TestDFA : public UnixDeviceFileAccess
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user