| 338 | }; |
| 339 | |
| 340 | void MIVariable::formatChanged() |
| 341 | { |
| 342 | if(childCount()) |
| 343 | { |
| 344 | for (TreeItem* item : std::as_const(childItems)) { |
| 345 | Q_ASSERT(dynamic_cast<MIVariable*>(item)); |
| 346 | if (auto* var = qobject_cast<MIVariable*>(item)) { |
| 347 | var->setFormat(format()); |
| 348 | } |
| 349 | } |
| 350 | return; |
| 351 | } |
| 352 | |
| 353 | if (m_varobj.isEmpty() || !sessionIsAlive()) { |
| 354 | return; |
| 355 | } |
| 356 | |
| 357 | constexpr auto commandType = VarSetFormat; |
| 358 | QString arguments = m_varobj + QLatin1Char{' '} + format2str(format()); |
| 359 | if (auto customHandler = handlerOfSetFormatCommand()) |
| 360 | m_debugSession->addCommand(commandType, std::move(arguments), std::move(customHandler)); |
| 361 | else { |
| 362 | m_debugSession->addCommand(commandType, std::move(arguments), new SetFormatHandler(this)); |
| 363 | } |
| 364 | } |
| 365 | |
| 366 | QString MIVariable::formatValue(const QString &rawValue) const |
| 367 | { |
no test coverage detected