Project

General

Profile

WTabWidget::indexOf and ContentLoading::Eager

Added by Peter Tagwercher about 2 years ago

Hi all,

I am adding several widgets to a WTabWidget by either using default add (which is using ContentLoading::Lazy) but for one Tab we must use ContentLoading::Eager.

m_primeTabWidget->addTab(std::move(widget), Wt::WString::tr(name), ContentLoading::Eager);

As we allow "Split" views (a bunch of tabs on the left WTabWidget, a bunch of tabs on the right WTabWidget), we are using

m_primeTabWidget->indexOf(widget);

to find the widget we want to move between left and right.

indexOf works fine (returning a valid index) when using ContentLoading::Lazy but returns --1 when the widget was added using ContentLoading::Eager.

How can this be fixed? Thanks in advance.

Regards,

Peter