mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-25 22:14:32 +00:00
Merge pull request #15176 from Chocobo1/tooltip
Add tooltip for more widgets
This commit is contained in:
commit
d3497148c5
@ -797,7 +797,7 @@ QVector<DownloadPriority> TorrentImpl::filePriorities() const
|
|||||||
const std::vector<lt::download_priority_t> fp = m_nativeHandle.get_file_priorities();
|
const std::vector<lt::download_priority_t> fp = m_nativeHandle.get_file_priorities();
|
||||||
|
|
||||||
QVector<DownloadPriority> ret;
|
QVector<DownloadPriority> ret;
|
||||||
ret.reserve(fp.size());
|
ret.reserve(static_cast<decltype(ret)::size_type>(fp.size()));
|
||||||
std::transform(fp.cbegin(), fp.cend(), std::back_inserter(ret), [](const lt::download_priority_t priority)
|
std::transform(fp.cbegin(), fp.cend(), std::back_inserter(ret), [](const lt::download_priority_t priority)
|
||||||
{
|
{
|
||||||
return static_cast<DownloadPriority>(toLTUnderlyingType(priority));
|
return static_cast<DownloadPriority>(toLTUnderlyingType(priority));
|
||||||
|
@ -447,7 +447,7 @@ void PeerListWidget::updatePeer(const BitTorrent::Torrent *torrent, const BitTor
|
|||||||
setModelData(row, PeerListColumns::CONNECTION, peer.connectionType(), peer.connectionType());
|
setModelData(row, PeerListColumns::CONNECTION, peer.connectionType(), peer.connectionType());
|
||||||
setModelData(row, PeerListColumns::FLAGS, peer.flags(), peer.flags(), {}, peer.flagsDescription());
|
setModelData(row, PeerListColumns::FLAGS, peer.flags(), peer.flags(), {}, peer.flagsDescription());
|
||||||
const QString client = peer.client().toHtmlEscaped();
|
const QString client = peer.client().toHtmlEscaped();
|
||||||
setModelData(row, PeerListColumns::CLIENT, client, client);
|
setModelData(row, PeerListColumns::CLIENT, client, client, {}, client);
|
||||||
setModelData(row, PeerListColumns::PROGRESS, (Utils::String::fromDouble(peer.progress() * 100, 1) + '%'), peer.progress(), intDataTextAlignment);
|
setModelData(row, PeerListColumns::PROGRESS, (Utils::String::fromDouble(peer.progress() * 100, 1) + '%'), peer.progress(), intDataTextAlignment);
|
||||||
const QString downSpeed = (hideValues && (peer.payloadDownSpeed() <= 0)) ? QString {} : Utils::Misc::friendlyUnit(peer.payloadDownSpeed(), true);
|
const QString downSpeed = (hideValues && (peer.payloadDownSpeed() <= 0)) ? QString {} : Utils::Misc::friendlyUnit(peer.payloadDownSpeed(), true);
|
||||||
setModelData(row, PeerListColumns::DOWN_SPEED, downSpeed, peer.payloadDownSpeed(), intDataTextAlignment);
|
setModelData(row, PeerListColumns::DOWN_SPEED, downSpeed, peer.payloadDownSpeed(), intDataTextAlignment);
|
||||||
@ -461,7 +461,7 @@ void PeerListWidget::updatePeer(const BitTorrent::Torrent *torrent, const BitTor
|
|||||||
|
|
||||||
const QStringList downloadingFiles {torrent->info().filesForPiece(peer.downloadingPieceIndex())};
|
const QStringList downloadingFiles {torrent->info().filesForPiece(peer.downloadingPieceIndex())};
|
||||||
const QString downloadingFilesDisplayValue = downloadingFiles.join(';');
|
const QString downloadingFilesDisplayValue = downloadingFiles.join(';');
|
||||||
setModelData(row, PeerListColumns::DOWNLOADING_PIECE, downloadingFilesDisplayValue, downloadingFilesDisplayValue, {}, downloadingFiles.join('\n'));
|
setModelData(row, PeerListColumns::DOWNLOADING_PIECE, downloadingFilesDisplayValue, downloadingFilesDisplayValue, {}, downloadingFiles.join(QLatin1Char('\n')));
|
||||||
|
|
||||||
if (m_resolver)
|
if (m_resolver)
|
||||||
m_resolver->resolve(peerEndpoint.address.ip);
|
m_resolver->resolve(peerEndpoint.address.ip);
|
||||||
|
@ -339,7 +339,7 @@ int TorrentContentModel::getFileIndex(const QModelIndex &index)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant TorrentContentModel::data(const QModelIndex &index, int role) const
|
QVariant TorrentContentModel::data(const QModelIndex &index, const int role) const
|
||||||
{
|
{
|
||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
return {};
|
return {};
|
||||||
@ -375,6 +375,7 @@ QVariant TorrentContentModel::data(const QModelIndex &index, int role) const
|
|||||||
return {};
|
return {};
|
||||||
|
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
|
case Qt::ToolTipRole:
|
||||||
return item->displayData(index.column());
|
return item->displayData(index.column());
|
||||||
|
|
||||||
case Roles::UnderlyingDataRole:
|
case Roles::UnderlyingDataRole:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user