2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-06-09 15:50:48 +02:00
|
|
|
**
|
2014-01-07 13:27:11 +01:00
|
|
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
2011-06-09 15:50:48 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-06-09 15:50:48 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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.
|
2011-06-09 15:50:48 +02:00
|
|
|
**
|
2011-07-06 15:48:52 +00:00
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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.
|
2011-06-09 15:50:48 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2011-07-06 15:48:52 +00:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
2011-06-09 15:50:48 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2011-06-09 15:50:48 +02:00
|
|
|
|
2012-09-19 15:57:22 +02:00
|
|
|
#ifndef QuickITEMNODEINSTANCE_H
|
|
|
|
#define QuickITEMNODEINSTANCE_H
|
2011-06-09 15:50:48 +02:00
|
|
|
|
|
|
|
#include <QtGlobal>
|
|
|
|
|
2013-04-18 18:22:15 +02:00
|
|
|
#include "graphicalnodeinstance.h"
|
2011-06-09 15:50:48 +02:00
|
|
|
|
2012-09-19 15:57:22 +02:00
|
|
|
#include <QQuickItem>
|
2011-08-31 18:27:41 +02:00
|
|
|
#include <designersupport.h>
|
2011-06-09 15:50:48 +02:00
|
|
|
|
|
|
|
namespace QmlDesigner {
|
|
|
|
namespace Internal {
|
|
|
|
|
2013-04-18 18:22:15 +02:00
|
|
|
class QuickItemNodeInstance : public GraphicalNodeInstance
|
2011-06-09 15:50:48 +02:00
|
|
|
{
|
|
|
|
public:
|
2012-09-19 15:57:22 +02:00
|
|
|
typedef QSharedPointer<QuickItemNodeInstance> Pointer;
|
|
|
|
typedef QWeakPointer<QuickItemNodeInstance> WeakPointer;
|
2011-06-09 15:50:48 +02:00
|
|
|
|
2012-09-19 15:57:22 +02:00
|
|
|
~QuickItemNodeInstance();
|
2011-06-09 15:50:48 +02:00
|
|
|
|
|
|
|
static Pointer create(QObject *objectToBeWrapped);
|
|
|
|
|
2013-05-28 14:14:07 +02:00
|
|
|
virtual QQuickItem *contentItem() const;
|
|
|
|
|
|
|
|
QRectF contentItemBoundingBox() const Q_DECL_OVERRIDE;
|
|
|
|
|
2013-04-15 15:52:36 +02:00
|
|
|
QTransform transform() const Q_DECL_OVERRIDE;
|
2013-05-28 14:14:07 +02:00
|
|
|
QTransform contentItemTransform() const Q_DECL_OVERRIDE;
|
2011-06-09 15:50:48 +02:00
|
|
|
|
2013-04-15 15:52:36 +02:00
|
|
|
QObject *parent() const Q_DECL_OVERRIDE;
|
2011-06-09 15:50:48 +02:00
|
|
|
|
2013-04-15 15:52:36 +02:00
|
|
|
void reparent(const ObjectNodeInstance::Pointer &oldParentInstance, const PropertyName &oldParentProperty, const ObjectNodeInstance::Pointer &newParentInstance, const PropertyName &newParentProperty) Q_DECL_OVERRIDE;
|
2011-06-09 15:50:48 +02:00
|
|
|
|
2013-04-15 15:52:36 +02:00
|
|
|
bool isAnchoredBySibling() const Q_DECL_OVERRIDE;
|
|
|
|
bool isResizable() const Q_DECL_OVERRIDE;
|
2013-04-18 18:22:15 +02:00
|
|
|
bool isMovable() const Q_DECL_OVERRIDE;
|
|
|
|
bool isQuickItem() const Q_DECL_OVERRIDE;
|
2013-04-15 13:28:48 +02:00
|
|
|
|
2013-05-28 14:14:07 +02:00
|
|
|
void doComponentComplete();
|
|
|
|
|
2014-04-16 12:33:50 +02:00
|
|
|
QList<QQuickItem*> allItemsRecursive() const;
|
|
|
|
|
2011-06-09 15:50:48 +02:00
|
|
|
protected:
|
2012-09-19 15:57:22 +02:00
|
|
|
QuickItemNodeInstance(QQuickItem*);
|
|
|
|
QQuickItem *quickItem() const;
|
2013-04-18 18:22:15 +02:00
|
|
|
void setMovable(bool movable);
|
|
|
|
void setResizable(bool resizable);
|
2011-06-09 15:50:48 +02:00
|
|
|
|
|
|
|
private: //variables
|
2013-05-28 14:14:07 +02:00
|
|
|
QPointer<QQuickItem> m_contentItem;
|
2011-06-09 15:50:48 +02:00
|
|
|
bool m_isResizable;
|
|
|
|
bool m_isMovable;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
} // namespace QmlDesigner
|
|
|
|
|
2012-09-19 15:57:22 +02:00
|
|
|
#endif // QuickITEMNODEINSTANCE_H
|
2011-06-09 15:50:48 +02:00
|
|
|
|