Initial from sourceforge's cvs.
#include <qlabel.h>
#include <qlineedit.h>
#include <qstring.h>
#include "infolabel.h"
InfoLabel::InfoLabel( QWidget *parent, const char *name )
: QLabel( parent, name )
{
initWidget();
}
InfoLabel::InfoLabel( const QString &mytitle,
QWidget *parent, const char *name ) : QLabel( parent, name )
{
initWidget();
setTitle( mytitle );
}
InfoLabel::InfoLabel( const QString &mytitle, const QString &myvalue,
QWidget *parent, const char *name ) : QLabel( parent, name )
{
initWidget();
setTitle( mytitle );
setValue( myvalue );
}
void InfoLabel::initWidget()
{
titlevar = new QString;
valuevar = new QString;
}
void InfoLabel::setTitle(const QString &str)
{
*titlevar = str;
setText( "<b>" + *titlevar + ":</b> " + *valuevar);
}
void InfoLabel::setValue(const QString &str)
{
*valuevar = str;
setText( "<b>" + *titlevar + ":</b> " + *valuevar);
}
QString InfoLabel::title() const
{
return *titlevar;
}
QString InfoLabel::value() const
{
return *valuevar;
}