src/infolabel.cpp
author viric@llimona
Thu, 18 May 2006 23:05:01 +0200
changeset 0 04114bce8fd0
permissions -rw-r--r--
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;
}