mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Ensure that all columns in the peerlist are showing.
This commit is contained in:
parent
f227130388
commit
64dad99c36
1 changed files with 12 additions and 0 deletions
|
@ -74,7 +74,19 @@ PeerListWidget::PeerListWidget(PropertiesWidget *parent):
|
||||||
m_proxyModel->setDynamicSortFilter(true);
|
m_proxyModel->setDynamicSortFilter(true);
|
||||||
m_proxyModel->setSourceModel(m_listModel);
|
m_proxyModel->setSourceModel(m_listModel);
|
||||||
setModel(m_proxyModel);
|
setModel(m_proxyModel);
|
||||||
|
//Explicitly set the column visibility. When columns are added/removed
|
||||||
|
//between versions this prevents some of them being hidden due to
|
||||||
|
//incorrect restoreState() being used.
|
||||||
|
for (unsigned int i=0; i<PeerListDelegate::IP_HIDDEN; i++)
|
||||||
|
showColumn(i);
|
||||||
hideColumn(PeerListDelegate::IP_HIDDEN);
|
hideColumn(PeerListDelegate::IP_HIDDEN);
|
||||||
|
hideColumn(PeerListDelegate::COL_COUNT);
|
||||||
|
//To also migitate the above issue, we have to resize each column when
|
||||||
|
//its size is 0, because explicitely 'showing' the column isn't enough
|
||||||
|
//in the above scenario.
|
||||||
|
for (unsigned int i=0; i<PeerListDelegate::IP_HIDDEN; i++)
|
||||||
|
if (!columnWidth(i))
|
||||||
|
resizeColumnToContents(i);
|
||||||
// Context menu
|
// Context menu
|
||||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showPeerListMenu(QPoint)));
|
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showPeerListMenu(QPoint)));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue