WTreeView::setRowHeight with adjusting value causes "Loading" to get stuck
Added by Ulf Johnsson over 3 years ago
Hi.
It seems setting row height on a treeview to a adjusting value (like em) confuses the treeview
and the "Loading" image is not correctly replaced when scrolling.
In the example provided below simple scroll to the bottom and you'll see that the values are not displayed.
Wt 4.4.0 / Windows10 / FireFox
class App : public Wt::WApplication {
public:
App(const Wt::WEnvironment& env) : Wt::WApplication(env)
{
}
void initialize() override
{
Wt::WApplication::initialize();
auto tree = root()->addWidget(std::make_unique<Wt::WTreeView>());
tree->resize(400, 600);
std::shared_ptr<Wt::WStringListModel> _model(new Wt::WStringListModel);
tree->setModel(_model);
std::vector<Wt::WString> data;
for(int index = 0; index < 1000; ++index)
{
Wt::WString d("1");
data.push_back(d);
}
_model->setStringList(data);
const Wt::WLength lineHeight(1.5, Wt::LengthUnit::FontEm);
tree->setRowHeight(lineHeight);
}
};
Replies (2)
RE: WTreeView::setRowHeight with adjusting value causes "Loading" to get stuck - Added by Roel Standaert over 3 years ago
Hi,
Setting it to anything other than a certain amount of pixels is indeed not supported: https://webtoolkit.eu/wt/doc/reference/html/classWt_1_1WTreeView.html#a1bd83d1f48a11dbc731f56a16d420148
RE: WTreeView::setRowHeight with adjusting value causes "Loading" to get stuck - Added by Ulf Johnsson over 3 years ago
My bad. I guess I'll have to find another technique to create rows that can adjust to font size.
BR, Ulf.