aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/actioneditor/actioneditor.cpp
diff options
context:
space:
mode:
authorGravatar Elvio Basello2008-04-08 02:31:28 +0000
committerGravatar Elvio Basello2008-04-08 02:31:28 +0000
commitc743b41e834fbb58ce2276cd8cdeeb874c5c3555 (patch)
treed45d46a84934dc715714b2950e31e507f22e36b9 /src/modules/actioneditor/actioneditor.cpp
parentpreliminary translation generation support for cmake (diff)
downloadKVIrc-c743b41e834fbb58ce2276cd8cdeeb874c5c3555.tar.gz
KVIrc-c743b41e834fbb58ce2276cd8cdeeb874c5c3555.tar.bz2
KVIrc-c743b41e834fbb58ce2276cd8cdeeb874c5c3555.zip
ported actioneditor module, code clean
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1425 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/actioneditor/actioneditor.cpp')
-rw-r--r--src/modules/actioneditor/actioneditor.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/modules/actioneditor/actioneditor.cpp b/src/modules/actioneditor/actioneditor.cpp
index 91d02dc96..2576ac0ef 100644
--- a/src/modules/actioneditor/actioneditor.cpp
+++ b/src/modules/actioneditor/actioneditor.cpp
@@ -57,8 +57,6 @@
#include <QPainter>
#include <QTabWidget>
#include <QLabel>
-#include <q3header.h>
-// FIXME: Qt4 #include <QHeaderView>
extern KviActionEditorWindow * g_pActionEditorWindow;
@@ -91,7 +89,10 @@ void KviActionEditorListViewItem::setupForActionData()
QString t = "<b>" + m_pActionData->m_szName + "</b>";
t += "<br><font color=\"#808080\" size=\"-1\">" + m_pActionData->m_szVisibleName + "</font>";
m_szKey = m_pActionData->m_szName.upper();
- m_pText = new QSimpleRichText(t,m_pListView->font());
+ //m_pText = new QSimpleRichText(t,m_pListView->font());
+ m_pText = new QTextDocument();
+ m_pText->setHtml(t);
+ m_pText->setDefaultFont(m_pListView->font());
if(m_pIcon)delete m_pIcon;
QPixmap * p = g_pIconManager->getBigIcon(m_pActionData->m_szBigIcon);
if(p)m_pIcon = new QPixmap(*p);
@@ -114,8 +115,9 @@ void KviActionEditorListViewItem::setup()
int iWidth = m_pListView->visibleWidth();
if(iWidth < LVI_MINIMUM_CELL_WIDTH)iWidth = LVI_MINIMUM_CELL_WIDTH;
iWidth -= LVI_BORDER + LVI_ICON_SIZE + LVI_SPACING + LVI_BORDER;
- m_pText->setWidth(iWidth);
- int iHeight = m_pText->height() + (2 * LVI_BORDER);
+ m_pText->setTextWidth(iWidth);
+
+ int iHeight = m_pText->pageSize().height() + (2 * LVI_BORDER);
if(iHeight < (LVI_ICON_SIZE + (2 * LVI_BORDER)))iHeight = LVI_ICON_SIZE + (2 * LVI_BORDER);
setHeight(iHeight);
}
@@ -126,8 +128,8 @@ void KviActionEditorListViewItem::paintCell(QPainter * p,const QColorGroup & cg,
p->drawPixmap(LVI_BORDER,LVI_BORDER,*m_pIcon);
int afterIcon = LVI_BORDER + LVI_ICON_SIZE + LVI_SPACING;
int www = m_pListView->visibleWidth() - (afterIcon + LVI_BORDER);
- m_pText->setWidth(www);
- m_pText->draw(p,afterIcon,LVI_BORDER,QRect(afterIcon,LVI_BORDER,www,height() - (LVI_BORDER * 2)),cg);
+ m_pText->setTextWidth(www);
+ m_pText->drawContents(p,QRect(afterIcon,LVI_BORDER,www,height() - (LVI_BORDER * 2)));
}