forked from qt-creator/qt-creator
QmlProjectManager: Fix compilation with latest changes of QDeclarative
All files have been renamed from Qml to QDeclarative. Registration of types is now done in an initializer method.
This commit is contained in:
@@ -235,7 +235,3 @@ CssFileFilterItem::CssFileFilterItem(QObject *parent)
|
||||
|
||||
} // namespace QmlProjectManager
|
||||
|
||||
QML_DEFINE_TYPE(QmlProject,1,0,QmlFiles,QmlProjectManager::QmlFileFilterItem)
|
||||
QML_DEFINE_TYPE(QmlProject,1,0,JavaScriptFiles,QmlProjectManager::JsFileFilterItem)
|
||||
QML_DEFINE_TYPE(QmlProject,1,0,ImageFiles,QmlProjectManager::ImageFileFilterItem)
|
||||
QML_DEFINE_TYPE(QmlProject,1,0,CssFiles,QmlProjectManager::CssFileFilterItem)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <QDir>
|
||||
#include <QObject>
|
||||
#include <QSet>
|
||||
#include <qml.h>
|
||||
#include <qdeclarative.h>
|
||||
#include <QFileSystemWatcher>
|
||||
|
||||
#include "qmlprojectitem.h"
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
HEADERS += $$PWD/qmlprojectitem.h \
|
||||
$$PWD/filefilteritems.h
|
||||
$$PWD/filefilteritems.h \
|
||||
$$PWD/qmlprojectfileformat.h
|
||||
SOURCES += $$PWD/qmlprojectitem.cpp \
|
||||
$$PWD/filefilteritems.cpp
|
||||
$$PWD/filefilteritems.cpp \
|
||||
$$PWD/qmlprojectfileformat.cpp
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#include "qmlprojectfileformat.h"
|
||||
#include "qmlprojectitem.h"
|
||||
#include "filefilteritems.h"
|
||||
|
||||
#include <qdeclarative.h>
|
||||
|
||||
namespace QmlProjectManager {
|
||||
|
||||
void QmlProjectFileFormat::registerDeclarativeTypes()
|
||||
{
|
||||
QML_REGISTER_NOCREATE_TYPE(QmlProjectManager::QmlProjectContentItem);
|
||||
QML_REGISTER_TYPE(QmlProject,1,0,Project,QmlProjectManager::QmlProjectItem);
|
||||
|
||||
QML_REGISTER_TYPE(QmlProject,1,0,QmlFiles,QmlProjectManager::QmlFileFilterItem);
|
||||
QML_REGISTER_TYPE(QmlProject,1,0,JavaScriptFiles,QmlProjectManager::JsFileFilterItem);
|
||||
QML_REGISTER_TYPE(QmlProject,1,0,ImageFiles,QmlProjectManager::ImageFileFilterItem);
|
||||
QML_REGISTER_TYPE(QmlProject,1,0,CssFiles,QmlProjectManager::CssFileFilterItem);
|
||||
}
|
||||
|
||||
} // namespace QmlProjectManager
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef QMLPROJECTFILEFORMAT_H
|
||||
#define QMLPROJECTFILEFORMAT_H
|
||||
|
||||
namespace QmlProjectManager {
|
||||
|
||||
class QmlProjectFileFormat {
|
||||
public:
|
||||
static void registerDeclarativeTypes();
|
||||
};
|
||||
|
||||
} // namespace QmlProjectManager
|
||||
|
||||
#endif // QMLPROJECTFILEFORMAT_H
|
||||
@@ -45,10 +45,10 @@ QmlProjectItem::~QmlProjectItem()
|
||||
delete d_ptr;
|
||||
}
|
||||
|
||||
QmlListProperty<QmlProjectContentItem> QmlProjectItem::content()
|
||||
QDeclarativeListProperty<QmlProjectContentItem> QmlProjectItem::content()
|
||||
{
|
||||
Q_D(QmlProjectItem);
|
||||
return QmlListProperty<QmlProjectContentItem>(this, d->content);
|
||||
return QDeclarativeListProperty<QmlProjectContentItem>(this, d->content);
|
||||
}
|
||||
|
||||
QString QmlProjectItem::sourceDirectory() const
|
||||
@@ -137,7 +137,4 @@ bool QmlProjectItem::matchesFile(const QString &filePath) const
|
||||
|
||||
} // namespace QmlProjectManager
|
||||
|
||||
QML_DEFINE_NOCREATE_TYPE(QmlProjectManager::QmlProjectContentItem)
|
||||
QML_DEFINE_TYPE(QmlProject,1,0,Project,QmlProjectManager::QmlProjectItem)
|
||||
|
||||
#include "qmlprojectitem.moc"
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#ifndef PROJECTITEM_H
|
||||
#define PROJECTITEM_H
|
||||
#ifndef QMLPROJECTITEM_H
|
||||
#define QMLPROJECTITEM_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <qml.h>
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
#include <qdeclarative.h>
|
||||
|
||||
namespace QmlProjectManager {
|
||||
|
||||
@@ -21,7 +22,7 @@ class QmlProjectItem : public QObject {
|
||||
Q_DECLARE_PRIVATE(QmlProjectItem)
|
||||
Q_DISABLE_COPY(QmlProjectItem)
|
||||
|
||||
Q_PROPERTY(QmlListProperty<QmlProjectManager::QmlProjectContentItem> content READ content DESIGNABLE false)
|
||||
Q_PROPERTY(QDeclarativeListProperty<QmlProjectManager::QmlProjectContentItem> content READ content DESIGNABLE false)
|
||||
Q_PROPERTY(QString sourceDirectory READ sourceDirectory NOTIFY sourceDirectoryChanged)
|
||||
Q_PROPERTY(QStringList libraryPaths READ libraryPaths WRITE setLibraryPaths NOTIFY libraryPathsChanged)
|
||||
|
||||
@@ -31,7 +32,7 @@ public:
|
||||
QmlProjectItem(QObject *parent = 0);
|
||||
~QmlProjectItem();
|
||||
|
||||
QmlListProperty<QmlProjectContentItem> content();
|
||||
QDeclarativeListProperty<QmlProjectContentItem> content();
|
||||
|
||||
QString sourceDirectory() const;
|
||||
void setSourceDirectory(const QString &directoryPath);
|
||||
@@ -57,5 +58,4 @@ QML_DECLARE_TYPE(QmlProjectManager::QmlProjectItem);
|
||||
QML_DECLARE_TYPE(QmlProjectManager::QmlProjectContentItem);
|
||||
Q_DECLARE_METATYPE(QList<QmlProjectManager::QmlProjectContentItem *>);
|
||||
|
||||
|
||||
#endif // PROJECTITEM_H
|
||||
#endif // QMLPROJECTITEM_H
|
||||
|
||||
Reference in New Issue
Block a user