Project

General

Profile

WTreeView::setRowHeight with adjusting value causes "Loading" to get stuck

Added by Ulf Johnsson about 1 month 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 Ulf Johnsson about 1 month ago

My bad. I guess I'll have to find another technique to create rows that can adjust to font size.

BR, Ulf.

    (1-2/2)