From ddcecfb4f748394376cdd111ad5e94fed8b13f7f Mon Sep 17 00:00:00 2001 From: stv Date: Tue, 18 Sep 2007 07:25:30 +0000 Subject: [PATCH] Header rich text threat modified. --- src/Qtx/QtxTable.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Qtx/QtxTable.cxx b/src/Qtx/QtxTable.cxx index 372552759..9ff270052 100644 --- a/src/Qtx/QtxTable.cxx +++ b/src/Qtx/QtxTable.cxx @@ -154,9 +154,12 @@ QSize QtxTable::Header::sizeHint() const QStyleSheet sheet; QStyleSheetItem* item = sheet.item( "p" ); if ( item ) + { item->setMargin( QStyleSheetItem::MarginAll, 0 ); + item->setWhiteSpaceMode( QStyleSheetItem::WhiteSpaceNoWrap ); + } - QSimpleRichText rt( lab, font(), QString::null, &sheet ); + QSimpleRichText rt( QString( "

%1

" ).arg( lab ), font(), QString::null, &sheet ); if ( orientation() == Horizontal ) rt.setWidth( sectionSize( mapToSection( i ) ) ); s += orientation() == Horizontal ? rt.height() : rt.width(); @@ -596,9 +599,12 @@ bool QtxTable::StyleItem::drawControl( QStyle::ControlElement element, QPainter* QStyleSheet sheet; QStyleSheetItem* i = sheet.item( "p" ); if ( i ) + { i->setMargin( QStyleSheetItem::MarginAll, 0 ); + i->setWhiteSpaceMode( QStyleSheetItem::WhiteSpaceNoWrap ); + } - QSimpleRichText rt( lab, header->font(), QString::null, &sheet ); + QSimpleRichText rt( QString( "

%1

" ).arg( lab ), header->font(), QString::null, &sheet ); rt.setWidth( rect.width() ); rt.draw( p, rect.x(), rect.y() + ( rect.height() - rt.height() ) / 2, rect, grp ); } @@ -919,9 +925,12 @@ void QtxTable::adjustColumn( int col ) QStyleSheet sheet; QStyleSheetItem* item = sheet.item( "p" ); if ( item ) + { item->setMargin( QStyleSheetItem::MarginAll, 0 ); + item->setWhiteSpaceMode( QStyleSheetItem::WhiteSpaceNoWrap ); + } - QSimpleRichText rt( txt, hdr->font(), QString::null, &sheet ); + QSimpleRichText rt( QString( "

%1

" ).arg( txt ), hdr->font(), QString::null, &sheet ); txtW += rt.width(); } -- 2.39.2