forked from qt-creator/qt-creator
QmlJSInspector: Set property values
QML property values could be set in the inspector.
Regression introduced by 7f09d0b756.
This patch is a partial fix. Only values can be assigned currently.
For expressions, use the console.
Change-Id: I945b11109cd7788dd0f5277af206bf9658844aee
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -1139,12 +1139,13 @@ Qt::ItemFlags WatchModel::flags(const QModelIndex &idx) const
|
||||
= Qt::ItemIsSelectable | Qt::ItemIsEnabled;
|
||||
static const Qt::ItemFlags editable = notEditable | Qt::ItemIsEditable;
|
||||
|
||||
// Disable editing if debuggee is positively running.
|
||||
// Disable editing if debuggee is positively running except for Inspector data
|
||||
const WatchData &data = *watchItem(idx);
|
||||
const bool isRunning = engine() && engine()->state() == InferiorRunOk;
|
||||
if (isRunning && engine() && !engine()->hasCapability(AddWatcherWhileRunningCapability))
|
||||
if (isRunning && engine() && !engine()->hasCapability(AddWatcherWhileRunningCapability) &&
|
||||
!data.isInspect())
|
||||
return notEditable;
|
||||
|
||||
const WatchData &data = *watchItem(idx);
|
||||
if (data.isWatcher()) {
|
||||
if (idx.column() == 0 && data.iname.count('.') == 1)
|
||||
return editable; // Watcher names are editable.
|
||||
@@ -1159,6 +1160,9 @@ Qt::ItemFlags WatchModel::flags(const QModelIndex &idx) const
|
||||
} else if (data.isLocal()) {
|
||||
if (idx.column() == 1 && data.valueEditable)
|
||||
return editable; // Locals values are sometimes editable.
|
||||
} else if (data.isInspect()) {
|
||||
if (idx.column() == 1 && data.valueEditable)
|
||||
return editable; // Inspector values are sometimes editable.
|
||||
}
|
||||
return notEditable;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user