Mercurial > hg > bitcoin
changeset 1247:26a36cda316e draft
fix drawing on gtk
author | Wladimir J. van der Laan <laanwj@gmail.com> |
---|---|
date | Wed, 03 Aug 2011 21:28:11 +0200 |
parents | 979c79cb302e |
children | 68f3251385ed |
files | src/qt/bitcoin.qrc src/qt/overviewpage.cpp |
diffstat | 2 files changed, 9 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/qt/bitcoin.qrc +++ b/src/qt/bitcoin.qrc @@ -1,7 +1,7 @@ <RCC> <qresource prefix="/icons" lang="edit"> + <file alias="bitcoin">res/icons/bitcoin.png</file> <file alias="address-book">res/icons/address-book.png</file> - <file alias="bitcoin">res/icons/bitcoin.png</file> <file alias="quit">res/icons/quit.png</file> <file alias="send">res/icons/send.png</file> <file alias="toolbar">res/icons/toolbar.png</file>
--- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -10,17 +10,17 @@ #include "guiconstants.h" #include <QDebug> -#include <QItemDelegate> +#include <QAbstractItemDelegate> #include <QPainter> #define DECORATION_SIZE 64 #define NUM_ITEMS 3 -class TxViewDelegate : public QItemDelegate +class TxViewDelegate : public QAbstractItemDelegate { //Q_OBJECT public: - TxViewDelegate(): QItemDelegate(), unit(BitcoinUnits::BTC) + TxViewDelegate(): QAbstractItemDelegate(), unit(BitcoinUnits::BTC) { } @@ -28,7 +28,6 @@ inline void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const { - //QItemDelegate::paint(painter, option, index); painter->save(); QIcon icon = qvariant_cast<QIcon>(index.data(Qt::DecorationRole)); @@ -81,6 +80,11 @@ painter->restore(); } + inline QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const + { + return QSize(DECORATION_SIZE, DECORATION_SIZE); + } + int unit; };