forked from qt-creator/qt-creator
QmlDesigner: Add lock functionality to navigator
* Update icon font and change related theme and constants files * Add locked column to Navigator * Add auxiliary property "locked" * Integrate locked feature into the following components: * Transition Editor * Connection Editor * Form Editor * Text Editor * Timeline * Navigator * State Editor Task-number: QDS-826 Change-Id: Ibf3ae96e0d5daeb1ab00279b94df5aaabe75e0bb Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
committed by
Henning Gründl
parent
15f39cf37c
commit
2860e57112
@@ -36,6 +36,8 @@
|
||||
#include <variantproperty.h>
|
||||
#include <signalhandlerproperty.h>
|
||||
|
||||
#include <QTableView>
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
namespace Internal {
|
||||
@@ -162,6 +164,33 @@ void ConnectionView::selectedNodesChanged(const QList<ModelNode> & selectedNodeL
|
||||
emit connectionViewWidget()->setEnabledAddButton(selectedNodeList.count() == 1);
|
||||
}
|
||||
|
||||
void ConnectionView::auxiliaryDataChanged(const ModelNode &node,
|
||||
const PropertyName &name,
|
||||
const QVariant &data)
|
||||
{
|
||||
Q_UNUSED(node)
|
||||
|
||||
// Check if the auxiliary data is actually the locked property or if it is unlocked
|
||||
if (name != QmlDesigner::lockedProperty || !data.toBool())
|
||||
return;
|
||||
|
||||
QItemSelectionModel *selectionModel = connectionTableView()->selectionModel();
|
||||
if (!selectionModel->hasSelection())
|
||||
return;
|
||||
|
||||
QModelIndex modelIndex = selectionModel->currentIndex();
|
||||
if (!modelIndex.isValid() || !model())
|
||||
return;
|
||||
|
||||
const int internalId = connectionModel()->data(connectionModel()->index(modelIndex.row(),
|
||||
ConnectionModel::TargetModelNodeRow),
|
||||
ConnectionModel::UserRoles::InternalIdRole).toInt();
|
||||
ModelNode modelNode = modelNodeForInternalId(internalId);
|
||||
|
||||
if (modelNode.isValid() && ModelNode::isThisOrAncestorLocked(modelNode))
|
||||
selectionModel->clearSelection();
|
||||
}
|
||||
|
||||
void ConnectionView::importsChanged(const QList<Import> & /*addedImports*/, const QList<Import> & /*removedImports*/)
|
||||
{
|
||||
backendModel()->resetModel();
|
||||
|
||||
Reference in New Issue
Block a user