Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt3 QListView to Qt5/6

Qt3 QListView to Qt5/6

Scheduled Pinned Locked Moved Unsolved General and Desktop
qlistviewqt3
4 Posts 3 Posters 672 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    firen
    wrote on last edited by firen
    #1

    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!

    JonBJ 1 Reply Last reply
    0
    • F firen

      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!

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @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 even qt3 list seems to throw up nothing for Qt3! :) ). But do you use more than one column in your code? If you do not then QListView/Widget seems suitable, but if you do have multiple columns ISTM you will want QTableView /QTableWidget. I have no experience of using a QTreeView/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.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        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.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • F Offline
          F Offline
          firen
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved