Added delay button
This commit is contained in:
@@ -43,6 +43,7 @@ QVariant ButtonsModel::data(const QModelIndex &index, int role) const
|
||||
QString id = b.value("id").toString();
|
||||
QJsonObject action = b.value("action").toObject();
|
||||
QJsonObject feedback = b.value("feedback").toObject();
|
||||
QJsonObject trigger = b.value("trigger").toObject();
|
||||
RuntimeState rt = m_runtime.value(id);
|
||||
|
||||
switch (role) {
|
||||
@@ -67,6 +68,8 @@ QVariant ButtonsModel::data(const QModelIndex &index, int role) const
|
||||
case StatusRole: return rt.status;
|
||||
case StatusTextRole: return rt.text;
|
||||
case BtnColorRole: return b.value("color").toString("#7b007b");
|
||||
case TriggerModeRole: return trigger.value("mode").toString("hold");
|
||||
case HoldMsRole: return trigger.value("holdMs").toInt(800);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
@@ -86,7 +89,9 @@ QHash<int, QByteArray> ButtonsModel::roleNames() const
|
||||
{FadeMsRole, "fadeMs"},
|
||||
{StatusRole, "status"},
|
||||
{StatusTextRole, "statusText"},
|
||||
{BtnColorRole, "btnColor"}
|
||||
{BtnColorRole, "btnColor"},
|
||||
{TriggerModeRole, "triggerMode"},
|
||||
{HoldMsRole, "holdMs"}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user