aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/reguser/dialog.cpp
diff options
context:
space:
mode:
authorGravatar Noldor2008-04-07 21:48:31 +0000
committerGravatar Noldor2008-04-07 21:48:31 +0000
commit3dd98bb72600b391a2be837c1de9278647d21885 (patch)
treec0373697f2640a3a279a7826ac1aa2b46b2daddc /src/modules/reguser/dialog.cpp
parentCode clean (diff)
downloadKVIrc-3dd98bb72600b391a2be837c1de9278647d21885.tar.gz
KVIrc-3dd98bb72600b391a2be837c1de9278647d21885.tar.bz2
KVIrc-3dd98bb72600b391a2be837c1de9278647d21885.zip
more reguser qt4 port (wip)
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1416 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/reguser/dialog.cpp')
-rw-r--r--src/modules/reguser/dialog.cpp30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/modules/reguser/dialog.cpp b/src/modules/reguser/dialog.cpp
index 580e8c85c..43646e104 100644
--- a/src/modules/reguser/dialog.cpp
+++ b/src/modules/reguser/dialog.cpp
@@ -95,7 +95,10 @@ KviRegisteredUsersDialogItem::KviRegisteredUsersDialogItem(KviTalListViewItem *
t += m_pUser->getProperty("comment");
}
t += "</font></nobr>";
- m_pText = new QSimpleRichText(t,listView()->font());
+ m_pText = new QTextDocument();
+ m_pText->setHtml(t);
+ m_pText->setDefaultFont(listView()->font());
+ //m_pText = new QSimpleRichText(t,listView()->font());
//setText(0,u->name());
}
@@ -115,10 +118,24 @@ void KviRegisteredUsersDialogItem::paintCell(QPainter * p,const QColorGroup &cg,
KviTalListViewItem::paintCell(p,cg,column,width,align);
if(column==0)
{
+
+ if (isSelected())
+ {
+ QColor col(listView()->palette().highlight());
+ col.setAlpha(127);
+ p->setBrush(col);
+ p->drawRect(0, 0, listView()->visibleWidth(), height());
+ }
p->drawPixmap(LVI_BORDER,LVI_BORDER, *(g_pIconManager->getBigIcon(QString(KVI_BIGICON_REGUSERS))) );
int afterIcon = LVI_BORDER + LVI_ICON_SIZE + LVI_SPACING;
int www = listView()->visibleWidth() - (afterIcon + LVI_BORDER);
- m_pText->setWidth(www);
+ p->translate(afterIcon,LVI_BORDER);
+ m_pText->setPageSize(QSizeF(www,height() - (LVI_BORDER * 2)));
+ m_pText->drawContents(p);
+
+
+
+ /*
if(isSelected())
{
QColorGroup cg2(cg);
@@ -127,6 +144,8 @@ void KviRegisteredUsersDialogItem::paintCell(QPainter * p,const QColorGroup &cg,
} else {
m_pText->draw(p,afterIcon,LVI_BORDER,QRect(afterIcon,LVI_BORDER,www,height() - (LVI_BORDER * 2)),cg);
}
+ */
+
} else {
if(m_pUser)
{
@@ -144,10 +163,11 @@ void KviRegisteredUsersDialogItem::setup()
int iWidth = listView()->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->setWidth(iWidth);
+ //int iHeight = m_pText->height() + (2 * LVI_BORDER);
+ int iHeight = m_pText->size().height() + (2 * LVI_BORDER);
if(iHeight < (LVI_ICON_SIZE + (2 * LVI_BORDER)))iHeight = LVI_ICON_SIZE + (2 * LVI_BORDER);
- setHeight(iHeight);
+ setHeight(iHeight+2);
}