| 237 | } |
| 238 | |
| 239 | void QuickInspectorWidget::itemModelDataChanged(const QModelIndex &topLeft, |
| 240 | const QModelIndex &bottomRight, |
| 241 | const QVector<int> &roles) |
| 242 | { |
| 243 | if (!roles.contains(QuickItemModelRole::ItemEvent)) |
| 244 | return; |
| 245 | |
| 246 | for (int i = topLeft.row(); i <= bottomRight.row(); i++) { |
| 247 | const QModelIndex index = ui->itemTreeView->model()->index(i, 0, topLeft.parent()); |
| 248 | const auto state = index.data(RemoteModelRole::LoadingState).value<RemoteModelNodeState::NodeStates>(); |
| 249 | if (state & RemoteModelNodeState::Empty || ~state & RemoteModelNodeState::Outdated) |
| 250 | continue; |
| 251 | |
| 252 | auto *colorAnimation = new QVariantAnimation(this); |
| 253 | QPersistentModelIndex persistentIndex(index); |
| 254 | connect(colorAnimation, &QVariantAnimation::valueChanged, |
| 255 | ui->itemTreeView->itemDelegate(), [persistentIndex, this](const QVariant &value) { |
| 256 | qobject_cast<QuickItemDelegate *>(ui->itemTreeView->itemDelegate())->setTextColor(value, persistentIndex); |
| 257 | }); |
| 258 | colorAnimation->setStartValue(QColor(129, 0, 129)); |
| 259 | colorAnimation->setEndValue(QColor(129, 0, 129, 0)); |
| 260 | colorAnimation->setDuration(2000); |
| 261 | colorAnimation->start(QAbstractAnimation::DeleteWhenStopped); |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | void QuickInspectorUiFactory::initUi() |
| 266 | { |