添加check说明功能

This commit is contained in:
2020-06-24 17:04:15 +08:00
parent 9946e39ee4
commit 0f8f3558f5
17 changed files with 437 additions and 39 deletions
+36 -1
View File
@@ -197,7 +197,42 @@ void CommandUI::loadCommandJson(const QString& jsonFilename)
}
void CommandUI::commandAccepted(bool flag,uint16_t command,uint8_t result)
{
//找到消息的发送者
QObjectList list = ui->groupBox_Command->children();
for(QJsonValue info: CMD_infoArray) {
if (!info.isObject()) {
return;
}
if(command == info.toObject().find(_commandJsonKey).value().toInt())
{
foreach (QObject *obj, list)
{
QPushButton *btn = qobject_cast<QPushButton *>(obj);
if(btn)
{
if(btn->text() == info.toObject().find(_TextJsonKey).value().toString())
{
if(flag)
{
btn->setProperty("state",state::success);
}
else
{
btn->setProperty("state",state::failure);
}
btn->style()->unpolish(btn);
btn->style()->polish(btn);
}
}
}
}
}
}
+5
View File
@@ -37,6 +37,11 @@ public:
explicit CommandUI(QWidget *parent = nullptr);
~CommandUI();
public slots:
void commandAccepted(bool flag,uint16_t command,uint8_t result);
signals: