From 102b2dc7387a974b381fa5a278798af1f373f24a Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Sun, 21 Jul 2013 22:53:59 +0300 Subject: [PATCH] Fix text size problem on Windows with custom DPI. (closes #758) On Windows FontMetrics seem to be broken when custom DPI is set by the user. --- src/qtlibtorrent/torrentmodel.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/qtlibtorrent/torrentmodel.cpp b/src/qtlibtorrent/torrentmodel.cpp index 2f34cf2be..6ce65f697 100644 --- a/src/qtlibtorrent/torrentmodel.cpp +++ b/src/qtlibtorrent/torrentmodel.cpp @@ -29,7 +29,6 @@ */ #include -#include #include "torrentmodel.h" #include "torrentpersistentdata.h" @@ -305,19 +304,6 @@ QVariant TorrentModel::data(const QModelIndex &index, int role) const if (!index.isValid()) return QVariant(); try { if (index.row() >= 0 && index.row() < rowCount() && index.column() >= 0 && index.column() < columnCount()) - if (role == Qt::SizeHintRole) - { - QSize size(m_torrents[index.row()]->data(index.column(), role).toSize()); - QFont font; - QFontMetrics fm(font); - QIcon icon(":/Icons/skin/downloading.png"); - int fm_height(fm.height()); - QList ic_sizes(icon.availableSizes()); - int icon_height(ic_sizes[0].height()); - size.setHeight(fm_height > icon_height ? fm_height : icon_height); - return QVariant(size); - } - else return m_torrents[index.row()]->data(index.column(), role); } catch(invalid_handle&) {} return QVariant();