From: stv Date: Tue, 18 Sep 2007 07:25:30 +0000 (+0000) Subject: Header rich text threat modified. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ddcecfb4f748394376cdd111ad5e94fed8b13f7f;p=modules%2Fgui.git Header rich text threat modified. --- 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(); }