1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
11 \----------------------------------------------------------------------/
13 File: YQWidgetCaption.cc
15 Author: Stefan Hundhammer <sh@suse.de>
20 #define y2log_component "qt-ui"
21 #include <ycp/y2log.h>
23 #include "YQWidgetCaption.h"
27 YQWidgetCaption::YQWidgetCaption( QWidget * parent,
29 : QLabel( fromUTF8( text ), parent )
31 setTextFormat( Qt::PlainText );
32 handleVisibility( text );
36 YQWidgetCaption::YQWidgetCaption( QWidget * parent, const QString & text )
37 : QLabel( text, parent )
39 setTextFormat( Qt::PlainText );
40 handleVisibility( text );
44 YQWidgetCaption::~YQWidgetCaption()
50 void YQWidgetCaption::setText ( const string & newText )
52 setText( fromUTF8( newText ) );
56 void YQWidgetCaption::setText ( const QString & newText )
58 QLabel::setText( newText );
59 handleVisibility( newText.isEmpty() );
63 void YQWidgetCaption::handleVisibility( const string & text )
65 handleVisibility( text.empty() );
69 void YQWidgetCaption::handleVisibility( const QString & text )
71 handleVisibility( text.isEmpty() );
75 void YQWidgetCaption::handleVisibility( bool textIsEmpty )
90 #include "YQWidgetCaption.moc"