diff options
41 files changed, 182 insertions, 179 deletions
diff --git a/doc/src/declarative/modules.qdoc b/doc/src/declarative/modules.qdoc index 80d83a4..efca620 100644 --- a/doc/src/declarative/modules.qdoc +++ b/doc/src/declarative/modules.qdoc @@ -407,7 +407,7 @@ In case you have to create a qmltypes file manually or need to adjust an existing one, this is the file format: \qml -import QtQuick.tooling 1.0 +import QtQuick.tooling 1.1 // There always is a single Module object that contains all // Component objects. @@ -454,6 +454,8 @@ Module { isPointer: true // defaults to false: whether the type actually is a QDeclarativeListProperty<type> isList: true + // defaults to 0: the minor version that introduced this property + revision: 1 } Property { name: "loops"; type: "int" } Property { name: "name"; type: "string" } @@ -471,7 +473,7 @@ Module { // declarations also support the isReadonly, isPointer and isList // attributes which mean the same as for Property Method { name: "restart" } - Signal { name: "started" } + Signal { name: "started"; revision: 2 } Signal { name: "runningChanged" Parameter { type: "bool" } diff --git a/doc/src/declarative/qdeclarativestates.qdoc b/doc/src/declarative/qdeclarativestates.qdoc index 55f38c3..9857894 100644 --- a/doc/src/declarative/qdeclarativestates.qdoc +++ b/doc/src/declarative/qdeclarativestates.qdoc @@ -133,4 +133,26 @@ The \l {declarative/animation/states}{States and Transitions example} demonstrates how to declare a basic set of states and apply animated transitions between them. +\l{Using QML Behaviors with States} explains a common problem when using Behaviors +to animate state changes. + +\section1 State Fast Forwarding + +In order for Transition to correctly animate state changes, it is sometimes necessary +for the engine to fast forward and rewind a state (that is, internally set and unset the state) +before it is finally applied. The process is as follows: + +\list 1 +\o The state is fast forwarded to determine the complete set of end values. +\o The state is rewound. +\o The state is fully applied, with transitions. +\endlist + +In some cases this may cause unintended behavior. For example, a state that changes +a view's \i model or a Loader's \i sourceComponent will set these properties +multiple times (to apply, rewind, and then reapply), which can be relatively expensive. + +State fast forwarding should be considered an implementation detail, +and may change in later versions. + */ diff --git a/src/declarative/debugger/qjsdebuggeragent.cpp b/src/declarative/debugger/qjsdebuggeragent.cpp index 683032b..5fc64e1 100644 --- a/src/declarative/debugger/qjsdebuggeragent.cpp +++ b/src/declarative/debugger/qjsdebuggeragent.cpp @@ -511,27 +511,24 @@ void QJSDebuggerAgentPrivate::positionChange(qint64 scriptId, int lineNumber, in // check breakpoints if (!breakpoints.isEmpty()) { - QHash<qint64, QString>::const_iterator it = filenames.constFind(scriptId); - QScriptContext *ctx = engine()->currentContext(); - QScriptContextInfo info(ctx); - if (it == filenames.constEnd()) { - // It is possible that the scripts are loaded before the agent is attached - QString filename = info.fileName(); + const QScriptContext *ctx = engine()->currentContext(); + const QScriptContextInfo info(ctx); - JSAgentStackData frame; - frame.functionName = info.functionName().toUtf8(); - - QPair<QString, qint32> key = qMakePair(filename, lineNumber); - it = filenames.insert(scriptId, filename); - } + if (info.functionType() == QScriptContextInfo::ScriptFunction) { + QHash<qint64, QString>::const_iterator it = filenames.constFind(scriptId); + // It is possible that the scripts are loaded before the agent is attached + if (it == filenames.constEnd()) { + it = filenames.insert(scriptId, info.fileName()); + } - const QString filePath = it.value(); - JSAgentBreakpoints bps = fileNameToBreakpoints.values(fileName(filePath)).toSet(); + const QString filePath = it.value(); + const JSAgentBreakpoints bps = fileNameToBreakpoints.values(fileName(filePath)).toSet(); - foreach (const JSAgentBreakpointData &bp, bps) { - if (bp.lineNumber == lineNumber) { - stopped(); - return; + foreach (const JSAgentBreakpointData &bp, bps) { + if (bp.lineNumber == lineNumber) { + stopped(); + return; + } } } } diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp index 8f22314..8707a7f 100644 --- a/src/declarative/qml/qdeclarativeenginedebug.cpp +++ b/src/declarative/qml/qdeclarativeenginedebug.cpp @@ -147,12 +147,6 @@ QDeclarativeEngineDebugServer::propertyData(QObject *obj, int propIdx) if (binding) rv.binding = binding->expression(); - QVariant value; - if (prop.userType() != 0) { - value = prop.read(obj); - } - rv.value = valueContents(value); - if (QDeclarativeValueTypeFactory::isValueType(prop.userType())) { rv.type = QDeclarativeObjectProperty::Basic; } else if (QDeclarativeMetaType::isQObject(prop.userType())) { @@ -161,6 +155,12 @@ QDeclarativeEngineDebugServer::propertyData(QObject *obj, int propIdx) rv.type = QDeclarativeObjectProperty::List; } + QVariant value; + if (rv.type != QDeclarativeObjectProperty::Unknown && prop.userType() != 0) { + value = prop.read(obj); + } + rv.value = valueContents(value); + return rv; } diff --git a/src/declarative/qml/qdeclarativewatcher.cpp b/src/declarative/qml/qdeclarativewatcher.cpp index c174998..33f0358 100644 --- a/src/declarative/qml/qdeclarativewatcher.cpp +++ b/src/declarative/qml/qdeclarativewatcher.cpp @@ -47,6 +47,7 @@ #include <qdeclarativedebugservice_p.h> #include "private/qdeclarativeproperty_p.h" +#include "private/qdeclarativevaluetype_p.h" #include <QtCore/qmetaobject.h> #include <QtCore/qdebug.h> @@ -112,7 +113,7 @@ void QDeclarativeWatchProxy::notifyValueChanged() QVariant v; if (m_expr) v = m_expr->evaluate(); - else + else if (QDeclarativeValueTypeFactory::isValueType(m_property.userType())) v = m_property.read(m_object); emit m_watch->propertyChanged(m_id, m_debugId, m_property, v); diff --git a/src/declarative/util/qdeclarativebind.cpp b/src/declarative/util/qdeclarativebind.cpp index b7199ac..051df60 100644 --- a/src/declarative/util/qdeclarativebind.cpp +++ b/src/declarative/util/qdeclarativebind.cpp @@ -42,6 +42,7 @@ #include "private/qdeclarativebind_p.h" #include "private/qdeclarativenullablevalue_p_p.h" +#include "private/qdeclarativeguard_p.h" #include <qdeclarativeengine.h> #include <qdeclarativecontext.h> @@ -64,7 +65,7 @@ public: bool when : 1; bool componentComplete : 1; - QObject *obj; + QDeclarativeGuard<QObject> obj; QString prop; QDeclarativeNullableValue<QVariant> value; }; diff --git a/src/declarative/util/qdeclarativestategroup.cpp b/src/declarative/util/qdeclarativestategroup.cpp index a3f57d4..c098a38 100644 --- a/src/declarative/util/qdeclarativestategroup.cpp +++ b/src/declarative/util/qdeclarativestategroup.cpp @@ -73,6 +73,11 @@ public: static QDeclarativeState *at_state(QDeclarativeListProperty<QDeclarativeState> *list, int index); static void clear_states(QDeclarativeListProperty<QDeclarativeState> *list); + static void append_transition(QDeclarativeListProperty<QDeclarativeTransition> *list, QDeclarativeTransition *state); + static int count_transitions(QDeclarativeListProperty<QDeclarativeTransition> *list); + static QDeclarativeTransition *at_transition(QDeclarativeListProperty<QDeclarativeTransition> *list, int index); + static void clear_transitions(QDeclarativeListProperty<QDeclarativeTransition> *list); + QList<QDeclarativeState *> states; QList<QDeclarativeTransition *> transitions; @@ -218,7 +223,35 @@ void QDeclarativeStateGroupPrivate::clear_states(QDeclarativeListProperty<QDecla QDeclarativeListProperty<QDeclarativeTransition> QDeclarativeStateGroup::transitionsProperty() { Q_D(QDeclarativeStateGroup); - return QDeclarativeListProperty<QDeclarativeTransition>(this, d->transitions); + return QDeclarativeListProperty<QDeclarativeTransition>(this, &d->transitions, &QDeclarativeStateGroupPrivate::append_transition, + &QDeclarativeStateGroupPrivate::count_transitions, + &QDeclarativeStateGroupPrivate::at_transition, + &QDeclarativeStateGroupPrivate::clear_transitions); +} + +void QDeclarativeStateGroupPrivate::append_transition(QDeclarativeListProperty<QDeclarativeTransition> *list, QDeclarativeTransition *trans) +{ + QDeclarativeStateGroup *_this = static_cast<QDeclarativeStateGroup *>(list->object); + if (trans) + _this->d_func()->transitions.append(trans); +} + +int QDeclarativeStateGroupPrivate::count_transitions(QDeclarativeListProperty<QDeclarativeTransition> *list) +{ + QDeclarativeStateGroup *_this = static_cast<QDeclarativeStateGroup *>(list->object); + return _this->d_func()->transitions.count(); +} + +QDeclarativeTransition *QDeclarativeStateGroupPrivate::at_transition(QDeclarativeListProperty<QDeclarativeTransition> *list, int index) +{ + QDeclarativeStateGroup *_this = static_cast<QDeclarativeStateGroup *>(list->object); + return _this->d_func()->transitions.at(index); +} + +void QDeclarativeStateGroupPrivate::clear_transitions(QDeclarativeListProperty<QDeclarativeTransition> *list) +{ + QDeclarativeStateGroup *_this = static_cast<QDeclarativeStateGroup *>(list->object); + _this->d_func()->transitions.clear(); } /*! diff --git a/src/plugins/qmltooling/qmldbg_inspector/abstractviewinspector.cpp b/src/plugins/qmltooling/qmldbg_inspector/abstractviewinspector.cpp index 3323d54..abd78f9 100644 --- a/src/plugins/qmltooling/qmldbg_inspector/abstractviewinspector.cpp +++ b/src/plugins/qmltooling/qmldbg_inspector/abstractviewinspector.cpp @@ -42,7 +42,6 @@ #include "abstractviewinspector.h" #include "abstracttool.h" -#include "editor/qmltoolbar.h" #include "qdeclarativeinspectorprotocol.h" #include <QtDeclarative/QDeclarativeEngine> @@ -52,55 +51,12 @@ #include <QtGui/QVBoxLayout> #include <QtGui/QMouseEvent> -#include <QtCore/QSettings> - -static inline void initEditorResource() { Q_INIT_RESOURCE(editor); } +#include <QtGui/QWidget> namespace QmlJSDebugger { -const char * const KEY_TOOLBOX_GEOMETRY = "toolBox/geometry"; - - -class ToolBox : public QWidget -{ - Q_OBJECT - -public: - ToolBox(QWidget *parent = 0); - ~ToolBox(); - - QmlToolBar *toolBar() const { return m_toolBar; } - -private: - QSettings m_settings; - QmlToolBar *m_toolBar; -}; - -ToolBox::ToolBox(QWidget *parent) - : QWidget(parent, Qt::Tool) - , m_settings(QLatin1String("Nokia"), QLatin1String("QmlInspector"), this) - , m_toolBar(new QmlToolBar) -{ - setWindowFlags((windowFlags() & ~Qt::WindowCloseButtonHint) | Qt::CustomizeWindowHint); - setWindowTitle(tr("Qt Quick Toolbox")); - - QVBoxLayout *verticalLayout = new QVBoxLayout; - verticalLayout->setMargin(0); - verticalLayout->addWidget(m_toolBar); - setLayout(verticalLayout); - - restoreGeometry(m_settings.value(QLatin1String(KEY_TOOLBOX_GEOMETRY)).toByteArray()); -} - -ToolBox::~ToolBox() -{ - m_settings.setValue(QLatin1String(KEY_TOOLBOX_GEOMETRY), saveGeometry()); -} - - AbstractViewInspector::AbstractViewInspector(QObject *parent) : QObject(parent), - m_toolBox(0), m_currentTool(0), m_showAppOnTop(false), m_designModeBehavior(false), @@ -108,8 +64,6 @@ AbstractViewInspector::AbstractViewInspector(QObject *parent) : m_slowDownFactor(1.0), m_debugService(0) { - initEditorResource(); - m_debugService = QDeclarativeInspectorService::instance(); connect(m_debugService, SIGNAL(gotMessage(QByteArray)), this, SLOT(handleMessage(QByteArray))); @@ -214,59 +168,6 @@ void AbstractViewInspector::setShowAppOnTop(bool appOnTop) emit showAppOnTopChanged(appOnTop); } -void AbstractViewInspector::setToolBoxVisible(bool visible) -{ -#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR) - if (!m_toolBox && visible) - createToolBox(); - if (m_toolBox) - m_toolBox->setVisible(visible); -#else - Q_UNUSED(visible) -#endif -} - -void AbstractViewInspector::createToolBox() -{ - m_toolBox = new ToolBox(viewWidget()); - - QmlToolBar *toolBar = m_toolBox->toolBar(); - - QObject::connect(this, SIGNAL(selectedColorChanged(QColor)), - toolBar, SLOT(setColorBoxColor(QColor))); - - QObject::connect(this, SIGNAL(designModeBehaviorChanged(bool)), - toolBar, SLOT(setDesignModeBehavior(bool))); - - QObject::connect(toolBar, SIGNAL(designModeBehaviorChanged(bool)), - this, SLOT(setDesignModeBehavior(bool))); - QObject::connect(toolBar, SIGNAL(animationSpeedChanged(qreal)), this, SLOT(setAnimationSpeed(qreal))); - QObject::connect(toolBar, SIGNAL(animationPausedChanged(bool)), this, SLOT(setAnimationPaused(bool))); - QObject::connect(toolBar, SIGNAL(colorPickerSelected()), this, SLOT(changeToColorPickerTool())); - QObject::connect(toolBar, SIGNAL(zoomToolSelected()), this, SLOT(changeToZoomTool())); - QObject::connect(toolBar, SIGNAL(selectToolSelected()), this, SLOT(changeToSingleSelectTool())); - QObject::connect(toolBar, SIGNAL(marqueeSelectToolSelected()), - this, SLOT(changeToMarqueeSelectTool())); - - QObject::connect(toolBar, SIGNAL(applyChangesFromQmlFileSelected()), - this, SLOT(applyChangesFromClient())); - - QObject::connect(this, SIGNAL(animationSpeedChanged(qreal)), toolBar, SLOT(setAnimationSpeed(qreal))); - QObject::connect(this, SIGNAL(animationPausedChanged(bool)), toolBar, SLOT(setAnimationPaused(bool))); - - QObject::connect(this, SIGNAL(selectToolActivated()), toolBar, SLOT(activateSelectTool())); - - // disabled features - //connect(d->m_toolBar, SIGNAL(applyChangesToQmlFileSelected()), SLOT(applyChangesToClient())); - //connect(q, SIGNAL(resizeToolActivated()), d->m_toolBar, SLOT(activateSelectTool())); - //connect(q, SIGNAL(moveToolActivated()), d->m_toolBar, SLOT(activateSelectTool())); - - QObject::connect(this, SIGNAL(colorPickerActivated()), toolBar, SLOT(activateColorPicker())); - QObject::connect(this, SIGNAL(zoomToolActivated()), toolBar, SLOT(activateZoom())); - QObject::connect(this, SIGNAL(marqueeSelectToolActivated()), - toolBar, SLOT(activateMarqueeSelectTool())); -} - void AbstractViewInspector::changeToColorPickerTool() { changeTool(InspectorProtocol::ColorPickerTool); @@ -608,4 +509,3 @@ QString AbstractViewInspector::idStringForObject(QObject *obj) const } // namespace QmlJSDebugger -#include "abstractviewinspector.moc" diff --git a/src/plugins/qmltooling/qmldbg_inspector/abstractviewinspector.h b/src/plugins/qmltooling/qmldbg_inspector/abstractviewinspector.h index 7202bcc..07a52f3 100644 --- a/src/plugins/qmltooling/qmldbg_inspector/abstractviewinspector.h +++ b/src/plugins/qmltooling/qmldbg_inspector/abstractviewinspector.h @@ -61,7 +61,6 @@ QT_END_NAMESPACE namespace QmlJSDebugger { class AbstractTool; -class ToolBox; /* * The common code between QSGView and QDeclarativeView inspectors lives here, @@ -157,10 +156,6 @@ private: void animationSpeedChangeRequested(qreal factor); void animationPausedChangeRequested(bool paused); - void setToolBoxVisible(bool visible); - void createToolBox(); - - ToolBox *m_toolBox; AbstractTool *m_currentTool; bool m_showAppOnTop; diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp index 72e1380..efb5471 100644 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp @@ -75,7 +75,9 @@ void ColorPickerTool::mouseMoveEvent(QMouseEvent *event) void ColorPickerTool::clear() { +#ifndef QT_NO_CURSOR view()->setCursor(Qt::CrossCursor); +#endif } void ColorPickerTool::pickColor(const QPoint &pos) diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/editor.qrc b/src/plugins/qmltooling/qmldbg_inspector/editor/editor.qrc deleted file mode 100644 index fb2393c..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/editor.qrc +++ /dev/null @@ -1,24 +0,0 @@ -<RCC> - <qresource prefix="/qml"> - <file>images/resize_handle.png</file> - <file>images/select.png</file> - <file>images/select-marquee.png</file> - <file>images/color-picker.png</file> - <file>images/play.png</file> - <file>images/pause.png</file> - <file>images/from-qml.png</file> - <file>images/to-qml.png</file> - <file>images/color-picker-hicontrast.png</file> - <file>images/zoom.png</file> - <file>images/color-picker-24.png</file> - <file>images/from-qml-24.png</file> - <file>images/pause-24.png</file> - <file>images/play-24.png</file> - <file>images/to-qml-24.png</file> - <file>images/zoom-24.png</file> - <file>images/select-24.png</file> - <file>images/select-marquee-24.png</file> - <file>images/inspectormode.png</file> - <file>images/inspectormode-24.png</file> - </qresource> -</RCC> diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker-24.png Binary files differdeleted file mode 100644 index cff4721..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker-24.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker-hicontrast.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker-hicontrast.png Binary files differdeleted file mode 100644 index b953d08..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker-hicontrast.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker.png Binary files differdeleted file mode 100644 index 026c31b..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/color-picker.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/from-qml-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/from-qml-24.png Binary files differdeleted file mode 100644 index 0ad21f3..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/from-qml-24.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/from-qml.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/from-qml.png Binary files differdeleted file mode 100644 index 666382c..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/from-qml.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/inspectormode-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/inspectormode-24.png Binary files differdeleted file mode 100644 index 5e74d86..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/inspectormode-24.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/inspectormode.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/inspectormode.png Binary files differdeleted file mode 100644 index daed21c..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/inspectormode.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/pause-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/pause-24.png Binary files differdeleted file mode 100644 index d9a2f6f..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/pause-24.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/pause.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/pause.png Binary files differdeleted file mode 100644 index 114d89b..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/pause.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/play-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/play-24.png Binary files differdeleted file mode 100644 index e2b9fbc..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/play-24.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/play.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/play.png Binary files differdeleted file mode 100644 index 011598a..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/play.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/reload.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/reload.png Binary files differdeleted file mode 100644 index 7042bec..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/reload.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/resize_handle.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/resize_handle.png Binary files differdeleted file mode 100644 index 2934f25..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/resize_handle.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-24.png Binary files differdeleted file mode 100644 index 5388a9d..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-24.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-marquee-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-marquee-24.png Binary files differdeleted file mode 100644 index 0111dda..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-marquee-24.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-marquee.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-marquee.png Binary files differdeleted file mode 100644 index 92fe40d..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/select-marquee.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/select.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/select.png Binary files differdeleted file mode 100644 index 6722855..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/select.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/to-qml-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/to-qml-24.png Binary files differdeleted file mode 100644 index b72450d..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/to-qml-24.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/to-qml.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/to-qml.png Binary files differdeleted file mode 100644 index 2ab951f..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/to-qml.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/zoom-24.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/zoom-24.png Binary files differdeleted file mode 100644 index 0346200..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/zoom-24.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/images/zoom.png b/src/plugins/qmltooling/qmldbg_inspector/editor/images/zoom.png Binary files differdeleted file mode 100644 index 17f0da6..0000000 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/images/zoom.png +++ /dev/null diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp index 6085d81..3b2493a 100644 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp @@ -363,7 +363,9 @@ void LiveSelectionTool::setSelectOnlyContentItems(bool selectOnlyContentItems) void LiveSelectionTool::clear() { +#ifndef QT_NO_CURSOR view()->setCursor(Qt::ArrowCursor); +#endif m_rubberbandSelectionManipulator.clear(), m_singleSelectionManipulator.clear(); m_selectionIndicator.clear(); diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool.cpp index c8ade82..b66bc14 100644 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool.cpp +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool.cpp @@ -244,7 +244,9 @@ void ZoomTool::keyReleaseEvent(QKeyEvent *event) void ZoomTool::clear() { +#ifndef QT_NO_CURSOR view()->setCursor(Qt::ArrowCursor); +#endif } void ZoomTool::scaleView(const QPointF ¢erPos) diff --git a/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro b/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro index 0116441..e441a78 100644 --- a/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro +++ b/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro @@ -21,8 +21,6 @@ SOURCES += \ editor/subcomponentmasklayeritem.cpp \ editor/zoomtool.cpp \ editor/colorpickertool.cpp \ - editor/qmltoolbar.cpp \ - editor/toolbarcolorbox.cpp \ abstracttool.cpp HEADERS += \ @@ -43,12 +41,8 @@ HEADERS += \ editor/subcomponentmasklayeritem.h \ editor/zoomtool.h \ editor/colorpickertool.h \ - editor/qmltoolbar.h \ - editor/toolbarcolorbox.h \ abstracttool.h -RESOURCES += editor/editor.qrc - target.path += $$[QT_INSTALL_PLUGINS]/qmltooling INSTALLS += target diff --git a/tests/auto/declarative/qdeclarativeanimations/data/transitionAssignmentBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/transitionAssignmentBug.qml new file mode 100644 index 0000000..99b9ac5 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeanimations/data/transitionAssignmentBug.qml @@ -0,0 +1,12 @@ +import QtQuick 1.0 + +Rectangle { + width: 400 + height: 400 + + property bool nullObject + Component.onCompleted: nullObject = transitions.length > 0 && transitions[0] === null + + property list<Transition> myTransitions: [Transition {}, Transition {}] + transitions: myTransitions +} diff --git a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp index 00db2d4..5d90597 100644 --- a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp +++ b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp @@ -88,6 +88,7 @@ private slots: void registrationBug(); void doubleRegistrationBug(); void alwaysRunToEndRestartBug(); + void transitionAssignmentBug(); }; #define QTIMED_COMPARE(lhs, rhs) do { \ @@ -844,6 +845,18 @@ void tst_qdeclarativeanimations::alwaysRunToEndRestartBug() QCOMPARE(static_cast<QDeclarativeAbstractAnimation*>(&animation)->qtAnimation()->state(), QAbstractAnimation::Stopped); } +//QTBUG-20227 +void tst_qdeclarativeanimations::transitionAssignmentBug() +{ + QDeclarativeEngine engine; + + QDeclarativeComponent c(&engine, SRCDIR "/data/transitionAssignmentBug.qml"); + QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QVERIFY(rect != 0); + + QCOMPARE(rect->property("nullObject").toBool(), false); +} + QTEST_MAIN(tst_qdeclarativeanimations) #include "tst_qdeclarativeanimations.moc" diff --git a/tests/auto/declarative/qdeclarativebinding/data/deletedObject.qml b/tests/auto/declarative/qdeclarativebinding/data/deletedObject.qml new file mode 100644 index 0000000..ba4c9f6 --- /dev/null +++ b/tests/auto/declarative/qdeclarativebinding/data/deletedObject.qml @@ -0,0 +1,24 @@ +import QtQuick 1.0 + +Rectangle { + id: wrapper + width: 400 + height: 400 + + property bool activateBinding: false + + Binding { + id: binding + target: Qt.createQmlObject('import QtQuick 1.0; Item { property real value: 10 }', wrapper) + property: "value" + when: activateBinding + value: x + y + } + + Component.onCompleted: binding.target.destroy(); + +// MouseArea { +// anchors.fill: parent +// onClicked: activateBinding = true; +// } +} diff --git a/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp b/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp index 6305cd3..ca394b0 100644 --- a/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp +++ b/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp @@ -60,6 +60,7 @@ public: private slots: void binding(); void whenAfterValue(); + void deletedObject(); private: QDeclarativeEngine engine; @@ -113,6 +114,22 @@ void tst_qdeclarativebinding::whenAfterValue() delete rect; } +//QTBUG-20692 +void tst_qdeclarativebinding::deletedObject() +{ + QDeclarativeEngine engine; + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/deletedObject.qml")); + QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QVERIFY(rect != 0); + + QApplication::sendPostedEvents(0, QEvent::DeferredDelete); + + //don't crash + rect->setProperty("activateBinding", true); + + delete rect; +} + QTEST_MAIN(tst_qdeclarativebinding) #include "tst_qdeclarativebinding.moc" diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index 4b0f2d5..f9961bc 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -1393,6 +1393,7 @@ void QDeclarativeViewer::appAboutToQuit() loggerWindow = 0; delete tester; tester = 0; + close(); } void QDeclarativeViewer::autoStartRecording() diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index ae06d02..6bef8d4 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -147,7 +147,7 @@ QByteArray convertToId(const QByteArray &cppName) return cppToId.value(cppName, cppName); } -QSet<const QMetaObject *> collectReachableMetaObjects(const QString &importCode, QDeclarativeEngine *engine) +QSet<const QMetaObject *> collectReachableMetaObjects(const QList<QDeclarativeType *> &skip = QList<QDeclarativeType *>()) { QSet<const QMetaObject *> metas; metas.insert(FriendlyQObject::qtMeta()); @@ -195,7 +195,9 @@ QSet<const QMetaObject *> collectReachableMetaObjects(const QString &importCode, // find even more QMetaObjects by instantiating QML types and running // over the instances - foreach (const QDeclarativeType *ty, QDeclarativeMetaType::qmlTypes()) { + foreach (QDeclarativeType *ty, QDeclarativeMetaType::qmlTypes()) { + if (skip.contains(ty)) + continue; if (ty->isExtendedType()) continue; if (!ty->isCreatable()) @@ -208,21 +210,14 @@ QSet<const QMetaObject *> collectReachableMetaObjects(const QString &importCode, if (tyName.isEmpty()) continue; - QByteArray code = importCode.toUtf8(); - code += tyName; - code += " {}\n"; - - QDeclarativeComponent c(engine); - c.setData(code, QUrl::fromLocalFile(pluginImportPath + "/typeinstance.qml")); - inObjectInstantiation = tyName; - QObject *object = c.create(); + QObject *object = ty->create(); inObjectInstantiation.clear(); if (object) collectReachableMetaObjects(object, &metas); else - qWarning() << "Could not create" << tyName << ":" << c.errorString(); + qWarning() << "Could not create" << tyName; } return metas; @@ -548,8 +543,8 @@ int main(int argc, char *argv[]) } // find all QMetaObjects reachable from the builtin module - QByteArray importCode("import QtQuick 1.0\n"); - QSet<const QMetaObject *> defaultReachable = collectReachableMetaObjects(importCode, engine); + QSet<const QMetaObject *> defaultReachable = collectReachableMetaObjects(); + QList<QDeclarativeType *> defaultTypes = QDeclarativeMetaType::qmlTypes(); // this will hold the meta objects we want to dump information of QSet<const QMetaObject *> metas; @@ -557,6 +552,20 @@ int main(int argc, char *argv[]) if (action == Builtins) { metas = defaultReachable; } else { + // find a valid QtQuick import + QByteArray importCode; + QDeclarativeType *qtObjectType = QDeclarativeMetaType::qmlType(&QObject::staticMetaObject); + if (!qtObjectType) { + qWarning() << "Could not find QtObject type"; + importCode = QByteArray("import QtQuick 1.0\n"); + } else { + QByteArray module = qtObjectType->qmlTypeName(); + module = module.mid(0, module.lastIndexOf('/')); + importCode = QString("import %1 %2.%3\n").arg(module, + QString::number(qtObjectType->majorVersion()), + QString::number(qtObjectType->minorVersion())).toUtf8(); + } + // find all QMetaObjects reachable when the specified module is imported if (action != Path) { importCode += QString("import %0 %1\n").arg(pluginImportUri, pluginImportVersion).toAscii(); @@ -581,7 +590,7 @@ int main(int argc, char *argv[]) } } - QSet<const QMetaObject *> candidates = collectReachableMetaObjects(importCode, engine); + QSet<const QMetaObject *> candidates = collectReachableMetaObjects(defaultTypes); candidates.subtract(defaultReachable); // Also eliminate meta objects with the same classname. |