Help for qml inspector (with F1), namespace fixes

This commit is contained in:
Lasse Holmstedt
2010-03-22 11:39:14 +01:00
parent ddf421482c
commit 0b010954ad
15 changed files with 196 additions and 47 deletions

View File

@@ -27,12 +27,15 @@
**
**************************************************************************/
#include "objectpropertiesview.h"
#include "inspectorcontext.h"
#include <QtCore/QDebug>
#include <QtGui/QTreeWidget>
#include <QtGui/QLayout>
#include <QtGui/QHeaderView>
namespace Qml {
namespace Internal {
class PropertiesViewItem : public QObject, public QTreeWidgetItem
@@ -81,6 +84,7 @@ ObjectPropertiesView::ObjectPropertiesView(QDeclarativeEngineDebug *client, QWid
<< tr("Name") << tr("Value") << tr("Type"));
QObject::connect(m_tree, SIGNAL(itemActivated(QTreeWidgetItem *, int)),
this, SLOT(itemActivated(QTreeWidgetItem *)));
connect(m_tree, SIGNAL(itemSelectionChanged()), SLOT(changeItemSelection()));
m_tree->setColumnCount(3);
m_tree->header()->setDefaultSectionSize(150);
@@ -88,6 +92,16 @@ ObjectPropertiesView::ObjectPropertiesView(QDeclarativeEngineDebug *client, QWid
layout->addWidget(m_tree);
}
void ObjectPropertiesView::changeItemSelection()
{
if (m_tree->selectedItems().isEmpty())
return;
QString item = m_object.className();
QString prop = m_tree->selectedItems().first()->text(0);
emit contextHelpIdChanged(InspectorContext::contextHelpIdForProperty(item, prop));
}
void ObjectPropertiesView::setEngineDebug(QDeclarativeEngineDebug *client)
{
m_client = client;
@@ -254,4 +268,7 @@ void ObjectPropertiesView::itemActivated(QTreeWidgetItem *i)
emit activated(m_object, item->property);
}
}
}
#include "objectpropertiesview.moc"