Qt3 QListView to Qt5/6
-
Hello,
I need to rewrite an old (and heavily customized) qt3 ListView for Qt5/6.
I am currently considering what is generally the best approach. The existing variant (or its items) is referenced several hundred times, so I think the most useful approach would be to work again with items.
However, my current problem is that in Qt3, lists have columns and in Qt5/6 (QlistView and QListWidget) not. QTableView /QTableWidget seems to be as well not really suitable, because an item is there always only a cell and not a row.
QTreeWidget could also be an option, but I think there could come relatively much overhead, since I always have only ONE level in a list.So briefly asked: Which variant would you recommend?
Thank you!
-
@firen said in Qt3 QListView to Qt5/6:
However, my current problem is that in Qt3, lists have columns
I know nothing about Qt3 (and interestingly Googling for
qt3 list columns
or evenqt3 list
seems to throw up nothing for Qt3! :) ). But do you use more than one column in your code? If you do not thenQListView
/Widget
seems suitable, but if you do have multiple columns ISTM you will wantQTableView
/QTableWidget
. I have no experience of using aQTreeView
/Widget
for a non-hierarchy/flat list just to get its columns, seems ugly but maybe it's useful.A bit of this is discussed in https://stackoverflow.com/questions/2644756/qlistview-how-to-add-column.
-
Hi,
You might want to check the porting guide from Qt 3 to Qt 4. That may give you the steps you need to modernize your project.
-
Ok, ich found out that Qt3 QListView was intendet to be used as a List OR a Tree :-) https://doc.qt.io/archives/3.3/qlistview.html#details
So maybe QTreeView/QTreeWidget is a good starting point now.