MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / adaptComboBoxes

Function adaptComboBoxes

pj_dialog_host/src/widget_adapters.cpp:559–578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

557}
558
559void adaptComboBoxes(QWidget* root) {
560 if (root == nullptr) {
561 return;
562 }
563 // Unlike radios/checkboxes, PJ::ComboBox IS a QComboBox, so there is no swap:
564 // we upgrade each plain QComboBox in place (gradient delegate + popup frame
565 // fixes), which preserves its model, current index, and signal connections.
566 // Skip ones already promoted to PJ::ComboBox, ones inside opaque host
567 // composites, and ones already upgraded (marker keeps it idempotent).
568 static constexpr const char* kComboStyledProperty = "_pj_combo_styled";
569 const QList<QComboBox*> combos = root->findChildren<QComboBox*>();
570 for (QComboBox* combo : combos) {
571 if (qobject_cast<ComboBox*>(combo) != nullptr || combo->property(kComboStyledProperty).toBool() ||
572 isInsideHostComposite(combo)) {
573 continue;
574 }
575 applyComboBoxStyling(combo);
576 combo->setProperty(kComboStyledProperty, true);
577 }
578}
579
580void adaptScrollAreas(QWidget* root) {
581 if (root == nullptr) {

Callers 2

adaptStyledWidgetsFunction · 0.85
TESTFunction · 0.85

Calls 2

isInsideHostCompositeFunction · 0.85
applyComboBoxStylingFunction · 0.85

Tested by 1

TESTFunction · 0.68