{
QImage *icon
= ( m_target
->isVisible
() ?
&m_icnCollapse
: &m_icnExpand
);
painter.eraseRect( event->rect() );
QSize ts
= painter.
fontMetrics().
size( Qt
::TextShowMnemonic, m_label,
0,
NULL );
painter.drawImage( 7, ( size().height() - icon->size().height() ) / 2, *icon );
painter.
drawText( QRect( QPoint( icon
->size
().
width() + 10,
( size
().
height() - ts.
height() ) / 2 ), ts
), m_label
);
if ( hasFocus() ) {
bopt.initFrom( this );
bopt.
rect = QRect( QPoint( 2,
2 ),
QSize( size
().
width() - 4, size
().
height() - 4 ) );
painter.
drawPrimitive( QStyle::PE_FrameFocusRect, bopt
);
}
}
void CWidgetHandle::paintEvent( QPaintEvent *event )
{
QStylePainter painter( this );
QImage *icon = ( m_target->isVisible() ? &m_icnCollapse : &m_icnExpand );
painter.eraseRect( event->rect() );
QSize ts = painter.fontMetrics().size( Qt::TextShowMnemonic, m_label, 0, NULL );
painter.drawImage( 7, ( size().height() - icon->size().height() ) / 2, *icon );
painter.drawText( QRect( QPoint( icon->size().width() + 10, ( size().height() - ts.height() ) / 2 ), ts ), m_label );
if ( hasFocus() ) {
QStyleOption bopt;
bopt.initFrom( this );
bopt.rect = QRect( QPoint( 2, 2 ), QSize( size().width() - 4, size().height() - 4 ) );
painter.drawPrimitive( QStyle::PE_FrameFocusRect, bopt );
}
}
To copy to clipboard, switch view to plain text mode
This now generates the expected output under Gnome but under Kde nothing (as in no focus frame) is displayed. If anyone has
Bookmarks