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 QGraphicsView;
|
||||
class QVariant;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class EasingGraph;
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace QmlJS { class PropertyReader; }
|
||||
|
||||
namespace QmlEditorWidgets {
|
||||
|
||||
@@ -20,9 +20,11 @@
|
||||
#include <QtCore/qstring.h>
|
||||
#include <QtCore/qstack.h>
|
||||
|
||||
QT_QML_BEGIN_NAMESPACE
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QDebug;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
QT_QML_BEGIN_NAMESPACE
|
||||
|
||||
namespace QmlJS {
|
||||
|
||||
|
||||
@@ -516,9 +516,6 @@ void MimeType::setPreferredSuffix(const QString &suffix)
|
||||
d->globPatterns.prepend(QLatin1String("*.") + suffix);
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
QDebug operator<<(QDebug debug, const Utils::MimeType &mime)
|
||||
{
|
||||
QDebugStateSaver saver(debug);
|
||||
@@ -529,6 +526,8 @@ QDebug operator<<(QDebug debug, const Utils::MimeType &mime)
|
||||
}
|
||||
return debug;
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace Utils
|
||||
|
||||
|
||||
#include "moc_mimetype.cpp"
|
||||
|
||||
@@ -11,13 +11,15 @@
|
||||
#include <QtCore/qstring.h>
|
||||
#include <QtCore/qstringlist.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QDebug;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils {
|
||||
|
||||
class MimeTypePrivate;
|
||||
class MimeType;
|
||||
|
||||
QTCREATOR_UTILS_EXPORT size_t qHash(const MimeType &key, size_t seed = 0) noexcept;
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT MimeType
|
||||
{
|
||||
Q_GADGET
|
||||
@@ -89,18 +91,13 @@ protected:
|
||||
friend class MimeBinaryProvider;
|
||||
friend class MimeTypePrivate;
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
} // namespace Utils
|
||||
|
||||
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)
|
||||
QT_END_NAMESPACE
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
|
||||
#include <QMenu>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QStyleOptionMenuItem;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
#include <QWidgetAction>
|
||||
#include <QIcon>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QWidgetAction;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
using SelectionContextOperation = std::function<void(const SelectionContext &)>;
|
||||
|
||||
@@ -7,8 +7,10 @@
|
||||
#include <QKeySequence>
|
||||
#include <QObject>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QKeyEvent;
|
||||
class QObject;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Terminal::Internal {
|
||||
|
||||
|
||||
@@ -45,12 +45,11 @@ public:
|
||||
int exitCode = 0;
|
||||
};
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QMAKE_EXPORT std::function<void(ProcessData *data)> &theProcessRunner();
|
||||
QMAKE_EXPORT QString removeHostAndScheme(const QString &remotePath);
|
||||
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QMakeGlobals;
|
||||
|
||||
class QMAKE_EXPORT QMakeHandler : public QMakeParserHandler
|
||||
|
||||
@@ -9,15 +9,17 @@
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/link.h>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace QTest {
|
||||
template<>
|
||||
char *toString(const FilePath &filePath)
|
||||
char *toString(const Utils::FilePath &filePath)
|
||||
{
|
||||
return qstrdup(filePath.toString().toLocal8Bit().constData());
|
||||
}
|
||||
} // namespace QTest
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils {
|
||||
|
||||
class tst_filepath : public QObject
|
||||
{
|
||||
@@ -737,7 +739,12 @@ public:
|
||||
ExpectedPass expectedPass = PassEverywhere;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(FromStringData);
|
||||
} // Utils
|
||||
|
||||
|
||||
Q_DECLARE_METATYPE(Utils::FromStringData);
|
||||
|
||||
namespace Utils {
|
||||
|
||||
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"};
|
||||
}
|
||||
|
||||
QTEST_GUILESS_MAIN(tst_filepath)
|
||||
} // Utils
|
||||
|
||||
QTEST_GUILESS_MAIN(Utils::tst_filepath)
|
||||
|
||||
#include "tst_filepath.moc"
|
||||
|
||||
@@ -7,15 +7,33 @@
|
||||
#include <utils/hostosinfo.h>
|
||||
|
||||
//TESTED_COMPONENT=src/libs/utils
|
||||
using namespace Utils;
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace QTest {
|
||||
|
||||
template<>
|
||||
char *toString(const FilePath &filePath)
|
||||
char *toString(const Utils::FilePath &filePath)
|
||||
{
|
||||
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
|
||||
QT_END_NAMESPACE
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
class tst_fileutils : public QObject
|
||||
{
|
||||
@@ -183,23 +201,6 @@ void tst_fileutils::filePathInfoFromTriple()
|
||||
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)
|
||||
|
||||
#include "tst_fileutils.moc"
|
||||
|
||||
@@ -12,15 +12,18 @@
|
||||
#include <utils/link.h>
|
||||
|
||||
//TESTED_COMPONENT=src/libs/utils
|
||||
using namespace Utils;
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace QTest {
|
||||
template<>
|
||||
char *toString(const FilePath &filePath)
|
||||
char *toString(const Utils::FilePath &filePath)
|
||||
{
|
||||
return qstrdup(filePath.toString().toLocal8Bit().constData());
|
||||
}
|
||||
} // namespace QTest
|
||||
QT_END_NAMESPACE
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
class TestDFA : public UnixDeviceFileAccess
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user