MCPcopy Create free account
hub / github.com/KDE/kdevelop / applyOrderToLayout

Method applyOrderToLayout

kdevplatform/sublime/idealbuttonbarwidget.cpp:523–541  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

521}
522
523void IdealButtonBarWidget::applyOrderToLayout()
524{
525 // If widget already have some buttons in the layout then calling loadOrderSettings() may leads
526 // to situations when loaded order does not contains all existing buttons. Therefore we should
527 // fix this with using addToOrder() method.
528 for (int i = 0; i < m_buttonsLayout->count(); ++i) {
529 if (auto button = qobject_cast<IdealToolButton*>(m_buttonsLayout->itemAt(i)->widget())) {
530 addButtonToOrder(button);
531 m_buttonsLayout->removeWidget(button);
532 --i;
533 }
534 }
535
536 for (const QString& id : std::as_const(m_buttonsOrder)) {
537 if (auto b = button(id)) {
538 m_buttonsLayout->addWidget(b);
539 }
540 }
541}
542
543void IdealButtonBarWidget::takeOrderFromLayout()
544{

Callers

nothing calls this directly

Calls 6

buttonFunction · 0.85
itemAtMethod · 0.80
removeWidgetMethod · 0.80
countMethod · 0.45
widgetMethod · 0.45
addWidgetMethod · 0.45

Tested by

no test coverage detected