Commit 4c59f3f2 authored by Kai Koehne's avatar Kai Koehne

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.
parent 318fee6f
......@@ -40,7 +40,7 @@ contains(QT_CONFIG, declarative) {
SUBDIRS += plugin_qmlprojectmanager \
plugin_qmlinspector
exists($$[QT_INSTALL_HEADERS]/QtDeclarative/private/qmlcontext_p.h) {
exists($$[QT_INSTALL_HEADERS]/QtDeclarative/private/qdeclarativecontext_p.h) {
SUBDIRS += plugin_qmldesigner
} else {
warning("QmlDesigner plugin disabled! It depends on private headers from QtDeclarative module, which seems not to be installed.")
......
......@@ -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"
......
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
#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
#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"
#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
......@@ -39,7 +39,7 @@
#include <qmljseditor/qmljsmodelmanagerinterface.h>
#include <QTextStream>
#include <QmlComponent>
#include <QDeclarativeComponent>
#include <QtDebug>
namespace QmlProjectManager {
......@@ -88,7 +88,7 @@ void QmlProject::parseProject(RefreshOptions options)
if (!m_projectItem) {
QFile file(m_fileName);
if (file.open(QFile::ReadOnly)) {
QmlComponent *component = new QmlComponent(&m_engine, this);
QDeclarativeComponent *component = new QDeclarativeComponent(&m_engine, this);
component->setData(file.readAll(), QUrl::fromLocalFile(m_fileName));
if (component->isReady()
&& qobject_cast<QmlProjectItem*>(component->create())) {
......
......@@ -37,7 +37,7 @@
#include <projectexplorer/project.h>
#include <QtDeclarative/QmlEngine>
#include <QtDeclarative/QDeclarativeEngine>
namespace QmlJSEditor {
class ModelManagerInterface;
......@@ -125,7 +125,7 @@ private:
QStringList m_files;
// qml based, new format
QmlEngine m_engine;
QDeclarativeEngine m_engine;
QWeakPointer<QmlProjectItem> m_projectItem;
ProjectExplorer::FileWatcher *m_fileWatcher;
......
......@@ -34,8 +34,8 @@ namespace Constants {
const char * const QML_RC_ID("QmlProjectManager.QmlRunConfiguration");
const char * const QML_RC_DISPLAY_NAME(QT_TRANSLATE_NOOP("QmlProjectManager::Internal::QmlRunConfiguration", "QML Viewer"));
const char * const QML_VIEWER_KEY("QmlProjectManager.QmlRunConfiguration.QmlViewer");
const char * const QML_VIEWER_ARGUMENTS_KEY("QmlProjectManager.QmlRunConfiguration.QmlViewerArguments");
const char * const QML_VIEWER_KEY("QmlProjectManager.QmlRunConfiguration.QDeclarativeViewer");
const char * const QML_VIEWER_ARGUMENTS_KEY("QmlProjectManager.QmlRunConfiguration.QDeclarativeViewerArguments");
const char * const QML_VIEWER_TARGET_ID("QmlProjectManager.QmlTarget");
const char * const QML_VIEWER_TARGET_DISPLAY_NAME("QML Viewer");
const char * const QML_MAINSCRIPT_KEY("QmlProjectManager.QmlRunConfiguration.MainScript");
......
......@@ -36,6 +36,7 @@
#include "qmlprojectrunconfigurationfactory.h"
#include "qmlprojectruncontrol.h"
#include "qmltaskmanager.h"
#include "fileformat/qmlprojectfileformat.h"
#include <extensionsystem/pluginmanager.h>
......@@ -81,6 +82,9 @@ bool QmlProjectPlugin::initialize(const QStringList &, QString *errorMessage)
addAutoReleasedObject(new Internal::QmlRunControlFactory);
addAutoReleasedObject(new QmlProjectApplicationWizard);
addAutoReleasedObject(new QmlProjectImportWizard);
QmlProjectFileFormat::registerDeclarativeTypes();
return true;
}
......
......@@ -164,11 +164,11 @@ QWidget *QmlProjectRunConfiguration::configurationWidget()
Utils::PathChooser *qmlViewer = new Utils::PathChooser;
qmlViewer->setExpectedKind(Utils::PathChooser::Command);
qmlViewer->setPath(viewerPath());
connect(qmlViewer, SIGNAL(changed(QString)), this, SLOT(onQmlViewerChanged()));
connect(qmlViewer, SIGNAL(changed(QString)), this, SLOT(onViewerChanged()));
QLineEdit *qmlViewerArgs = new QLineEdit;
qmlViewerArgs->setText(m_qmlViewerArgs);
connect(qmlViewerArgs, SIGNAL(textChanged(QString)), this, SLOT(onQmlViewerArgsChanged()));
connect(qmlViewerArgs, SIGNAL(textChanged(QString)), this, SLOT(onViewerArgsChanged()));
QLineEdit *debugServer = new QLineEdit;
debugServer->setText(m_debugServerAddress);
......@@ -212,14 +212,14 @@ void QmlProjectRunConfiguration::setMainScript(const QString &scriptFile)
m_scriptFile = scriptFile;
}
void QmlProjectRunConfiguration::onQmlViewerChanged()
void QmlProjectRunConfiguration::onViewerChanged()
{
if (Utils::PathChooser *chooser = qobject_cast<Utils::PathChooser *>(sender())) {
m_qmlViewerCustomPath = chooser->path();
}
}
void QmlProjectRunConfiguration::onQmlViewerArgsChanged()
void QmlProjectRunConfiguration::onViewerArgsChanged()
{
if (QLineEdit *lineEdit = qobject_cast<QLineEdit*>(sender()))
m_qmlViewerArgs = lineEdit->text();
......
......@@ -65,8 +65,8 @@ public:
private slots:
QString mainScript() const;
void setMainScript(const QString &scriptFile);
void onQmlViewerChanged();
void onQmlViewerArgsChanged();
void onViewerChanged();
void onViewerArgsChanged();
void onDebugServerAddressChanged();
void onDebugServerPortChanged();
......
......@@ -112,7 +112,7 @@ void QmlRunControl::slotError(const QString &err)
void QmlRunControl::slotAddToOutputWindow(const QString &line)
{
if (m_debugMode && line.startsWith("QmlDebugServer: Waiting for connection")) {
if (m_debugMode && line.startsWith("QDeclarativeDebugServer: Waiting for connection")) {
Core::ICore *core = Core::ICore::instance();
core->modeManager()->activateMode(Debugger::Constants::MODE_DEBUG);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment