SHARE
TWEET

Untitled

a guest Apr 23rd, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     //setUpdatesEnabled(false);
  2.     //this->setHidden(true);
  3.     const auto add_item = [&](const per_pattern_modulator_settings& settings, const int id)
  4.     {
  5.         auto per_pattern = new per_pattern_modulator_settings_selector;
  6.         per_pattern->set_pattern_id(id);
  7.         per_pattern->set_per_pattern_modulator_settings(settings);
  8.         per_pattern->slm_mode_changed(mode_);
  9.         QObject::connect(per_pattern, &per_pattern_modulator_settings_selector::per_pattern_modulator_settings_changed, this, &per_modulator_saveable_settings_selector::update_per_modulator_saveable_settings);
  10.         QObject::connect(per_pattern, &per_pattern_modulator_settings_selector::clicked_on_me, this, &per_modulator_saveable_settings_selector::clicked_pattern);
  11.         per_pattern_widgets.push_back(per_pattern);
  12.         const auto column = id % 2;
  13.         const auto row = id / 2;
  14.         layout->addWidget(per_pattern, row, column);
  15.     };
  16.     for (auto idx = 0; idx < patterns.size(); ++idx)
  17.     {
  18.         const auto& settings = patterns.at(idx);
  19.         if (idx < per_pattern_widgets.size())
  20.         {
  21.             auto ptr_to_item = per_pattern_widgets.at(idx);
  22.             QSignalBlocker blocker(ptr_to_item);
  23.             ptr_to_item->set_per_pattern_modulator_settings(settings);
  24.         }
  25.         else
  26.         {
  27.             add_item(settings, idx);
  28.         }
  29.     }
  30.     while (per_pattern_widgets.size() > patterns.size())
  31.     {
  32.         const auto widget = per_pattern_widgets.back();
  33.         per_pattern_widgets.pop_back();
  34.         layout->removeWidget(widget);
  35.         widget->deleteLater();
  36.     }
  37.     update_per_modulator_saveable_settings();
  38.     //setUpdatesEnabled(true);
  39.     //this->setHidden(false);
  40.     //
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top