From b9c5786bcda0fd48684c75b592d61bc427a9dba6 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Tue, 29 Sep 2009 11:17:24 +1000 Subject: Fix to not crash when viewing the value of a property that is a QObject* (in this case, a QmlXmlListModel_QML_1*). --- src/declarative/qml/qmlenginedebug.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarative/qml/qmlenginedebug.cpp b/src/declarative/qml/qmlenginedebug.cpp index 9f0bae6..16129ee 100644 --- a/src/declarative/qml/qmlenginedebug.cpp +++ b/src/declarative/qml/qmlenginedebug.cpp @@ -318,8 +318,8 @@ void QmlEngineDebugServer::propertyChanged(int id, int objectId, const QByteArra QByteArray reply; QVariant v; QDataStream rs(&reply, QIODevice::WriteOnly); - - if (value.type() == QVariant::UserType) { + + if (value.type() == QVariant::UserType || QmlMetaType::isObject(value.userType())) { QObject *o = QmlMetaType::toQObject(value); if (o) { QString objectName = o->objectName(); -- cgit v0.12 From 8e89f14c0321d96fdeffbd3153f87a43ee9966b6 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Tue, 29 Sep 2009 11:35:05 +1000 Subject: Use splitter to separate tree and property views. Helps with problems with viewing complex trees since the tree's horizontal scrollbar is not appearing either. --- tools/qmldebugger/engine.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/qmldebugger/engine.cpp b/tools/qmldebugger/engine.cpp index 8a06213..c9c98ce 100644 --- a/tools/qmldebugger/engine.cpp +++ b/tools/qmldebugger/engine.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -191,14 +192,13 @@ EnginePane::EnginePane(QmlDebugConnection *client, QWidget *parent) QObject::connect(query, SIGNAL(clicked()), this, SLOT(fetchClicked())); layout->addWidget(query); - QHBoxLayout *hbox = new QHBoxLayout; - hbox->setContentsMargins(0, 0, 0, 0); + QSplitter *splitter = new QSplitter; m_objTree = new QmlObjectTree(this); m_objTree->setHeaderHidden(true); connect(m_objTree, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, SLOT(itemClicked(QTreeWidgetItem *))); connect(m_objTree, SIGNAL(addExpressionWatch(int,QString)), this, SLOT(addExpressionWatch(int,QString))); - hbox->addWidget(m_objTree); + splitter->addWidget(m_objTree); m_propView = new PropertyView(this); connect(m_propView, SIGNAL(propertyActivated(QmlDebugPropertyReference)), @@ -218,10 +218,9 @@ EnginePane::EnginePane(QmlDebugConnection *client, QWidget *parent) m_tabs->addTab(m_propView, tr("Properties")); m_tabs->addTab(m_watchTable, tr("Watched")); - hbox->addWidget(m_tabs); - hbox->setStretchFactor(m_tabs, 2); - - layout->addLayout(hbox); + splitter->addWidget(m_tabs); + splitter->setStretchFactor(1, 2); + layout->addWidget(splitter); } void EnginePane::engineSelected(int id) -- cgit v0.12 From de7c740247b09332304e961b4e4ec8edbe4ee4f1 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Tue, 29 Sep 2009 11:49:45 +1000 Subject: Remove redundant "Fetch object" button and text field. --- tools/qmldebugger/engine.cpp | 14 -------------- tools/qmldebugger/engine.h | 2 -- 2 files changed, 16 deletions(-) diff --git a/tools/qmldebugger/engine.cpp b/tools/qmldebugger/engine.cpp index c9c98ce..fedae6b 100644 --- a/tools/qmldebugger/engine.cpp +++ b/tools/qmldebugger/engine.cpp @@ -184,14 +184,6 @@ EnginePane::EnginePane(QmlDebugConnection *client, QWidget *parent) layout->addWidget(m_engineView); - - m_text = new QLineEdit(this); - layout->addWidget(m_text); - - QPushButton *query = new QPushButton("Fetch object", this); - QObject::connect(query, SIGNAL(clicked()), this, SLOT(fetchClicked())); - layout->addWidget(query); - QSplitter *splitter = new QSplitter; m_objTree = new QmlObjectTree(this); @@ -457,12 +449,6 @@ void EnginePane::enginesChanged() m_engineView->rootContext()->setContextProperty("engines", qVariantFromValue(&m_engineItems)); } -void EnginePane::fetchClicked() -{ - int id = m_text->text().toInt(); - fetchObject(id); -} - void EnginePane::fetchObject(int id) { if (m_object) { diff --git a/tools/qmldebugger/engine.h b/tools/qmldebugger/engine.h index 8e5d384..62fc6fb 100644 --- a/tools/qmldebugger/engine.h +++ b/tools/qmldebugger/engine.h @@ -39,7 +39,6 @@ private slots: void queryContext(int); void contextChanged(); - void fetchClicked(); void fetchObject(int); void objectFetched(); @@ -66,7 +65,6 @@ private: QmlDebugRootContextQuery *m_context; QmlDebugObjectQuery *m_object; - QLineEdit *m_text; QmlObjectTree *m_objTree; QTabWidget *m_tabs; PropertyView *m_propView; -- cgit v0.12 From 4548dbc9c01b7f6262f441becd75402a0e570e10 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Tue, 29 Sep 2009 12:10:38 +1000 Subject: Don't call virtual setPosHelper during destruction --- src/gui/graphicsview/qgraphicsitem.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 81eeb39..aa90191 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -3121,6 +3121,9 @@ QPointF QGraphicsItem::pos() const */ void QGraphicsItem::setX(qreal x) { + if (d_ptr->inDestructor) + return; + d_ptr->setPosHelper(QPointF(x, d_ptr->pos.y())); } @@ -3142,6 +3145,9 @@ void QGraphicsItem::setX(qreal x) */ void QGraphicsItem::setY(qreal y) { + if (d_ptr->inDestructor) + return; + d_ptr->setPosHelper(QPointF(d_ptr->pos.x(), y)); } @@ -3164,6 +3170,7 @@ QPointF QGraphicsItem::scenePos() const void QGraphicsItemPrivate::setPosHelper(const QPointF &pos) { Q_Q(QGraphicsItem); + inSetPosHelper = 1; updateCachedClipPathFromSetPosHelper(pos); if (scene) @@ -3207,6 +3214,9 @@ void QGraphicsItem::setPos(const QPointF &pos) if (d_ptr->pos == pos) return; + if (d_ptr->inDestructor) + return; + // Update and repositition. if (!(d_ptr->flags & ItemSendsGeometryChanges)) { d_ptr->setPosHelper(pos); -- cgit v0.12