forked from qt-creator/qt-creator
Namespace clean-ups.
This commit is contained in:
@@ -42,7 +42,7 @@
|
|||||||
using namespace QmlEditor;
|
using namespace QmlEditor;
|
||||||
using namespace QmlEditor::Internal;
|
using namespace QmlEditor::Internal;
|
||||||
|
|
||||||
QmlCodeCompletion::QmlCodeCompletion(QmlModelManagerInterface *modelManager, Qml::MetaType::QmlTypeSystem *typeSystem, QObject *parent)
|
QmlCodeCompletion::QmlCodeCompletion(QmlModelManagerInterface *modelManager, Qml::QmlTypeSystem *typeSystem, QObject *parent)
|
||||||
: TextEditor::ICompletionCollector(parent),
|
: TextEditor::ICompletionCollector(parent),
|
||||||
m_modelManager(modelManager),
|
m_modelManager(modelManager),
|
||||||
m_editor(0),
|
m_editor(0),
|
||||||
|
@@ -19,7 +19,7 @@ class QmlCodeCompletion: public TextEditor::ICompletionCollector
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QmlCodeCompletion(QmlModelManagerInterface *modelManager, Qml::MetaType::QmlTypeSystem *typeSystem, QObject *parent = 0);
|
QmlCodeCompletion(QmlModelManagerInterface *modelManager, Qml::QmlTypeSystem *typeSystem, QObject *parent = 0);
|
||||||
virtual ~QmlCodeCompletion();
|
virtual ~QmlCodeCompletion();
|
||||||
|
|
||||||
Qt::CaseSensitivity caseSensitivity() const;
|
Qt::CaseSensitivity caseSensitivity() const;
|
||||||
@@ -39,7 +39,7 @@ private:
|
|||||||
int m_startPosition;
|
int m_startPosition;
|
||||||
QList<TextEditor::CompletionItem> m_completions;
|
QList<TextEditor::CompletionItem> m_completions;
|
||||||
Qt::CaseSensitivity m_caseSensitivity;
|
Qt::CaseSensitivity m_caseSensitivity;
|
||||||
Qml::MetaType::QmlTypeSystem *m_typeSystem;
|
Qml::QmlTypeSystem *m_typeSystem;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -400,7 +400,7 @@ ScriptEditor::ScriptEditor(QWidget *parent) :
|
|||||||
baseTextDocument()->setSyntaxHighlighter(new QmlHighlighter);
|
baseTextDocument()->setSyntaxHighlighter(new QmlHighlighter);
|
||||||
|
|
||||||
m_modelManager = ExtensionSystem::PluginManager::instance()->getObject<QmlModelManagerInterface>();
|
m_modelManager = ExtensionSystem::PluginManager::instance()->getObject<QmlModelManagerInterface>();
|
||||||
m_typeSystem = ExtensionSystem::PluginManager::instance()->getObject<Qml::MetaType::QmlTypeSystem>();
|
m_typeSystem = ExtensionSystem::PluginManager::instance()->getObject<Qml::QmlTypeSystem>();
|
||||||
|
|
||||||
if (m_modelManager) {
|
if (m_modelManager) {
|
||||||
connect(m_modelManager, SIGNAL(documentUpdated(QmlEditor::QmlDocument::Ptr)),
|
connect(m_modelManager, SIGNAL(documentUpdated(QmlEditor::QmlDocument::Ptr)),
|
||||||
|
@@ -44,9 +44,7 @@ class ICore;
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace Qml {
|
namespace Qml {
|
||||||
namespace MetaType {
|
class QmlTypeSystem;
|
||||||
class QmlTypeSystem;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace QmlEditor {
|
namespace QmlEditor {
|
||||||
@@ -152,7 +150,7 @@ private:
|
|||||||
QList<QmlJS::DiagnosticMessage> m_diagnosticMessages;
|
QList<QmlJS::DiagnosticMessage> m_diagnosticMessages;
|
||||||
QmlDocument::Ptr m_document;
|
QmlDocument::Ptr m_document;
|
||||||
QmlModelManagerInterface *m_modelManager;
|
QmlModelManagerInterface *m_modelManager;
|
||||||
Qml::MetaType::QmlTypeSystem *m_typeSystem;
|
Qml::QmlTypeSystem *m_typeSystem;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -86,15 +86,13 @@ QmlEditorPlugin::~QmlEditorPlugin()
|
|||||||
|
|
||||||
bool QmlEditorPlugin::initialize(const QStringList & /*arguments*/, QString *error_message)
|
bool QmlEditorPlugin::initialize(const QStringList & /*arguments*/, QString *error_message)
|
||||||
{
|
{
|
||||||
typedef SharedTools::QScriptHighlighter QScriptHighlighter;
|
|
||||||
|
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::ICore *core = Core::ICore::instance();
|
||||||
if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":/qmleditor/QmlEditor.mimetypes.xml"), error_message))
|
if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":/qmleditor/QmlEditor.mimetypes.xml"), error_message))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_modelManager = new QmlModelManager(this);
|
m_modelManager = new QmlModelManager(this);
|
||||||
addAutoReleasedObject(m_modelManager);
|
addAutoReleasedObject(m_modelManager);
|
||||||
Qml::MetaType::QmlTypeSystem *typeSystem = new Qml::MetaType::QmlTypeSystem;
|
Qml::QmlTypeSystem *typeSystem = new Qml::QmlTypeSystem;
|
||||||
addAutoReleasedObject(typeSystem);
|
addAutoReleasedObject(typeSystem);
|
||||||
|
|
||||||
QList<int> context;
|
QList<int> context;
|
||||||
|
@@ -187,7 +187,7 @@ void QmlHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
|
|||||||
QmlExpressionUnderCursor expressionUnderCursor;
|
QmlExpressionUnderCursor expressionUnderCursor;
|
||||||
expressionUnderCursor(tc, doc);
|
expressionUnderCursor(tc, doc);
|
||||||
|
|
||||||
Qml::MetaType::QmlTypeSystem *typeSystem = ExtensionSystem::PluginManager::instance()->getObject<Qml::MetaType::QmlTypeSystem>();
|
Qml::QmlTypeSystem *typeSystem = ExtensionSystem::PluginManager::instance()->getObject<Qml::QmlTypeSystem>();
|
||||||
|
|
||||||
QmlLookupContext context(expressionUnderCursor.expressionScopes(), doc, m_modelManager->snapshot(), typeSystem);
|
QmlLookupContext context(expressionUnderCursor.expressionScopes(), doc, m_modelManager->snapshot(), typeSystem);
|
||||||
QmlResolveExpression resolver(context);
|
QmlResolveExpression resolver(context);
|
||||||
|
@@ -9,7 +9,6 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
using namespace Qml;
|
using namespace Qml;
|
||||||
using namespace Qml::MetaType;
|
|
||||||
using namespace QmlEditor;
|
using namespace QmlEditor;
|
||||||
using namespace QmlEditor::Internal;
|
using namespace QmlEditor::Internal;
|
||||||
using namespace QmlJS;
|
using namespace QmlJS;
|
||||||
|
@@ -17,7 +17,7 @@ public:
|
|||||||
QmlLookupContext(const QStack<Qml::QmlSymbol *> &scopes,
|
QmlLookupContext(const QStack<Qml::QmlSymbol *> &scopes,
|
||||||
const QmlDocument::Ptr &doc,
|
const QmlDocument::Ptr &doc,
|
||||||
const Snapshot &snapshot,
|
const Snapshot &snapshot,
|
||||||
Qml::MetaType::QmlTypeSystem *typeSystem);
|
Qml::QmlTypeSystem *typeSystem);
|
||||||
|
|
||||||
Qml::QmlSymbol *resolve(const QString &name);
|
Qml::QmlSymbol *resolve(const QString &name);
|
||||||
Qml::QmlSymbol *resolveType(const QString &name)
|
Qml::QmlSymbol *resolveType(const QString &name)
|
||||||
@@ -44,7 +44,7 @@ private:
|
|||||||
QStack<Qml::QmlSymbol *> _scopes;
|
QStack<Qml::QmlSymbol *> _scopes;
|
||||||
QmlDocument::Ptr _doc;
|
QmlDocument::Ptr _doc;
|
||||||
Snapshot _snapshot;
|
Snapshot _snapshot;
|
||||||
Qml::MetaType::QmlTypeSystem *m_typeSystem;
|
Qml::QmlTypeSystem *m_typeSystem;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#include "QmlMetaTypeBackend.h"
|
#include "QmlMetaTypeBackend.h"
|
||||||
#include "qmltypesystem.h"
|
#include "qmltypesystem.h"
|
||||||
|
|
||||||
using namespace Qml::MetaType;
|
using namespace Qml;
|
||||||
|
|
||||||
QmlMetaTypeBackend::QmlMetaTypeBackend(QmlTypeSystem *typeSystem):
|
QmlMetaTypeBackend::QmlMetaTypeBackend(QmlTypeSystem *typeSystem):
|
||||||
m_typeSystem(typeSystem)
|
m_typeSystem(typeSystem)
|
||||||
|
@@ -6,7 +6,6 @@
|
|||||||
#include <qml/qmlsymbol.h>
|
#include <qml/qmlsymbol.h>
|
||||||
|
|
||||||
namespace Qml {
|
namespace Qml {
|
||||||
namespace MetaType {
|
|
||||||
|
|
||||||
class QmlTypeSystem;
|
class QmlTypeSystem;
|
||||||
|
|
||||||
@@ -27,7 +26,6 @@ private:
|
|||||||
QmlTypeSystem *m_typeSystem;
|
QmlTypeSystem *m_typeSystem;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace MetaType
|
|
||||||
} // namespace Qml
|
} // namespace Qml
|
||||||
|
|
||||||
#endif // QMLMETATYPEBACKEND_H
|
#endif // QMLMETATYPEBACKEND_H
|
||||||
|
@@ -4,7 +4,6 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
namespace Qml {
|
namespace Qml {
|
||||||
namespace MetaType {
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QmlDeclarativeSymbol: public QmlBuildInSymbol
|
class QmlDeclarativeSymbol: public QmlBuildInSymbol
|
||||||
@@ -31,7 +30,7 @@ class QmlDeclarativeObjectSymbol: public QmlDeclarativeSymbol
|
|||||||
QmlDeclarativeObjectSymbol &operator=(const QmlDeclarativeObjectSymbol &);
|
QmlDeclarativeObjectSymbol &operator=(const QmlDeclarativeObjectSymbol &);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QmlDeclarativeObjectSymbol(const QKineticDesigner::NodeMetaInfo &metaInfo, QtDeclarativeMetaTypeBackend* backend):
|
QmlDeclarativeObjectSymbol(const NodeMetaInfo &metaInfo, QtDeclarativeMetaTypeBackend* backend):
|
||||||
QmlDeclarativeSymbol(backend),
|
QmlDeclarativeSymbol(backend),
|
||||||
m_metaInfo(metaInfo)
|
m_metaInfo(metaInfo)
|
||||||
{
|
{
|
||||||
@@ -71,7 +70,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static QString key(const QKineticDesigner::NodeMetaInfo &metaInfo)
|
static QString key(const NodeMetaInfo &metaInfo)
|
||||||
{
|
{
|
||||||
return key(metaInfo.typeName(), metaInfo.majorVersion(), metaInfo.minorVersion());
|
return key(metaInfo.typeName(), metaInfo.majorVersion(), metaInfo.minorVersion());
|
||||||
}
|
}
|
||||||
@@ -107,7 +106,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QKineticDesigner::NodeMetaInfo m_metaInfo;
|
NodeMetaInfo m_metaInfo;
|
||||||
QString m_name;
|
QString m_name;
|
||||||
|
|
||||||
bool m_membersToBeDone;
|
bool m_membersToBeDone;
|
||||||
@@ -120,7 +119,7 @@ class QmlDeclarativePropertySymbol: public QmlDeclarativeSymbol
|
|||||||
QmlDeclarativePropertySymbol &operator=(const QmlDeclarativePropertySymbol &);
|
QmlDeclarativePropertySymbol &operator=(const QmlDeclarativePropertySymbol &);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QmlDeclarativePropertySymbol(const QKineticDesigner::PropertyMetaInfo &metaInfo, QtDeclarativeMetaTypeBackend* backend):
|
QmlDeclarativePropertySymbol(const PropertyMetaInfo &metaInfo, QtDeclarativeMetaTypeBackend* backend):
|
||||||
QmlDeclarativeSymbol(backend),
|
QmlDeclarativeSymbol(backend),
|
||||||
m_metaInfo(metaInfo)
|
m_metaInfo(metaInfo)
|
||||||
{
|
{
|
||||||
@@ -146,21 +145,19 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QKineticDesigner::PropertyMetaInfo m_metaInfo;
|
PropertyMetaInfo m_metaInfo;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace MetaType
|
|
||||||
} // namespace Qml
|
} // namespace Qml
|
||||||
|
|
||||||
using namespace Qml;
|
using namespace Qml;
|
||||||
using namespace Qml::MetaType;
|
using namespace Qml::Internal;
|
||||||
using namespace Qml::MetaType::Internal;
|
|
||||||
|
|
||||||
QtDeclarativeMetaTypeBackend::QtDeclarativeMetaTypeBackend(QmlTypeSystem *typeSystem):
|
QtDeclarativeMetaTypeBackend::QtDeclarativeMetaTypeBackend(QmlTypeSystem *typeSystem):
|
||||||
QmlMetaTypeBackend(typeSystem)
|
QmlMetaTypeBackend(typeSystem)
|
||||||
{
|
{
|
||||||
foreach (const QKineticDesigner::NodeMetaInfo &metaInfo, QKineticDesigner::MetaInfo::global().allTypes()) {
|
foreach (const NodeMetaInfo &metaInfo, MetaInfo::global().allTypes()) {
|
||||||
m_symbols.insert(QmlDeclarativeObjectSymbol::key(metaInfo), new QmlDeclarativeObjectSymbol(metaInfo, this));
|
m_symbols.insert(QmlDeclarativeObjectSymbol::key(metaInfo), new QmlDeclarativeObjectSymbol(metaInfo, this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -175,7 +172,7 @@ QList<QmlSymbol *> QtDeclarativeMetaTypeBackend::availableTypes(const QString &p
|
|||||||
QList<QmlSymbol *> result;
|
QList<QmlSymbol *> result;
|
||||||
const QString prefix = package + QLatin1Char('/');
|
const QString prefix = package + QLatin1Char('/');
|
||||||
|
|
||||||
foreach (const QKineticDesigner::NodeMetaInfo &metaInfo, QKineticDesigner::MetaInfo::global().allTypes()) {
|
foreach (const NodeMetaInfo &metaInfo, MetaInfo::global().allTypes()) {
|
||||||
if (metaInfo.typeName().startsWith(prefix) && metaInfo.majorVersion() == majorVersion && metaInfo.minorVersion() == minorVersion)
|
if (metaInfo.typeName().startsWith(prefix) && metaInfo.majorVersion() == majorVersion && metaInfo.minorVersion() == minorVersion)
|
||||||
result.append(getSymbol(metaInfo));
|
result.append(getSymbol(metaInfo));
|
||||||
}
|
}
|
||||||
@@ -195,36 +192,36 @@ QmlSymbol *QtDeclarativeMetaTypeBackend::resolve(const QString &typeName, const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QmlSymbol *> QtDeclarativeMetaTypeBackend::members(const QKineticDesigner::NodeMetaInfo &metaInfo)
|
QList<QmlSymbol *> QtDeclarativeMetaTypeBackend::members(const NodeMetaInfo &metaInfo)
|
||||||
{
|
{
|
||||||
QList<QmlSymbol *> result;
|
QList<QmlSymbol *> result;
|
||||||
|
|
||||||
foreach (const QKineticDesigner::PropertyMetaInfo &propertyInfo, metaInfo.properties(false).values()) {
|
foreach (const PropertyMetaInfo &propertyInfo, metaInfo.properties(false).values()) {
|
||||||
result.append(new QmlDeclarativePropertySymbol(propertyInfo, this));
|
result.append(new QmlDeclarativePropertySymbol(propertyInfo, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QmlSymbol *> QtDeclarativeMetaTypeBackend::inheritedMembers(const QKineticDesigner::NodeMetaInfo &metaInfo)
|
QList<QmlSymbol *> QtDeclarativeMetaTypeBackend::inheritedMembers(const NodeMetaInfo &metaInfo)
|
||||||
{
|
{
|
||||||
QList<QmlSymbol *> result;
|
QList<QmlSymbol *> result;
|
||||||
|
|
||||||
foreach (const QKineticDesigner::NodeMetaInfo &superNode, metaInfo.directSuperClasses()) {
|
foreach (const NodeMetaInfo &superNode, metaInfo.directSuperClasses()) {
|
||||||
result.append(getSymbol(superNode)->members(true));
|
result.append(getSymbol(superNode)->members(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QmlDeclarativeSymbol *QtDeclarativeMetaTypeBackend::typeOf(const QKineticDesigner::PropertyMetaInfo &metaInfo)
|
QmlDeclarativeSymbol *QtDeclarativeMetaTypeBackend::typeOf(const PropertyMetaInfo &metaInfo)
|
||||||
{
|
{
|
||||||
const QString key = QmlDeclarativeObjectSymbol::key(metaInfo.type(), metaInfo.typeMajorVersion(), metaInfo.typeMinorVersion());
|
const QString key = QmlDeclarativeObjectSymbol::key(metaInfo.type(), metaInfo.typeMajorVersion(), metaInfo.typeMinorVersion());
|
||||||
|
|
||||||
return m_symbols.value(key, 0);
|
return m_symbols.value(key, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
QmlDeclarativeSymbol *QtDeclarativeMetaTypeBackend::getSymbol(const QKineticDesigner::NodeMetaInfo &metaInfo)
|
QmlDeclarativeSymbol *QtDeclarativeMetaTypeBackend::getSymbol(const NodeMetaInfo &metaInfo)
|
||||||
{
|
{
|
||||||
const QString key = QmlDeclarativeObjectSymbol::key(metaInfo);
|
const QString key = QmlDeclarativeObjectSymbol::key(metaInfo);
|
||||||
|
|
||||||
|
@@ -8,7 +8,6 @@
|
|||||||
#include <QtCore/QList>
|
#include <QtCore/QList>
|
||||||
|
|
||||||
namespace Qml {
|
namespace Qml {
|
||||||
namespace MetaType {
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QmlDeclarativeSymbol;
|
class QmlDeclarativeSymbol;
|
||||||
@@ -29,19 +28,18 @@ public:
|
|||||||
virtual QmlSymbol *resolve(const QString &typeName, const QList<PackageInfo> &packages);
|
virtual QmlSymbol *resolve(const QString &typeName, const QList<PackageInfo> &packages);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QList<QmlSymbol *> members(const QKineticDesigner::NodeMetaInfo &metaInfo);
|
QList<QmlSymbol *> members(const Qml::NodeMetaInfo &metaInfo);
|
||||||
QList<QmlSymbol *> inheritedMembers(const QKineticDesigner::NodeMetaInfo &metaInfo);
|
QList<QmlSymbol *> inheritedMembers(const Qml::NodeMetaInfo &metaInfo);
|
||||||
QmlDeclarativeSymbol *typeOf(const QKineticDesigner::PropertyMetaInfo &metaInfo);
|
QmlDeclarativeSymbol *typeOf(const Qml::PropertyMetaInfo &metaInfo);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QmlDeclarativeSymbol *getSymbol(const QKineticDesigner::NodeMetaInfo &metaInfo);
|
QmlDeclarativeSymbol *getSymbol(const Qml::NodeMetaInfo &metaInfo);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QMap<QString, QmlDeclarativeSymbol*> m_symbols;
|
QMap<QString, QmlDeclarativeSymbol*> m_symbols;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace MetaType
|
|
||||||
} // namespace Qml
|
} // namespace Qml
|
||||||
|
|
||||||
#endif // QTDECLARATIVEMETATYPEBACKEND_H
|
#endif // QTDECLARATIVEMETATYPEBACKEND_H
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
#include <cxxabi.h>
|
#include <cxxabi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
#include <QRegExp>
|
#include <QRegExp>
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -18,8 +19,7 @@
|
|||||||
the result would be a inconsistent model or a crash.
|
the result would be a inconsistent model or a crash.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
using namespace Qml;
|
||||||
namespace QKineticDesigner {
|
|
||||||
|
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
const char* demangle(const char* name)
|
const char* demangle(const char* name)
|
||||||
@@ -160,4 +160,3 @@ QDebug operator<<(QDebug debug, const Exception &exception)
|
|||||||
|
|
||||||
\returns the type as a string
|
\returns the type as a string
|
||||||
*/
|
*/
|
||||||
}
|
|
||||||
|
@@ -4,9 +4,8 @@
|
|||||||
#include <qml/qml_global.h>
|
#include <qml/qml_global.h>
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QtDebug>
|
|
||||||
|
|
||||||
namespace QKineticDesigner {
|
namespace Qml {
|
||||||
|
|
||||||
class QML_EXPORT Exception
|
class QML_EXPORT Exception
|
||||||
{
|
{
|
||||||
@@ -37,6 +36,6 @@ private:
|
|||||||
|
|
||||||
QML_EXPORT QDebug operator<<(QDebug debug, const Exception &exception);
|
QML_EXPORT QDebug operator<<(QDebug debug, const Exception &exception);
|
||||||
|
|
||||||
}
|
} // namespace Qml
|
||||||
|
|
||||||
#endif // EXCEPTION_H
|
#endif // EXCEPTION_H
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
\see NodeMetaInfo PropertyMetaInfo MetaInfo
|
\see NodeMetaInfo PropertyMetaInfo MetaInfo
|
||||||
*/
|
*/
|
||||||
namespace QKineticDesigner {
|
using namespace Qml;
|
||||||
/*!
|
/*!
|
||||||
\brief Constructor
|
\brief Constructor
|
||||||
|
|
||||||
@@ -31,5 +31,3 @@ QString InvalidMetaInfoException::type() const
|
|||||||
{
|
{
|
||||||
return "InvalidMetaInfoException";
|
return "InvalidMetaInfoException";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "exception.h"
|
#include "exception.h"
|
||||||
|
|
||||||
namespace QKineticDesigner {
|
namespace Qml {
|
||||||
|
|
||||||
class QML_EXPORT InvalidMetaInfoException : public Exception
|
class QML_EXPORT InvalidMetaInfoException : public Exception
|
||||||
{
|
{
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
#include "metainfo.h"
|
#include "metainfo.h"
|
||||||
#include "propertymetainfo.h"
|
#include "propertymetainfo.h"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
#include <QPair>
|
#include <QPair>
|
||||||
#include <QtAlgorithms>
|
#include <QtAlgorithms>
|
||||||
#include <QMetaProperty>
|
#include <QMetaProperty>
|
||||||
@@ -11,7 +12,7 @@ enum {
|
|||||||
debug = false
|
debug = false
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace QKineticDesigner {
|
namespace Qml {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class MetaInfoPrivate
|
class MetaInfoPrivate
|
||||||
@@ -68,8 +69,6 @@ void MetaInfoPrivate::initialize()
|
|||||||
m_isInitialized = true;
|
m_isInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void MetaInfoPrivate::parseProperties(NodeMetaInfo &nodeMetaInfo, const QMetaObject *qMetaObject) const
|
void MetaInfoPrivate::parseProperties(NodeMetaInfo &nodeMetaInfo, const QMetaObject *qMetaObject) const
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(qMetaObject, Q_FUNC_INFO, "invalid QMetaObject");
|
Q_ASSERT_X(qMetaObject, Q_FUNC_INFO, "invalid QMetaObject");
|
||||||
@@ -219,7 +218,7 @@ void MetaInfoPrivate::parseNonQmlTypes()
|
|||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|
||||||
using QKineticDesigner::Internal::MetaInfoPrivate;
|
using Qml::Internal::MetaInfoPrivate;
|
||||||
|
|
||||||
MetaInfo MetaInfo::s_global;
|
MetaInfo MetaInfo::s_global;
|
||||||
QStringList MetaInfo::s_pluginDirs;
|
QStringList MetaInfo::s_pluginDirs;
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QtCore/QSharedPointer>
|
#include <QtCore/QSharedPointer>
|
||||||
|
|
||||||
namespace QKineticDesigner {
|
namespace Qml {
|
||||||
|
|
||||||
class ModelNode;
|
class ModelNode;
|
||||||
class AbstractProperty;
|
class AbstractProperty;
|
||||||
@@ -27,10 +27,10 @@ QML_EXPORT bool operator!=(const MetaInfo &first, const MetaInfo &second);
|
|||||||
|
|
||||||
class QML_EXPORT MetaInfo
|
class QML_EXPORT MetaInfo
|
||||||
{
|
{
|
||||||
friend class QKineticDesigner::Internal::MetaInfoPrivate;
|
friend class Qml::Internal::MetaInfoPrivate;
|
||||||
friend class QKineticDesigner::Internal::MetaInfoParser;
|
friend class Qml::Internal::MetaInfoParser;
|
||||||
friend class QKineticDesigner::NodeMetaInfo;
|
friend class Qml::NodeMetaInfo;
|
||||||
friend bool QKineticDesigner::operator==(const MetaInfo &, const MetaInfo &);
|
friend bool Qml::operator==(const MetaInfo &, const MetaInfo &);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MetaInfo(const MetaInfo &metaInfo);
|
MetaInfo(const MetaInfo &metaInfo);
|
||||||
@@ -78,6 +78,6 @@ private:
|
|||||||
static QStringList s_pluginDirs;
|
static QStringList s_pluginDirs;
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace QKineticDesigner
|
} // namespace Qml
|
||||||
|
|
||||||
#endif // METAINFO_H
|
#endif // METAINFO_H
|
||||||
|
@@ -12,8 +12,7 @@
|
|||||||
#include <QtDeclarative/QmlComponent>
|
#include <QtDeclarative/QmlComponent>
|
||||||
#include <private/qmlvaluetype_p.h>
|
#include <private/qmlvaluetype_p.h>
|
||||||
|
|
||||||
namespace QKineticDesigner {
|
namespace Qml {
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class NodeMetaInfoData : public QSharedData
|
class NodeMetaInfoData : public QSharedData
|
||||||
@@ -668,28 +667,4 @@ void NodeMetaInfo::setQmlFile(const QString &filePath)
|
|||||||
m_data->qmlFile = filePath;
|
m_data->qmlFile = filePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
//QDataStream& operator<<(QDataStream& stream, const NodeMetaInfo& nodeMetaInfo)
|
} // namespace Qml
|
||||||
//{
|
|
||||||
// stream << nodeMetaInfo.typeName();
|
|
||||||
// stream << nodeMetaInfo.majorVersion();
|
|
||||||
// stream << nodeMetaInfo.minorVersionTo();
|
|
||||||
//
|
|
||||||
// return stream;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//QDataStream& operator>>(QDataStream& stream, NodeMetaInfo& nodeMetaInfo)
|
|
||||||
//{
|
|
||||||
// QString typeName;
|
|
||||||
// int minorVersion;
|
|
||||||
// int majorVersion;
|
|
||||||
//
|
|
||||||
// stream >> minorVersion;
|
|
||||||
// stream >> majorVersion;
|
|
||||||
// stream >> typeName;
|
|
||||||
//
|
|
||||||
// nodeMetaInfo = MetaInfo::global().nodeMetaInfo(typeName/*, majorVersion ,minorVersion*/);
|
|
||||||
//
|
|
||||||
// return stream;
|
|
||||||
//}
|
|
||||||
|
|
||||||
} // namespace QKineticDesigner
|
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
class QmlContext;
|
class QmlContext;
|
||||||
|
|
||||||
namespace QKineticDesigner {
|
namespace Qml {
|
||||||
|
|
||||||
class MetaInfo;
|
class MetaInfo;
|
||||||
|
|
||||||
@@ -26,10 +26,10 @@ class PropertyMetaInfo;
|
|||||||
|
|
||||||
class QML_EXPORT NodeMetaInfo
|
class QML_EXPORT NodeMetaInfo
|
||||||
{
|
{
|
||||||
friend class QKineticDesigner::MetaInfo;
|
friend class Qml::MetaInfo;
|
||||||
friend class QKineticDesigner::Internal::ItemLibraryInfoData;
|
friend class Qml::Internal::ItemLibraryInfoData;
|
||||||
friend class QKineticDesigner::Internal::MetaInfoPrivate;
|
friend class Qml::Internal::MetaInfoPrivate;
|
||||||
friend class QKineticDesigner::Internal::MetaInfoParser;
|
friend class Qml::Internal::MetaInfoParser;
|
||||||
friend QML_EXPORT uint qHash(const NodeMetaInfo &nodeMetaInfo);
|
friend QML_EXPORT uint qHash(const NodeMetaInfo &nodeMetaInfo);
|
||||||
friend QML_EXPORT bool operator ==(const NodeMetaInfo &firstNodeInfo, const NodeMetaInfo &secondNodeInfo);
|
friend QML_EXPORT bool operator ==(const NodeMetaInfo &firstNodeInfo, const NodeMetaInfo &secondNodeInfo);
|
||||||
|
|
||||||
@@ -98,6 +98,6 @@ private:
|
|||||||
QML_EXPORT uint qHash(const NodeMetaInfo &nodeMetaInfo);
|
QML_EXPORT uint qHash(const NodeMetaInfo &nodeMetaInfo);
|
||||||
QML_EXPORT bool operator ==(const NodeMetaInfo &firstNodeInfo,
|
QML_EXPORT bool operator ==(const NodeMetaInfo &firstNodeInfo,
|
||||||
const NodeMetaInfo &secondNodeInfo);
|
const NodeMetaInfo &secondNodeInfo);
|
||||||
}
|
} // namespace Qml
|
||||||
|
|
||||||
#endif // NODEMETAINFO_H
|
#endif // NODEMETAINFO_H
|
||||||
|
@@ -6,10 +6,8 @@
|
|||||||
#include "metainfo.h"
|
#include "metainfo.h"
|
||||||
#include <private/qmlvaluetype_p.h>
|
#include <private/qmlvaluetype_p.h>
|
||||||
|
|
||||||
namespace QKineticDesigner {
|
namespace Qml {
|
||||||
|
namespace Internal {
|
||||||
namespace Internal
|
|
||||||
{
|
|
||||||
|
|
||||||
class PropertyMetaInfoData : public QSharedData
|
class PropertyMetaInfoData : public QSharedData
|
||||||
{
|
{
|
||||||
@@ -42,7 +40,7 @@ public:
|
|||||||
QHash<QString, QVariant> defaultValueHash;
|
QHash<QString, QVariant> defaultValueHash;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace Internal
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class QKineticDesigner::PropertyMetaInfo
|
\class QKineticDesigner::PropertyMetaInfo
|
||||||
@@ -375,4 +373,4 @@ QVariant PropertyMetaInfo::castedValue(const QVariant &originalVariant) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace Qml
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
#include <QExplicitlySharedDataPointer>
|
#include <QExplicitlySharedDataPointer>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
namespace QKineticDesigner {
|
namespace Qml {
|
||||||
|
|
||||||
class MetaInfo;
|
class MetaInfo;
|
||||||
class NodeMetaInfo;
|
class NodeMetaInfo;
|
||||||
@@ -22,10 +22,10 @@ class PropertyMetaInfoData;
|
|||||||
|
|
||||||
class QML_EXPORT PropertyMetaInfo
|
class QML_EXPORT PropertyMetaInfo
|
||||||
{
|
{
|
||||||
friend class QKineticDesigner::Internal::MetaInfoPrivate;
|
friend class Qml::Internal::MetaInfoPrivate;
|
||||||
friend class QKineticDesigner::Internal::MetaInfoParser;
|
friend class Qml::Internal::MetaInfoParser;
|
||||||
friend class QKineticDesigner::MetaInfo;
|
friend class Qml::MetaInfo;
|
||||||
friend class QKineticDesigner::NodeMetaInfo;
|
friend class Qml::NodeMetaInfo;
|
||||||
public:
|
public:
|
||||||
PropertyMetaInfo();
|
PropertyMetaInfo();
|
||||||
~PropertyMetaInfo();
|
~PropertyMetaInfo();
|
||||||
@@ -78,7 +78,7 @@ private:
|
|||||||
QExplicitlySharedDataPointer<Internal::PropertyMetaInfoData> m_data;
|
QExplicitlySharedDataPointer<Internal::PropertyMetaInfoData> m_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace Qml
|
||||||
|
|
||||||
|
|
||||||
#endif // PROPERTYMETAINFO_H
|
#endif // PROPERTYMETAINFO_H
|
||||||
|
@@ -8,7 +8,6 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
using namespace Qml;
|
using namespace Qml;
|
||||||
using namespace Qml::MetaType;
|
|
||||||
|
|
||||||
QmlTypeSystem::QmlTypeSystem()
|
QmlTypeSystem::QmlTypeSystem()
|
||||||
{
|
{
|
||||||
|
@@ -9,7 +9,6 @@
|
|||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
|
|
||||||
namespace Qml {
|
namespace Qml {
|
||||||
namespace MetaType {
|
|
||||||
|
|
||||||
class QmlMetaTypeBackend;
|
class QmlMetaTypeBackend;
|
||||||
|
|
||||||
@@ -28,7 +27,6 @@ private:
|
|||||||
QList<QmlMetaTypeBackend *> backends;
|
QList<QmlMetaTypeBackend *> backends;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace MetaType
|
|
||||||
} // namespace Qml
|
} // namespace Qml
|
||||||
|
|
||||||
#endif // QMLTYPESYSTEM_H
|
#endif // QMLTYPESYSTEM_H
|
||||||
|
@@ -9,6 +9,7 @@ HEADERS += \
|
|||||||
$$PWD/qmldocument.h \
|
$$PWD/qmldocument.h \
|
||||||
$$PWD/qmlpackageinfo.h \
|
$$PWD/qmlpackageinfo.h \
|
||||||
$$PWD/qmlsymbol.h \
|
$$PWD/qmlsymbol.h \
|
||||||
|
$$PWD/metatype/exception.h \
|
||||||
$$PWD/metatype/QmlMetaTypeBackend.h \
|
$$PWD/metatype/QmlMetaTypeBackend.h \
|
||||||
$$PWD/metatype/qmltypesystem.h
|
$$PWD/metatype/qmltypesystem.h
|
||||||
|
|
||||||
@@ -17,6 +18,7 @@ SOURCES += \
|
|||||||
$$PWD/qmldocument.cpp \
|
$$PWD/qmldocument.cpp \
|
||||||
$$PWD/qmlsymbol.cpp \
|
$$PWD/qmlsymbol.cpp \
|
||||||
$$PWD/qmlpackageinfo.cpp \
|
$$PWD/qmlpackageinfo.cpp \
|
||||||
|
$$PWD/metatype/exception.cpp \
|
||||||
$$PWD/metatype/QmlMetaTypeBackend.cpp \
|
$$PWD/metatype/QmlMetaTypeBackend.cpp \
|
||||||
$$PWD/metatype/qmltypesystem.cpp
|
$$PWD/metatype/qmltypesystem.cpp
|
||||||
|
|
||||||
@@ -30,14 +32,12 @@ contains(QT_CONFIG, declarative) {
|
|||||||
$$PWD/metatype/nodemetainfo.h \
|
$$PWD/metatype/nodemetainfo.h \
|
||||||
$$PWD/metatype/propertymetainfo.h \
|
$$PWD/metatype/propertymetainfo.h \
|
||||||
$$PWD/metatype/QtDeclarativeMetaTypeBackend.h \
|
$$PWD/metatype/QtDeclarativeMetaTypeBackend.h \
|
||||||
$$PWD/metatype/invalidmetainfoexception.h \
|
$$PWD/metatype/invalidmetainfoexception.h
|
||||||
$$PWD/metatype/exception.h
|
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
$$PWD/metatype/metainfo.cpp \
|
$$PWD/metatype/metainfo.cpp \
|
||||||
$$PWD/metatype/nodemetainfo.cpp \
|
$$PWD/metatype/nodemetainfo.cpp \
|
||||||
$$PWD/metatype/propertymetainfo.cpp \
|
$$PWD/metatype/propertymetainfo.cpp \
|
||||||
$$PWD/metatype/QtDeclarativeMetaTypeBackend.cpp \
|
$$PWD/metatype/QtDeclarativeMetaTypeBackend.cpp \
|
||||||
$$PWD/metatype/invalidmetainfoexception.cpp \
|
$$PWD/metatype/invalidmetainfoexception.cpp
|
||||||
$$PWD/metatype/exception.cpp
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user