QmlDesigner: Add ImportsWidget

Change-Id: I0e7ba19c09c1477e9e0a1040e0b1ef731ef11424
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
Marco Bubke
2013-08-14 12:55:52 +02:00
parent b6ee336b52
commit 772e6698d1
7 changed files with 205 additions and 3 deletions

View File

@@ -0,0 +1,35 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "importlabel.h"
ImportLabel::ImportLabel(QWidget *parent) :
QWidget(parent)
{
}

View File

@@ -0,0 +1,47 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef IMPORTLABEL_H
#define IMPORTLABEL_H
#include <QWidget>
class ImportLabel : public QWidget
{
Q_OBJECT
public:
explicit ImportLabel(QWidget *parent = 0);
signals:
public slots:
};
#endif // IMPORTLABEL_H

View File

@@ -1,7 +1,11 @@
VPATH += $$PWD
HEADERS += importmanagerview.h
HEADERS += importmanagerview.h \
components/importmanager/importlabel.h
HEADERS += importswidget.h
SOURCES += importmanagerview.cpp
SOURCES += importmanagerview.cpp \
components/importmanager/importlabel.cpp
SOURCES += components/importmanager/importswidget.cpp

View File

@@ -28,14 +28,31 @@
****************************************************************************/
#include "importmanagerview.h"
#include "importswidget.h"
namespace QmlDesigner {
ImportManagerView::ImportManagerView(QObject *parent) :
AbstractView(parent)
AbstractView(parent),
m_importsWidget(0)
{
}
ImportManagerView::~ImportManagerView()
{
}
WidgetInfo ImportManagerView::widgetInfo()
{
if (m_importsWidget == 0)
m_importsWidget = new ImportsWidget;
return createWidgetInfo(m_importsWidget, 0, "ImportManager", WidgetInfo::LeftPane, 1);
}
void ImportManagerView::modelAttached(Model *model)
{

View File

@@ -31,14 +31,20 @@
#define QMLDESIGNER_IMPORTMANAGERVIEW_H
#include <abstractview.h>
#include <QWeakPointer>
namespace QmlDesigner {
class ImportsWidget;
class ImportManagerView : public AbstractView
{
Q_OBJECT
public:
explicit ImportManagerView(QObject *parent = 0);
~ImportManagerView();
WidgetInfo widgetInfo();
void modelAttached(Model *model);
void modelAboutToBeDetached(Model *model);
@@ -85,6 +91,9 @@ public:
void customNotification(const AbstractView *view, const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data);
void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList);
private:
ImportsWidget *m_importsWidget;
};
} // namespace QmlDesigner

View File

@@ -0,0 +1,39 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "importswidget.h"
namespace QmlDesigner {
ImportsWidget::ImportsWidget(QWidget *parent) :
QWidget(parent)
{
}
} // namespace QmlDesigner

View File

@@ -0,0 +1,51 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef QMLDESIGNER_IMPORTSWIDGET_H
#define QMLDESIGNER_IMPORTSWIDGET_H
#include <QWidget>
namespace QmlDesigner {
class ImportsWidget : public QWidget
{
Q_OBJECT
public:
explicit ImportsWidget(QWidget *parent = 0);
signals:
public slots:
};
} // namespace QmlDesigner
#endif // QMLDESIGNER_IMPORTSWIDGET_H