Merge PR #378: Improve attached properties in scripting code completion
This commit is contained in:
commit
589a2a40f8
@ -513,7 +513,7 @@ void CodeCompletion::update()
|
||||
}
|
||||
// Always append attached class names
|
||||
foreach (const QString &s, m_attachedClasses.keys()) {
|
||||
entries.append(CompletionModel::Entry(s, s, "type"));
|
||||
entries.append(CompletionModel::Entry(s, s, "attachedProperty"));
|
||||
}
|
||||
|
||||
// Add generic qml syntax
|
||||
|
||||
@ -138,7 +138,7 @@ bool CompletionProxyModel::lessThan(const QModelIndex &source_left, const QModel
|
||||
CompletionModel::Entry left = m_model->get(source_left.row());
|
||||
CompletionModel::Entry right = m_model->get(source_right.row());
|
||||
|
||||
static QStringList ordering = {"property", "method", "event", "type", "keyword" };
|
||||
static QStringList ordering = {"property", "method", "event", "type", "attachedProperty", "keyword" };
|
||||
|
||||
int leftOrder = ordering.indexOf(left.decoration);
|
||||
int rightOrder = ordering.indexOf(right.decoration);
|
||||
|
||||
@ -142,6 +142,8 @@ Rectangle {
|
||||
return "yellow";
|
||||
case "property":
|
||||
return "#ff5555";
|
||||
case "attachedProperty":
|
||||
return "orange"
|
||||
case "method":
|
||||
return "blue";
|
||||
case "event":
|
||||
|
||||
Reference in New Issue
Block a user