2010-07-08 14:00:33 +02:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2012-01-26 18:33:46 +01:00
|
|
|
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
2010-07-08 14:00:33 +02:00
|
|
|
**
|
2011-11-02 15:59:12 +01:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2010-07-08 14:00:33 +02:00
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** 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.
|
2010-07-08 14:00:33 +02:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
2011-04-13 08:42:33 +02:00
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Other Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** If you have questions regarding the use of this file, please contact
|
2011-11-02 15:59:12 +01:00
|
|
|
** Nokia at qt-info@nokia.com.
|
2010-07-08 14:00:33 +02:00
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
2011-05-30 16:32:25 +02:00
|
|
|
#ifndef QDECLARATIVEVIEWINSPECTOR_P_H
|
|
|
|
|
#define QDECLARATIVEVIEWINSPECTOR_P_H
|
2010-07-08 14:00:33 +02:00
|
|
|
|
2011-01-24 12:30:21 +01:00
|
|
|
#include <QtCore/QWeakPointer>
|
|
|
|
|
#include <QtCore/QPointF>
|
2010-07-08 14:00:33 +02:00
|
|
|
|
2011-05-30 16:32:25 +02:00
|
|
|
#include "qdeclarativeviewinspector.h"
|
|
|
|
|
#include "qdeclarativeinspectorservice.h"
|
2010-07-30 12:56:25 +02:00
|
|
|
|
2010-09-22 09:59:18 +02:00
|
|
|
namespace QmlJSDebugger {
|
2010-07-08 14:00:33 +02:00
|
|
|
|
2010-09-16 16:39:09 +02:00
|
|
|
class JSDebuggerAgent;
|
2011-05-30 16:32:25 +02:00
|
|
|
class QDeclarativeViewInspector;
|
2011-02-09 16:59:43 +01:00
|
|
|
class LiveSelectionTool;
|
2010-07-29 12:15:55 +02:00
|
|
|
class ZoomTool;
|
|
|
|
|
class ColorPickerTool;
|
2011-02-09 16:59:43 +01:00
|
|
|
class LiveLayerItem;
|
2010-07-29 12:15:55 +02:00
|
|
|
class BoundingRectHighlighter;
|
|
|
|
|
class CrumblePath;
|
2011-02-09 16:59:43 +01:00
|
|
|
class AbstractLiveEditTool;
|
2010-07-09 16:33:09 +02:00
|
|
|
|
2011-05-30 16:32:25 +02:00
|
|
|
class QDeclarativeViewInspectorPrivate : public QObject
|
2010-07-08 14:00:33 +02:00
|
|
|
{
|
2011-01-12 12:27:12 +01:00
|
|
|
Q_OBJECT
|
2010-07-08 14:00:33 +02:00
|
|
|
public:
|
2011-05-30 16:32:25 +02:00
|
|
|
QDeclarativeViewInspectorPrivate(QDeclarativeViewInspector *);
|
|
|
|
|
~QDeclarativeViewInspectorPrivate();
|
2010-07-29 12:15:55 +02:00
|
|
|
|
2010-09-14 13:39:32 +02:00
|
|
|
QDeclarativeView *view;
|
2011-05-30 16:32:25 +02:00
|
|
|
QDeclarativeViewInspector *q;
|
|
|
|
|
QDeclarativeInspectorService *debugService;
|
2010-11-11 16:50:45 +01:00
|
|
|
QWeakPointer<QWidget> viewport;
|
2010-09-01 13:42:24 +02:00
|
|
|
|
2010-07-29 12:15:55 +02:00
|
|
|
QPointF cursorPos;
|
|
|
|
|
QList<QWeakPointer<QGraphicsObject> > currentSelection;
|
|
|
|
|
|
|
|
|
|
Constants::DesignTool currentToolMode;
|
2011-02-09 16:59:43 +01:00
|
|
|
AbstractLiveEditTool *currentTool;
|
2010-07-08 14:00:33 +02:00
|
|
|
|
2011-02-09 16:59:43 +01:00
|
|
|
LiveSelectionTool *selectionTool;
|
2010-07-29 12:15:55 +02:00
|
|
|
ZoomTool *zoomTool;
|
|
|
|
|
ColorPickerTool *colorPickerTool;
|
2011-02-09 16:59:43 +01:00
|
|
|
LiveLayerItem *manipulatorLayer;
|
2010-07-08 14:00:33 +02:00
|
|
|
|
2010-07-29 12:15:55 +02:00
|
|
|
BoundingRectHighlighter *boundingRectHighlighter;
|
2010-07-08 14:00:33 +02:00
|
|
|
|
2010-07-29 12:15:55 +02:00
|
|
|
bool designModeBehavior;
|
2010-11-23 10:07:09 +01:00
|
|
|
bool showAppOnTop;
|
2010-07-08 14:00:33 +02:00
|
|
|
|
2011-03-22 10:37:14 +01:00
|
|
|
bool animationPaused;
|
2011-03-16 19:59:49 +01:00
|
|
|
qreal slowDownFactor;
|
2010-07-09 16:33:09 +02:00
|
|
|
|
2010-11-11 16:50:45 +01:00
|
|
|
void setViewport(QWidget *widget);
|
|
|
|
|
|
2010-07-30 12:56:25 +02:00
|
|
|
void clearEditorItems();
|
|
|
|
|
void changeToSelectTool();
|
|
|
|
|
QList<QGraphicsItem*> filterForSelection(QList<QGraphicsItem*> &itemlist) const;
|
|
|
|
|
|
|
|
|
|
QList<QGraphicsItem*> selectableItems(const QPoint &pos) const;
|
|
|
|
|
QList<QGraphicsItem*> selectableItems(const QPointF &scenePos) const;
|
|
|
|
|
QList<QGraphicsItem*> selectableItems(const QRectF &sceneRect, Qt::ItemSelectionMode selectionMode) const;
|
|
|
|
|
|
2010-07-30 17:43:21 +02:00
|
|
|
void setSelectedItemsForTools(QList<QGraphicsItem *> items);
|
2010-07-30 12:56:25 +02:00
|
|
|
void setSelectedItems(QList<QGraphicsItem *> items);
|
|
|
|
|
QList<QGraphicsItem *> selectedItems();
|
|
|
|
|
|
|
|
|
|
void changeTool(Constants::DesignTool tool,
|
|
|
|
|
Constants::ToolFlags flags = Constants::NoToolFlags);
|
|
|
|
|
|
|
|
|
|
void clearHighlight();
|
2011-05-24 14:08:09 +02:00
|
|
|
void highlight(const QList<QGraphicsObject *> &item);
|
|
|
|
|
inline void highlight(QGraphicsObject *item)
|
|
|
|
|
{ highlight(QList<QGraphicsObject*>() << item); }
|
2010-07-30 12:56:25 +02:00
|
|
|
|
|
|
|
|
bool isEditorItem(QGraphicsItem *item) const;
|
|
|
|
|
|
2011-01-12 12:27:12 +01:00
|
|
|
public slots:
|
2010-07-30 12:56:25 +02:00
|
|
|
void _q_reloadView();
|
|
|
|
|
void _q_onStatusChanged(QDeclarativeView::Status status);
|
|
|
|
|
void _q_onCurrentObjectsChanged(QList<QObject*> objects);
|
|
|
|
|
void _q_applyChangesFromClient();
|
|
|
|
|
void _q_createQmlObject(const QString &qml, QObject *parent,
|
2011-05-24 11:40:17 +02:00
|
|
|
const QStringList &imports, const QString &filename = QString(), int order = 0);
|
2010-08-26 17:38:31 +02:00
|
|
|
void _q_reparentQmlObject(QObject *, QObject *);
|
2011-05-24 11:40:17 +02:00
|
|
|
void _q_deleteQmlObject(QObject *);
|
2010-07-30 12:56:25 +02:00
|
|
|
|
|
|
|
|
void _q_changeToSingleSelectTool();
|
|
|
|
|
void _q_changeToMarqueeSelectTool();
|
|
|
|
|
void _q_changeToZoomTool();
|
|
|
|
|
void _q_changeToColorPickerTool();
|
2010-08-03 14:07:30 +02:00
|
|
|
void _q_clearComponentCache();
|
2010-10-22 12:41:39 +02:00
|
|
|
void _q_removeFromSelection(QObject *);
|
2010-07-30 12:56:25 +02:00
|
|
|
|
2011-01-12 12:27:12 +01:00
|
|
|
public:
|
2011-05-30 16:32:25 +02:00
|
|
|
static QDeclarativeViewInspectorPrivate *get(QDeclarativeViewInspector *v) { return v->d_func(); }
|
2010-07-08 14:00:33 +02:00
|
|
|
};
|
|
|
|
|
|
2010-09-22 09:59:18 +02:00
|
|
|
} // namespace QmlJSDebugger
|
2010-07-08 14:00:33 +02:00
|
|
|
|
2011-05-30 16:32:25 +02:00
|
|
|
#endif // QDECLARATIVEVIEWINSPECTOR_P_H
|