1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
#include "editwidget.h"
#include <qlabel.h>
#include <qlineedit.h>
#include <qlayout.h>
EditWidget::EditWidget( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl )
{
EditWidgetLayout = new QGridLayout( this );
EditWidgetLayout->setSpacing( 0 );
EditWidgetLayout->setMargin( 0 );
// setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum));//, sizePolicy().hasHeightForWidth() ) );
TextLabelFileName = new QLabel( this, "TextLabelFileName" );
TextLabelFileName->setText( tr( "File Name:" ) );
EditWidgetLayout->addWidget( TextLabelFileName, 0, 0 );
TextFileName = new QLabel( this, "TextFileName" );
EditWidgetLayout->addWidget( TextFileName, 0, 1 );
TextLabelGroup = new QLabel( this, "TextLabelGroup" );
TextLabelGroup->setText( tr( "Group:" ) );
EditWidgetLayout->addWidget( TextLabelGroup, 1, 0 );
LineEditGroup = new QLineEdit( this, "LineEditGroup" );
EditWidgetLayout->addWidget( LineEditGroup, 1, 1 );
TextLabelKey = new QLabel( this, "TextLabelKey" );
TextLabelKey->setText( tr( "Key:" ) );
EditWidgetLayout->addWidget( TextLabelKey, 2, 0 );
LineEditKey = new QLineEdit( this, "LineEditKey" );
EditWidgetLayout->addWidget( LineEditKey, 2, 1 );
TextLabelValue = new QLabel( this, "TextLabelValue" );
TextLabelValue->setText( tr( "Value:" ) );
EditWidgetLayout->addWidget( TextLabelValue, 3, 0 );
LineEditValue = new QLineEdit( this, "LineEditValue" );
EditWidgetLayout->addWidget( LineEditValue, 3, 1 );
// layoutType(Nothing);
}
EditWidget::~EditWidget()
{
}
void EditWidget::layoutType(int t)
{
switch (t)
{
case Entry:
LineEditGroup->setEnabled(false);
TextLabelKey->show();
LineEditKey->show();
TextLabelValue->show();
LineEditValue->show();
TextLabelGroup->show();
LineEditGroup->show();
TextLabelFileName->show();
TextFileName->show();
break;
case Group:
LineEditGroup->setEnabled(true);
TextLabelKey->hide();
LineEditKey->hide();
TextLabelValue->hide();
LineEditValue->hide();
TextLabelGroup->show();
LineEditGroup->show();
TextLabelFileName->show();
TextFileName->show();
break;
default:
TextLabelKey->hide();
LineEditKey->hide();
TextLabelValue->hide();
LineEditValue->hide();
TextLabelGroup->hide();
LineEditGroup->hide();
TextLabelFileName->hide();
TextFileName->hide();
}
// update();
// updateGeometry();
// adjustSize();
}
|