Unsolved Qt equivalent to ListView Control of WinAPI
-
Lately I have tried to create a list view like the native windows in qt (Sample image of utorrent at the end of the post), but the closest I got to it was with QTableView, I wanted the user to adjust the width of the columns like mouse and being able to add other widgets inside the column as natively, should be possible since qBittorrent does exactly as I want using Qt.
-
Hi,
Do you mean the control in the left ?
Then it looks like a QTreeView. -
@Samuel-Ives said in Qt equivalent to ListView Control of WinAPI:
I wanted the user to adjust the width of the columns like mouse
This is the default behaviour, if you can't you you just need to adjust the sectionResizeMode of the header
@Samuel-Ives said in Qt equivalent to ListView Control of WinAPI:
add other widgets inside the column
this depends on your delegate implementation, see
QStyledItemDelegate
-
@Samuel-Ives said in Qt equivalent to ListView Control of WinAPI:
should be possible since qBittorrent does exactly as I want using Qt.
You can study exactly how qBittorrent does it.
- The view at the top-right is TransferListWidget: https://github.com/qbittorrent/qBittorrent/blob/master/src/gui/transferlistwidget.cpp
- The progress bars are painted using TransferListDelegate: https://github.com/qbittorrent/qBittorrent/blob/master/src/gui/transferlistdelegate.cpp
-
@SGaist in the center where the list of torrents downloading.