summaryrefslogtreecommitdiff
path: root/src/plugins/qmldesigner/components
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@digia.com>2013-12-16 15:04:52 +0100
committerMarco Bubke <marco.bubke@digia.com>2014-01-08 13:40:09 +0100
commit04126b477dbd0f773b5fb966e33041b58bab4f31 (patch)
treeb734f362f4d4f510514e9e0421654a13f2fa1d3d /src/plugins/qmldesigner/components
parent126a077c3dc9c4c40be12391a752f9fd6329e5e4 (diff)
downloadqt-creator-04126b477dbd0f773b5fb966e33041b58bab4f31.tar.gz
QmlDesigner.PropertyEditor: final cleanup for Qt Quick 2 port
Removing last leftovers from QtQuick 1. Change-Id: Ifca7ef8792daec458b4bd6fbe68dc4a3a6174fc2 Reviewed-by: Marco Bubke <marco.bubke@digia.com>
Diffstat (limited to 'src/plugins/qmldesigner/components')
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/filewidget.cpp184
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/filewidget.h128
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/fontwidget.cpp172
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/fontwidget.h102
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/gradientlineqmladaptor.cpp188
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/gradientlineqmladaptor.h67
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/originwidget.cpp141
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/originwidget.h78
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditor.pri10
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/qlayoutobject.cpp50
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/qlayoutobject.h56
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.cpp114
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.h75
13 files changed, 0 insertions, 1365 deletions
diff --git a/src/plugins/qmldesigner/components/propertyeditor/filewidget.cpp b/src/plugins/qmldesigner/components/propertyeditor/filewidget.cpp
deleted file mode 100644
index aa2ca684f0..0000000000
--- a/src/plugins/qmldesigner/components/propertyeditor/filewidget.cpp
+++ /dev/null
@@ -1,184 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 "filewidget.h"
-#include <QHBoxLayout>
-#include <QFileDialog>
-#include <QDirIterator>
-#include <QDebug>
-#include <model.h>
-
-
-QT_BEGIN_NAMESPACE
-
-static QString s_lastBrowserPath;
-
-FileWidget::FileWidget(QWidget *parent) : QWidget(parent), m_filter("(*.*)"), m_showComboBox(false), m_lock(false)
-{
- m_pushButton = new QToolButton(this);
- m_pushButton->setFixedWidth(32);
- m_lineEdit = new QLineEdit(this);
- m_comboBox = new QComboBox(this);
- m_comboBox->hide();
- QHBoxLayout *layout = new QHBoxLayout(this);
- setLayout(layout);
- layout->setContentsMargins(0, 0, 0, 0);
- layout->addWidget(m_lineEdit);
- layout->addWidget(m_comboBox);
- m_comboBox->setEditable(true);
- layout->addWidget(m_pushButton);
- m_pushButton->setText("...");
- connect(m_lineEdit, SIGNAL(editingFinished()), this, SLOT(lineEditChanged()));
- connect(m_pushButton, SIGNAL(pressed()), this, SLOT(buttonPressed()));
- connect(m_comboBox, SIGNAL(editTextChanged(QString)), this, SLOT(comboBoxChanged()));
-}
-
-FileWidget::~FileWidget()
-{
-}
-
-void FileWidget::setItemNode(const QVariant &itemNode)
-{
-
- if (!itemNode.value<QmlDesigner::ModelNode>().isValid() || !QmlDesigner::QmlItemNode(itemNode.value<QmlDesigner::ModelNode>()).hasNodeParent())
- return;
- m_itemNode = itemNode.value<QmlDesigner::ModelNode>();
- setupComboBox();
- emit itemNodeChanged();
-}
-
-void FileWidget::setShowComboBox(bool show)
-{
- m_showComboBox = show;
- m_comboBox->setVisible(show);
- m_lineEdit->setVisible(!show);
-}
-
-void FileWidget::lineEditChanged()
-{
- if (m_lock)
- return;
- setFileNameStr(m_lineEdit->text());
-}
-
-void FileWidget::comboBoxChanged()
-{
- if (m_lock)
- return;
- setFileNameStr(m_comboBox->currentText());
-}
-
-void FileWidget::buttonPressed()
-{
- QString modelPath;
- if (m_itemNode.isValid())
- modelPath = QFileInfo(m_itemNode.modelNode().model()->fileUrl().toLocalFile()).absoluteDir().absolutePath();
-
- m_lastModelPath = modelPath;
-
- bool documentChanged = m_lastModelPath == modelPath;
-
- //First we try the last path this browser widget was opened with
- //if the document was not changed
- QString path = documentChanged ? QString() : m_currentPath;
-
-
- //If that one is not valid we try the path for the current file
- if (path.isEmpty() && !m_fileName.isEmpty())
- path = QFileInfo(modelPath + QLatin1String("/") + m_fileName.toString()).absoluteDir().absolutePath();
-
-
- //Next we try to fall back to the path any file browser was opened with
- if (!QFileInfo(path).exists()) {
- path = s_lastBrowserPath;
-
- //The last fallback is to try the path of the document
- if (!QFileInfo(path).exists()) {
- if (m_itemNode.isValid())
- path = modelPath;
- }
- }
-
- QString newFile = QFileDialog::getOpenFileName(0, tr("Open File"), path, m_filter);
-
- if (!newFile.isEmpty()) {
- setFileNameStr(newFile);
-
- m_currentPath = QFileInfo(newFile).absolutePath();
- s_lastBrowserPath = m_currentPath;
- }
-}
-
-void FileWidget::setFileNameStr(const QString &fileName)
-{
- setFileName(QUrl(fileName));
-}
-void FileWidget::setFileName(const QUrl &fileName)
-{
- if (fileName == m_fileName)
- return;
-
- m_fileName = fileName;
- if (m_lineEdit->text() != fileName.toString()) {
- m_lineEdit->setText(fileName.toString());
- m_lineEdit->setToolTip(m_fileName.toString());
- }
- if (m_comboBox->currentText() != fileName.toString()) {
- m_comboBox->setEditText(m_fileName.toString());
- m_comboBox->setToolTip(m_fileName.toString());
- }
- emit fileNameChanged(fileName);
-}
-
-void FileWidget::setupComboBox()
-{
- m_lock = true;
- m_comboBox->clear();
-
- QDir dir;
-
- if (m_itemNode.isValid())
- dir = QFileInfo(m_itemNode.modelNode().model()->fileUrl().toLocalFile()).dir();
- else if (m_path.isValid())
- dir = QDir(m_path.toLocalFile());
-
- QStringList filterList = m_filter.split(' ');
-
- QDirIterator it(dir.absolutePath(), filterList, QDir::Files, QDirIterator::Subdirectories);
- while (it.hasNext()) {
- QString absolutePath = it.next();
- m_comboBox->addItem(dir.relativeFilePath(absolutePath));
- }
- m_comboBox->setEditText(m_fileName.toString());
-
- m_lock = false;
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/plugins/qmldesigner/components/propertyeditor/filewidget.h b/src/plugins/qmldesigner/components/propertyeditor/filewidget.h
deleted file mode 100644
index 57fbeee0f6..0000000000
--- a/src/plugins/qmldesigner/components/propertyeditor/filewidget.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 FILEWIDGET_H
-#define FILEWIDGET_H
-
-#include <QWidget>
-#include <QToolButton>
-#include <QLineEdit>
-#include <QComboBox>
-#include <QUrl>
-#include <qmlitemnode.h>
-
-QT_BEGIN_NAMESPACE
-
-class FileWidget : public QWidget
-{
- Q_OBJECT
-
- Q_PROPERTY(QString text READ text WRITE setText)
- Q_PROPERTY(QString fileName READ fileName WRITE setFileNameStr NOTIFY fileNameChanged)
- Q_PROPERTY(QString filter READ filter WRITE setFilter)
- Q_PROPERTY(bool showComboBox READ showComboBox WRITE setShowComboBox)
- Q_PROPERTY(QVariant itemNode READ itemNode WRITE setItemNode NOTIFY itemNodeChanged)
- Q_PROPERTY(QUrl path READ path WRITE setPath)
-
-public:
-
- FileWidget(QWidget *parent = 0);
- ~FileWidget();
-
- QVariant itemNode() const { return QVariant::fromValue(m_itemNode.modelNode()); }
- void setItemNode(const QVariant &itemNode);
-
- QString fileName() const
- { return m_fileName.toString(); }
-
- void setText(const QString &/*text*/)
- {
-
- }
-
- void setPath(const QUrl &url) { m_path = url; setupComboBox(); }
-
- QUrl path() const { return m_path; }
-
- QString text() const
- {
- return QString();
- }
-
- void setFilter(const QString &filter)
- {
- m_filter = filter;
- }
-
- QString filter() const
- {
- return m_filter;
- }
-
- void setShowComboBox(bool show);
-
- bool showComboBox() const
- { return m_showComboBox; }
-
-public slots:
- void setFileName(const QUrl &fileName);
- void setFileNameStr(const QString &fileName);
- void buttonPressed();
- void lineEditChanged();
- void comboBoxChanged();
-
-signals:
- void fileNameChanged(const QUrl &fileName);
- void itemNodeChanged();
-
-protected:
-
-private:
-
- void setupComboBox();
-
- QToolButton *m_pushButton;
- QLineEdit *m_lineEdit;
- QComboBox *m_comboBox;
- QUrl m_fileName;
- QUrl m_path;
- QmlDesigner::QmlItemNode m_itemNode;
- QString m_filter;
- bool m_showComboBox;
- bool m_lock;
- QString m_currentPath;
- QString m_lastModelPath;
-
-};
-
-QT_END_NAMESPACE
-
-#endif
-
diff --git a/src/plugins/qmldesigner/components/propertyeditor/fontwidget.cpp b/src/plugins/qmldesigner/components/propertyeditor/fontwidget.cpp
deleted file mode 100644
index 845527c049..0000000000
--- a/src/plugins/qmldesigner/components/propertyeditor/fontwidget.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 "fontwidget.h"
-#include <QPushButton>
-#include <QLabel>
-#include <QHBoxLayout>
-#include <QFontDialog>
-#include <QComboBox>
-
-namespace QmlDesigner {
-
-FontWidget::FontWidget(QWidget *parent)
- : QWidget(parent),
- m_label(new QLabel(this)),
- m_fontButton(new QPushButton("ABC..", this))
-{
- QHBoxLayout *horizonalBoxLayout = new QHBoxLayout(this);
-
- horizonalBoxLayout->addWidget(m_label);
- horizonalBoxLayout->addWidget(m_fontButton);
- m_fontButton->setMinimumHeight(20);
- m_fontButton->setCheckable(true);
- connect(m_fontButton, SIGNAL(toggled(bool)), SLOT(openFontEditor(bool)));
-}
-
-FontWidget::~FontWidget()
-{
-}
-
-void FontWidget::openFontEditor(bool show)
-{
- if (show && m_fontDialog.isNull()) {
- m_fontDialog = new QFontDialog();
- m_fontDialog->setAttribute(Qt::WA_DeleteOnClose);
- m_fontDialog->setCurrentFont(m_font);
- QComboBox *comboBox = m_fontDialog->findChild<QComboBox*>();
- QList<QLabel*> labels = m_fontDialog->findChildren<QLabel*>();
- foreach (QLabel *label, labels)
- if (label->buddy() == comboBox)
- label->hide();
- comboBox->hide();
- m_fontDialog->show();
- connect(m_fontDialog.data(), SIGNAL(accepted()), SLOT(updateFont()));
- connect(m_fontDialog.data(), SIGNAL(destroyed(QObject*)), SLOT(resetFontButton()));
- } else {
- delete m_fontDialog.data();
- }
-}
-
-void FontWidget::updateFont()
-{
- QFont font(m_fontDialog->currentFont());
- setFamily(font.family());
- setItalic(font.italic());
- setBold(font.bold());
- setFontSize(font.pointSizeF());
- emit dataFontChanged();
-}
-
-void FontWidget::resetFontButton()
-{
- m_fontButton->setChecked(false);
-}
-
-QString FontWidget::text() const
-{
- return m_label->text();
-}
-
-void FontWidget::setText(const QString &text)
-{
- m_label->setText(text);
-}
-
-QString FontWidget::family() const
-{
- return m_font.family();
-}
-
-void FontWidget::setFamily(const QString &fontFamily)
-{
- if (fontFamily != m_font.family()) {
- m_font.setFamily(fontFamily);
- emit familyChanged();
- }
-}
-
-bool FontWidget::isBold() const
-{
- return m_font.bold();
-}
-
-void FontWidget::setBold(bool isBold)
-{
- if (m_font.bold() != isBold) {
- m_font.setBold(isBold);
- emit boldChanged();
- }
-}
-
-bool FontWidget::isItalic() const
-{
- return m_font.italic();
-}
-
-void FontWidget::setItalic(bool isItalic)
-{
- if (m_font.italic() != isItalic) {
- m_font.setItalic(isItalic);
- emit italicChanged();
- }
-}
-
-
-QFont FontWidget::font() const
-{
- return m_font;
-}
-
-void FontWidget::setFont(QFont font)
-{
- if (m_font != font) {
- m_font = font;
- emit dataFontChanged();
- }
-}
-
-qreal FontWidget::fontSize() const
-{
- return m_font.pointSizeF();
-}
-
-void FontWidget::setFontSize(qreal size)
-{
- if (m_font.pointSizeF() != size) {
- m_font.setPointSizeF(size);
- emit fontSizeChanged();
- }
-}
-
-void FontWidget::registerDeclarativeTypes() {
- qmlRegisterType<QmlDesigner::FontWidget>("Bauhaus",1,0,"FontWidget");
-}
-
-} // namespace QmlDesigner
diff --git a/src/plugins/qmldesigner/components/propertyeditor/fontwidget.h b/src/plugins/qmldesigner/components/propertyeditor/fontwidget.h
deleted file mode 100644
index 186e440685..0000000000
--- a/src/plugins/qmldesigner/components/propertyeditor/fontwidget.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 FONTWIDGET_H
-#define FONTWIDGET_H
-
-#include <QWeakPointer>
-#include <QWidget>
-#include <QtQml>
-
-QT_BEGIN_NAMESPACE
-class QLabel;
-class QPushButton;
-class QFontDialog;
-QT_END_NAMESPACE
-
-namespace QmlDesigner {
-
-class FontWidget : public QWidget
-{
- Q_OBJECT
- Q_PROPERTY(QString text READ text WRITE setText)
- Q_PROPERTY(QString family READ family WRITE setFamily NOTIFY familyChanged)
- Q_PROPERTY(bool bold READ isBold WRITE setBold NOTIFY boldChanged)
- Q_PROPERTY(bool italic READ isItalic WRITE setItalic NOTIFY italicChanged)
- Q_PROPERTY(qreal fontSize READ fontSize WRITE setFontSize NOTIFY fontSizeChanged)
- Q_PROPERTY(QFont dataFont READ font WRITE setFont NOTIFY dataFontChanged)
-
-public:
- FontWidget(QWidget *parent = 0);
- ~FontWidget();
-
- QString text() const;
- void setText(const QString &text);
-
- QString family() const;
- void setFamily(const QString &fontFamily);
-
- bool isBold() const;
- void setBold(bool isBold);
-
- bool isItalic() const;
- void setItalic(bool isItalic);
-
- qreal fontSize() const;
- void setFontSize(qreal size);
-
- QFont font() const;
- void setFont(QFont size);
-
- static void registerDeclarativeTypes();
-
-signals:
- void familyChanged();
- void boldChanged();
- void italicChanged();
- void fontSizeChanged();
- void dataFontChanged();
-
-private slots:
- void openFontEditor(bool show);
- void updateFont();
- void resetFontButton();
-
-private: //variables
- QFont m_font;
- QLabel *m_label;
- QPushButton *m_fontButton;
- QWeakPointer<QFontDialog> m_fontDialog;
-};
-
-} // namespace QmlDesigner
-
-QML_DECLARE_TYPE(QmlDesigner::FontWidget)
-
-#endif // FONTWIDGET_H
diff --git a/src/plugins/qmldesigner/components/propertyeditor/gradientlineqmladaptor.cpp b/src/plugins/qmldesigner/components/propertyeditor/gradientlineqmladaptor.cpp
deleted file mode 100644
index b63fa8af42..0000000000
--- a/src/plugins/qmldesigner/components/propertyeditor/gradientlineqmladaptor.cpp
+++ /dev/null
@@ -1,188 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 "gradientlineqmladaptor.h"
-
-#include <QMessageBox>
-#include <QtQml>
-
-#include <nodeproperty.h>
-#include <nodelistproperty.h>
-#include <nodemetainfo.h>
-#include <abstractview.h>
-#include <rewritingexception.h>
-#include <variantproperty.h>
-
-namespace QmlDesigner {
-
-GradientLineQmlAdaptor::GradientLineQmlAdaptor(QWidget *parent) :
- QmlEditorWidgets::GradientLine(parent)
-{
- setActive(false);
- connect(this, SIGNAL(gradientChanged()), this, SLOT(writeGradient()));
-}
-
-void GradientLineQmlAdaptor::setItemNode(const QVariant &itemNode)
-{
-
- if (!itemNode.value<ModelNode>().isValid())
- return;
- m_itemNode = itemNode.value<ModelNode>();
- emit itemNodeChanged();
-}
-
-static inline QColor normalizeColor(const QColor &color)
-{
- QColor newColor = QColor(color.name());
- newColor.setAlpha(color.alpha());
- return newColor;
-}
-
-static inline qreal roundReal(qreal real)
-{
- int i = real * 100;
- return qreal(i) / 100;
-}
-
-void GradientLineQmlAdaptor::setupGradient()
-{
- if (!active())
- return;
-
- ModelNode modelNode = m_itemNode.modelNode();
- QLinearGradient newGradient;
- QVector<QGradientStop> stops;
-
- if (!modelNode.isValid())
- return;
-
- if (modelNode.hasBindingProperty(gradientName().toUtf8()))
- return;
-
- if (modelNode.hasProperty(gradientName().toUtf8())) { //gradient exists
-
- ModelNode gradientNode = modelNode.nodeProperty(gradientName().toUtf8()).modelNode();
- QList<ModelNode> stopList = gradientNode.nodeListProperty("stops").toModelNodeList();
-
- foreach (const ModelNode &stopNode, stopList) {
- QmlObjectNode stopObjectNode = stopNode;
- if (stopObjectNode.isValid()) {
- qreal position = stopObjectNode.modelValue("position").toReal();
- QColor color = stopObjectNode.modelValue("color").value<QColor>();
- stops.append( QPair<qreal, QColor>(position, color));
- }
- }
- } else {
- stops.append( QPair<qreal, QColor>(0, activeColor()));
- stops.append( QPair<qreal, QColor>(1, QColor(Qt::black)));
- }
-
- newGradient.setStops(stops);
- setGradient(newGradient);
-}
-
-void GradientLineQmlAdaptor::writeGradient()
-{
- if (!active())
- return;
-
- if (!m_itemNode.isValid())
- return;
-
- if (!m_itemNode.modelNode().metaInfo().hasProperty(gradientName().toUtf8()))
- return;
- try {
- ModelNode modelNode = m_itemNode.modelNode();
-
- QString oldId;
- QVector<QGradientStop> stops = gradient().stops();
- if (m_itemNode.isInBaseState()) {
- if (modelNode.hasProperty(gradientName().toUtf8())) {
- oldId = modelNode.nodeProperty(gradientName().toUtf8()).modelNode().id();
- modelNode.removeProperty(gradientName().toUtf8());
- }
-
- ModelNode gradientNode= modelNode.view()->createModelNode("QtQuick.Gradient", modelNode.view()->majorQtQuickVersion(), 0);
- modelNode.nodeProperty(gradientName().toUtf8()).reparentHere(gradientNode);
-
- RewriterTransaction transaction = m_itemNode.modelNode().view()->beginRewriterTransaction(QByteArrayLiteral("GradientLineQmlAdaptor::writeGradient"));
-
- if (!oldId.isNull())
- gradientNode.setId(oldId);
-
- for (int i = 0;i < stops.size(); i++) {
- ModelNode gradientStopNode = modelNode.view()->createModelNode("QtQuick.GradientStop", modelNode.view()->majorQtQuickVersion(), 0);
- gradientStopNode.variantProperty("position").setValue(roundReal(stops.at(i).first));
- gradientStopNode.variantProperty("color").setValue(normalizeColor(stops.at(i).second));
- gradientNode.nodeListProperty("stops").reparentHere(gradientStopNode);
- }
- } else { //state
- if (!modelNode.hasProperty(gradientName().toUtf8())) {
- qWarning(" GradientLine::updateGradient: no gradient in state");
- return;
- }
- ModelNode gradientNode = modelNode.nodeProperty(gradientName().toUtf8()).modelNode();
- QList<ModelNode> stopList = gradientNode.nodeListProperty("stops").toModelNodeList();
- for (int i = 0;i < stops.size(); i++) {
- QmlObjectNode stopObjectNode = stopList.at(i);
- stopObjectNode.setVariantProperty("position", roundReal(stops.at(i).first));
- stopObjectNode.setVariantProperty("color", normalizeColor(stops.at(i).second));
- }
- }
- }
- catch (RewritingException &e) {
- QMessageBox::warning(0, "Error", e.description());
- }
-}
-
-void GradientLineQmlAdaptor::deleteGradient()
-{
- if (!m_itemNode.isValid())
- return;
-
- if (!m_itemNode.modelNode().metaInfo().hasProperty(gradientName().toUtf8()))
- return;
-
- ModelNode modelNode = m_itemNode.modelNode();
-
- if (m_itemNode.isInBaseState()) {
- if (modelNode.hasProperty(gradientName().toUtf8())) {
- RewriterTransaction transaction = m_itemNode.modelNode().view()->beginRewriterTransaction(QByteArrayLiteral("GradientLineQmlAdaptor::deleteGradient"));
- ModelNode gradientNode = modelNode.nodeProperty(gradientName().toUtf8()).modelNode();
- if (QmlObjectNode(gradientNode).isValid())
- QmlObjectNode(gradientNode).destroy();
- }
- }
-}
-
-void GradientLineQmlAdaptor::registerDeclarativeType() {
- qmlRegisterType<QmlDesigner::GradientLineQmlAdaptor>("Bauhaus",1,0,"GradientLine");
-}
-
-} //QmlDesigner
diff --git a/src/plugins/qmldesigner/components/propertyeditor/gradientlineqmladaptor.h b/src/plugins/qmldesigner/components/propertyeditor/gradientlineqmladaptor.h
deleted file mode 100644
index cf1f82cb7f..0000000000
--- a/src/plugins/qmldesigner/components/propertyeditor/gradientlineqmladaptor.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 GRADIENTLINEQMLADAPTOR_H
-#define GRADIENTLINEQMLADAPTOR_H
-
-#include <qmleditorwidgets/gradientline.h>
-#include <qmlitemnode.h>
-
-namespace QmlDesigner {
-
-class GradientLineQmlAdaptor : public QmlEditorWidgets::GradientLine
-{
- Q_OBJECT
-
- Q_PROPERTY(QVariant itemNode READ itemNode WRITE setItemNode NOTIFY itemNodeChanged)
-
-public:
- explicit GradientLineQmlAdaptor(QWidget *parent = 0);
-
- static void registerDeclarativeType();
-
-signals:
- void itemNodeChanged();
-
-public slots:
- void setupGradient();
- void writeGradient();
- void deleteGradient();
-
-private:
- QVariant itemNode() const { return QVariant::fromValue(m_itemNode.modelNode()); }
- void setItemNode(const QVariant &itemNode);
-
- QmlItemNode m_itemNode;
-
-};
-
-} //QmlDesigner
-
-#endif // GRADIENTLINEQMLADAPTOR_H
diff --git a/src/plugins/qmldesigner/components/propertyeditor/originwidget.cpp b/src/plugins/qmldesigner/components/propertyeditor/originwidget.cpp
deleted file mode 100644
index ca6588a23e..0000000000
--- a/src/plugins/qmldesigner/components/propertyeditor/originwidget.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 "originwidget.h"
-#include <QList>
-#include <QPainter>
-#include <QMouseEvent>
-#include <QtQml>
-
-static QList<QPoint> positions;
-static QStringList originsStringList;
-
-namespace QmlDesigner {
-
-OriginWidget::OriginWidget(QWidget *parent) : QWidget(parent), m_pressed(false), m_marked(false)
-{
- if (positions.isEmpty())
- positions << QPoint(0, 0) << QPoint(18, 0) << QPoint(36, 0)
- << QPoint(0, 18) << QPoint(18, 18) << QPoint(36, 18)
- << QPoint(0, 36) << QPoint(18, 36) << QPoint(36, 36);
-
- if (originsStringList.isEmpty())
- originsStringList << "TopLeft" << "Top"
- << "TopRight" << "Left" << "Center" << "Right"
- << "BottomLeft" << "Bottom" << "BottomRight";
-
- m_originString = "Center";
- resize(50, 50);
- setMinimumHeight(50);
- m_index = 0;
- setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
-}
-
-void OriginWidget::setOrigin(const QString& newOrigin)
-{
- if (!originsStringList.contains(newOrigin))
- return;
- if (newOrigin == m_originString)
- return;
-
- m_originString = newOrigin;
- update();
- emit originChanged();
-}
-
-void OriginWidget::registerDeclarativeType()
-{
- qmlRegisterType<QmlDesigner::OriginWidget>("Bauhaus",1,0,"OriginWidget");
-
-}
-
-void OriginWidget::paintEvent(QPaintEvent *event)
-{
- QWidget::paintEvent(event);
-
- QPainter p(this);
-
- foreach (const QPoint& position, positions)
- p.fillRect(position.x(), position.y(), 14, 14, Qt::black);
-
- int origin = originsStringList.indexOf(m_originString);
-
- if (m_pressed)
- p.fillRect(positions.at(m_index).x() + 4, positions.at(m_index).y() + 4, 6, 6, "#868686");
-
- if (m_marked)
- p.fillRect(positions.at(origin).x(), positions.at(origin).y(), 14, 14, "#9999ff");
- else
- p.fillRect(positions.at(origin).x(), positions.at(origin).y(), 14, 14, "#e6e6e6");
- p.fillRect(positions.at(origin).x() + 2, positions.at(origin).y() + 2, 10, 10, "#666666");
-}
-
-void OriginWidget::mouseReleaseEvent(QMouseEvent *event)
-{
- if (event->button() == Qt::LeftButton) {
- m_pressed = false;
- for (int i = 0; i < positions.size(); i++)
- if (QRect(positions.at(i), QSize(14, 14)).contains(event->pos()))
- setOrigin(originsStringList.at(i));
- }
- QWidget::mouseReleaseEvent(event);
-}
-
-void OriginWidget::mousePressEvent(QMouseEvent * event)
-{
- if (event->button() == Qt::LeftButton) {
- m_pressed = true;
- for (int i = 0; i < positions.size(); i++)
- if (QRect(positions.at(i), QSize(14, 14)).contains(event->pos())) {
- m_index = i;
- update();
- }
- }
- QWidget::mousePressEvent(event);
-}
-
-static inline QString getToolTip(const QPoint &pos)
-{
- for (int i = 0; i < positions.size(); i++)
- if (QRect(positions.at(i), QSize(14, 14)).contains(pos))
- return originsStringList.at(i);
-
- return QString();
-}
-
-bool OriginWidget::event(QEvent *event)
-{
- if (event->type() == QEvent::ToolTip)
- setToolTip(getToolTip(static_cast<QHelpEvent*>(event)->pos()));
-
- return QWidget::event(event);
-}
-
-} //QmlDesigner
-
diff --git a/src/plugins/qmldesigner/components/propertyeditor/originwidget.h b/src/plugins/qmldesigner/components/propertyeditor/originwidget.h
deleted file mode 100644
index de4588ead2..0000000000
--- a/src/plugins/qmldesigner/components/propertyeditor/originwidget.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 ORIGINWIDGET_H
-#define ORIGINWIDGET_H
-
-#include <QWidget>
-
-namespace QmlDesigner {
-
-class OriginWidget: public QWidget {
-
-Q_OBJECT
-
-Q_PROPERTY(QString origin READ origin WRITE setOrigin NOTIFY originChanged)
-Q_PROPERTY(bool marked READ marked WRITE setMarked)
-
-public:
- OriginWidget(QWidget *parent = 0);
-
- QString origin() const
- { return m_originString; }
-
- void setOrigin(const QString& newOrigin);
-
- bool marked() const
- { return m_marked; }
-
- void setMarked(bool newMarked)
- { m_marked = newMarked; }
-
- static void registerDeclarativeType();
-
-signals:
- void originChanged();
-
-protected:
- void paintEvent(QPaintEvent *event);
- void mouseReleaseEvent(QMouseEvent * event);
- void mousePressEvent(QMouseEvent * event);
- bool event(QEvent *event);
-private:
- QString m_originString;
- bool m_pressed;
- int m_index;
- bool m_marked;
-};
-
-} // QmlDesigner
-
-
-#endif //ORIGINWIDGET_H
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.pri b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.pri
index 912e5e847a..218293f451 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.pri
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.pri
@@ -2,15 +2,10 @@ VPATH += $$PWD
SOURCES += propertyeditorview.cpp \
qmlanchorbindingproxy.cpp \
- filewidget.cpp \
propertyeditorvalue.cpp \
- fontwidget.cpp \
- originwidget.cpp \
- siblingcombobox.cpp \
propertyeditortransaction.cpp \
propertyeditorcontextobject.cpp \
quick2propertyeditorview.cpp \
- gradientlineqmladaptor.cpp \
propertyeditorqmlbackend.cpp \
propertyeditorwidget.cpp \
fileresourcesmodel.cpp \
@@ -18,16 +13,11 @@ SOURCES += propertyeditorview.cpp \
HEADERS += propertyeditorview.h \
qmlanchorbindingproxy.h \
- filewidget.h \
propertyeditorvalue.h \
- fontwidget.h \
- originwidget.h \
- siblingcombobox.h \
propertyeditortransaction.h \
designerpropertymap.h \
propertyeditorcontextobject.h \
quick2propertyeditorview.h \
- gradientlineqmladaptor.h \
propertyeditorqmlbackend.h \
propertyeditorwidget.h \
fileresourcesmodel.h \
diff --git a/src/plugins/qmldesigner/components/propertyeditor/qlayoutobject.cpp b/src/plugins/qmldesigner/components/propertyeditor/qlayoutobject.cpp
deleted file mode 100644
index b6bfe9b881..0000000000
--- a/src/plugins/qmldesigner/components/propertyeditor/qlayoutobject.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 "qlayoutobject.h"
-
-
-QT_BEGIN_NAMESPACE
-
-void QLayoutObject::registerDeclarativeType()
-{
- qmlRegisterType<QLayoutObject>("Bauhaus",1,0,"QLayoutObject");
-}
-
-QLayoutObject::QLayoutObject(QObject *parent)
-: QObject(parent)
-{
-}
-
-QLayout *QLayoutObject::layout() const
-{
- return 0;
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/qmldesigner/components/propertyeditor/qlayoutobject.h b/src/plugins/qmldesigner/components/propertyeditor/qlayoutobject.h
deleted file mode 100644
index 46da9bb5e1..0000000000
--- a/src/plugins/qmldesigner/components/propertyeditor/qlayoutobject.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 QLAYOUTOBJECT_H
-#define QLAYOUTOBJECT_H
-
-#include <QObject>
-#include <QLayout>
-#include <qdeclarative.h>
-
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-class QLayoutObject : public QObject
-{
-Q_OBJECT
-public:
- QLayoutObject(QObject *parent = 0);
-
- virtual QLayout *layout() const;
-
- static void registerDeclarativeType();
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QLayoutObject)
-
-#endif // QLAYOUTOBJECT_H
diff --git a/src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.cpp b/src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.cpp
deleted file mode 100644
index 89fc6d9181..0000000000
--- a/src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 "siblingcombobox.h"
-
-#include <QtQml>
-
-namespace QmlDesigner {
-
-void SiblingComboBox::setItemNode(const QVariant &itemNode)
-{
-
- if (!itemNode.value<ModelNode>().isValid() || !QmlItemNode(itemNode.value<ModelNode>()).hasNodeParent())
- return;
- m_itemNode = itemNode.value<ModelNode>();
- setup();
- emit itemNodeChanged();
-}
-
-void SiblingComboBox::registerDeclarativeTypes()
-{
- qmlRegisterType<SiblingComboBox>("Bauhaus",1,0,"SiblingComboBox");
-}
-
-void SiblingComboBox::setSelectedItemNode(const QVariant &itemNode)
-{
- if (itemNode.value<ModelNode>() == m_selectedItemNode)
- return;
- if (!itemNode.value<ModelNode>().isValid())
- return;
- m_selectedItemNode = itemNode.value<ModelNode>();
- setup();
- emit selectedItemNodeChanged();
-}
-
-void SiblingComboBox::changeSelection(int i)
-{
- if (i < 0 || m_itemList.at(i) == m_selectedItemNode)
- return;
- setSelectedItemNode(QVariant::fromValue(m_itemList.at(i).modelNode()));
-}
-
-void SiblingComboBox::setup()
-{
- connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(changeSelection(int)));
- if (!m_itemNode.isValid())
- return;
-
- if (m_itemNode.instanceParent().modelNode().isValid())
- m_itemList = toQmlItemNodeList(m_itemNode.instanceParent().modelNode().allDirectSubModelNodes());
- m_itemList.removeOne(m_itemNode);
- //We currently have no instanceChildren().
- //So we double check here if the instanceParents are equal.
- foreach (const QmlItemNode &node, m_itemList)
- if (node.isValid() && (node.instanceParent().modelNode() != m_itemNode.instanceParent().modelNode()))
- m_itemList.removeAll(node);
-
- disconnect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(changeSelection(int)));
- clear();
-
- foreach (const QmlItemNode &itemNode, m_itemList) {
- if (itemNode.isValid()) {
- if (itemNode.id().isEmpty())
- addItem(itemNode.simplifiedTypeName());
- else
- addItem(itemNode.id());
- }
- }
-
- QmlItemNode parent(m_itemNode.instanceParent().toQmlItemNode());
-
- if (parent.isValid()) {
- m_itemList.prepend(parent);
- QString parentString("Parent (");
-
- if (parent.id().isEmpty())
- parentString += parent.simplifiedTypeName();
- else
- parentString += parent.id();
- parentString += ')';
- insertItem(0, parentString);
- }
- setCurrentIndex(m_itemList.indexOf(m_selectedItemNode));
- connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(changeSelection(int)));
-}
-
-
-} //QmlDesigner
diff --git a/src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.h b/src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.h
deleted file mode 100644
index 599cef5b49..0000000000
--- a/src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 SIBLINGCOMBOBOX_H
-#define SIBLINGCOMBOBOX_H
-
-#include <QComboBox>
-
-#include <qmlitemnode.h>
-
-namespace QmlDesigner {
-
-class SiblingComboBox : public QComboBox
-{
- Q_OBJECT
- Q_PROPERTY(QVariant itemNode READ itemNode WRITE setItemNode NOTIFY itemNodeChanged)
- Q_PROPERTY(QVariant selectedItemNode READ selectedItemNode WRITE setSelectedItemNode NOTIFY selectedItemNodeChanged)
-
-public:
- SiblingComboBox(QWidget *parent = 0) : QComboBox(parent) { }
-
- QVariant itemNode() const { return QVariant::fromValue(m_itemNode.modelNode()); }
- QVariant selectedItemNode() const { return QVariant::fromValue(m_selectedItemNode.modelNode()); }
-
- void setItemNode(const QVariant &itemNode);
- void setSelectedItemNode(const QVariant &itemNode);
-
- static void registerDeclarativeTypes();
-
-signals:
- void selectedItemNodeChanged();
- void itemNodeChanged();
-
-private slots:
- void changeSelection(int i);
-
-private:
- void setup();
- QmlItemNode m_itemNode;
- QmlItemNode m_selectedItemNode;
- QList<QmlItemNode> m_itemList;
-
-
-};
-
-}
-
-#endif //SIBLINGCOMBOBOX_H
-