Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[Solved]Qtablewidget or Qtableview, which is more proper to make a downloading task list ?



  • Qtablewidget or Qtableview, which is more proper to make a downloading task list ?

    I want to make a downloading task list like this
    http://qt-project.org/doc/qt-4.8/images/widgetdelegate.png

    1)the first question is : Qtablewidget or Qtableview, which is more suitable for this job ?

    2)the second question is : how to draw a progress bar in the downloading task list ?
    P.S. if chosing Qtablewidget ,I know it has a
    @ QTableWidget.setCellWidget(row, column, widget)@
    method ,so we can use it to set QprogressBar there .

    if chosing Qtableview, we can use Delegate like here

    http://qt-project.org/doc/qt-4.8/qabstractitemdelegate.html

    (maybe QStyleOptionProgressBarV2 will be more appropriate for the current Qt )

    the same question comes here again :which way is more appropriate to do this ?

    can anyone give a little example ? cuz the the Qt Torrent Example is so complicated for a newbie like me to learn from it .thanks !!!



  • To be honest, either way will work fine. The Model/View pattern becomes handy if you really want to customize the look of the view, use the same data for multiple views, or are dealing with a large dataset. However, I would say that if your struggling with the Qt Torrent Example then I would stick with QTableWidget. That will be the easier of the two ways for you to achieve the screenshot you provided.


Log in to reply