Commit a1e6cb61 authored by LACROIX Romain's avatar LACROIX Romain
Browse files

Bugfix: to support multiple menu bars, the callback lambda in...

Bugfix: to support multiple menu bars, the callback lambda in dtkWidgetsMenuBarContainer::switchToRoot() must not be static. Otherwise, the same callback for all menubars will only be instantiated once, and it will only capture the container instance of the first menu bar, and it will only work for first menu bar calling this function.

Fixes #68
parent 6815b411
Pipeline #171903 passed with stage
in 0 seconds
...@@ -469,7 +469,7 @@ void dtkWidgetsMenuBarContainer::switchToRoot(std::function<void(void)> &callbac ...@@ -469,7 +469,7 @@ void dtkWidgetsMenuBarContainer::switchToRoot(std::function<void(void)> &callbac
this->slider->enableSpying(false); this->slider->enableSpying(false);
this->slider->blockSignals(true); this->slider->blockSignals(true);
static std::function<void(void)> cb = [=](void) -> void std::function<void(void)> cb = [=](void) -> void
{ {
while (!this->stack.isEmpty()) while (!this->stack.isEmpty())
this->slider->remSlide(this->slides[this->stack.takeLast()]); this->slider->remSlide(this->slides[this->stack.takeLast()]);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment