0
|
1 |
#include <qlabel.h>
|
|
2 |
#include <qlineedit.h>
|
|
3 |
#include <qstring.h>
|
|
4 |
#include "infolabel.h"
|
|
5 |
|
|
6 |
|
|
7 |
InfoLabel::InfoLabel( QWidget *parent, const char *name )
|
|
8 |
: QLabel( parent, name )
|
|
9 |
{
|
|
10 |
initWidget();
|
|
11 |
}
|
|
12 |
|
|
13 |
InfoLabel::InfoLabel( const QString &mytitle,
|
|
14 |
QWidget *parent, const char *name ) : QLabel( parent, name )
|
|
15 |
{
|
|
16 |
initWidget();
|
|
17 |
setTitle( mytitle );
|
|
18 |
}
|
|
19 |
|
|
20 |
InfoLabel::InfoLabel( const QString &mytitle, const QString &myvalue,
|
|
21 |
QWidget *parent, const char *name ) : QLabel( parent, name )
|
|
22 |
{
|
|
23 |
initWidget();
|
|
24 |
setTitle( mytitle );
|
|
25 |
setValue( myvalue );
|
|
26 |
}
|
|
27 |
|
|
28 |
|
|
29 |
void InfoLabel::initWidget()
|
|
30 |
{
|
|
31 |
titlevar = new QString;
|
|
32 |
valuevar = new QString;
|
|
33 |
}
|
|
34 |
|
|
35 |
void InfoLabel::setTitle(const QString &str)
|
|
36 |
{
|
|
37 |
*titlevar = str;
|
|
38 |
setText( "<b>" + *titlevar + ":</b> " + *valuevar);
|
|
39 |
}
|
|
40 |
|
|
41 |
void InfoLabel::setValue(const QString &str)
|
|
42 |
{
|
|
43 |
*valuevar = str;
|
|
44 |
setText( "<b>" + *titlevar + ":</b> " + *valuevar);
|
|
45 |
}
|
|
46 |
|
|
47 |
QString InfoLabel::title() const
|
|
48 |
{
|
|
49 |
return *titlevar;
|
|
50 |
}
|
|
51 |
|
|
52 |
QString InfoLabel::value() const
|
|
53 |
{
|
|
54 |
return *valuevar;
|
|
55 |
}
|