void QDeclarativeViewInspectorPrivate::_q_removeFromSelection(QObject *obj)
{
    QList<QGraphicsItem*> items = selectedItems();
    if (QGraphicsItem *item = qobject_cast<QGraphicsObject*>(obj))
        items.removeOne(item);
    setSelectedItems(items);
}
Example #2
0
void QQuickViewInspector::reloadQmlFile(const QHash<QString, QByteArray> &changesHash)
{
    clearComponentCache();

    // Reset the selection since we are reloading the main qml
    setSelectedItems(QList<QQuickItem *>());

    QQmlDebugService::clearObjectsFromHash();

    QHash<QUrl, QByteArray> debugCache;

    foreach (const QString &str, changesHash.keys())
        debugCache.insert(QUrl(str), changesHash.value(str, QByteArray()));

    // Updating the cache in engine private such that the QML Data loader
    // gets the changes from the cache.
    QQmlEnginePrivate::get(declarativeEngine())->setDebugChangesCache(debugCache);

    m_sendQmlReloadedMessage = true;
    // reloading the view such that the changes done for the files are
    // reflected in view
    view()->setSource(view()->source());
}
void QDeclarativeViewInspectorPrivate::clearEditorItems()
{
    clearHighlight();
    setSelectedItems(QList<QGraphicsItem*>());
}