开发者

Contents of Qlistwidget based on selection of an item in another qlistwidget

开发者 https://www.devze.com 2023-01-05 00:43 出处:网络
I\'m using QT Creator to develop an application. I have two QTListWidgets which are aligned side by side.

I'm using QT Creator to develop an application. I have two QTListWidgets which are aligned side by side.

I've populated the first qtlistwidget with some items using开发者_高级运维 the 'Edit List Widget' dialogue box.

Now based on which item is selected in the first qtkistwidget , I would like to have options in the second qtlistwidget. These options in the second qtkistwidget should change with a change of selection in the first one .

Thanks in advance


I would recommend looking at QStringListModel and using QTreeViews for your views. Keep a collection of the models to use in the second view, and set the model appropriately when the first view's selection changes.

0

精彩评论

暂无评论...
验证码 换一张
取 消