28 #define YUILogComponent "qt-ui" 29 #include <yui/YUILog.h> 33 #include "YQApplication.h" 38 const std::string & text,
41 : QLabel( (QWidget *) parent->widgetRep() )
42 , YLabel( parent, text, isHeading, isOutputField )
46 setTextFormat( Qt::PlainText );
47 QLabel::setText( fromUTF8( text ) );
54 else if ( isOutputField )
56 setFrameStyle ( QFrame::Panel | QFrame::Sunken );
61 setMargin( YQWidgetMargin );
62 setAlignment( Qt::AlignLeft | Qt::AlignTop );
74 YLabel::setText( newText );
75 QLabel::setText( fromUTF8( newText ) );
85 YLabel::setUseBoldFont( useBold );
91 QLabel::setEnabled( enabled );
92 YWidget::setEnabled( enabled );
98 return sizeHint().width();
104 return sizeHint().height();
110 resize( newWidth, newHeight );
114 #include "YQLabel.moc" virtual void setText(const std::string &newText)
Set the text the widget displays.
static YQApplication * yqApp()
Return the global YApplication object as YQApplication.
virtual ~YQLabel()
Destructor.
YQLabel(YWidget *parent, const std::string &text, bool isHeading=false, bool isOutputField=false)
Constructor.
virtual int preferredHeight()
Preferred height of the widget.
virtual int preferredWidth()
Preferred width of the widget.
virtual void setUseBoldFont(bool bold)
Switch bold font on or off.
virtual void setEnabled(bool enabled)
Set enabled / disabled state.
virtual void setSize(int newWidth, int newHeight)
Set the new size of the widget.