Diffstat (limited to 'noncore/apps/confedit/editwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/confedit/editwidget.cpp | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/noncore/apps/confedit/editwidget.cpp b/noncore/apps/confedit/editwidget.cpp index 64f968a..f7dc408 100644 --- a/noncore/apps/confedit/editwidget.cpp +++ b/noncore/apps/confedit/editwidget.cpp | |||
@@ -14,22 +14,23 @@ | |||
14 | 14 | ||
15 | EditWidget::EditWidget( QWidget* parent, const char* name, WFlags fl ) | 15 | EditWidget::EditWidget( QWidget* parent, const char* name, WFlags fl ) |
16 | : QWidget( parent, name, fl ) | 16 | : QWidget( parent, name, fl ) |
17 | { | 17 | { |
18 | 18 | ||
19 | EditWidgetLayout = new QGridLayout( this ); | 19 | EditWidgetLayout = new QGridLayout( this ); |
20 | EditWidgetLayout->setSpacing( 3 ); | 20 | EditWidgetLayout->setSpacing( 0 ); |
21 | EditWidgetLayout->setMargin( 3 ); | 21 | EditWidgetLayout->setMargin( 0 ); |
22 | // setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum));//, sizePolicy().hasHeightForWidth() ) ); | ||
22 | 23 | ||
23 | QLabel *TextLabelFileName = new QLabel( this, "TextLabelFileName" ); | 24 | TextLabelFileName = new QLabel( this, "TextLabelFileName" ); |
24 | TextLabelFileName->setText( tr( "File Name:" ) ); | 25 | TextLabelFileName->setText( tr( "File Name:" ) ); |
25 | EditWidgetLayout->addWidget( TextLabelFileName, 0, 0 ); | 26 | EditWidgetLayout->addWidget( TextLabelFileName, 0, 0 ); |
26 | TextFileName = new QLabel( this, "TextFileName" ); | 27 | TextFileName = new QLabel( this, "TextFileName" ); |
27 | EditWidgetLayout->addWidget( TextFileName, 0, 1 ); | 28 | EditWidgetLayout->addWidget( TextFileName, 0, 1 ); |
28 | 29 | ||
29 | QLabel *TextLabelGroup = new QLabel( this, "TextLabelGroup" ); | 30 | TextLabelGroup = new QLabel( this, "TextLabelGroup" ); |
30 | TextLabelGroup->setText( tr( "Group:" ) ); | 31 | TextLabelGroup->setText( tr( "Group:" ) ); |
31 | EditWidgetLayout->addWidget( TextLabelGroup, 1, 0 ); | 32 | EditWidgetLayout->addWidget( TextLabelGroup, 1, 0 ); |
32 | LineEditGroup = new QLineEdit( this, "LineEditGroup" ); | 33 | LineEditGroup = new QLineEdit( this, "LineEditGroup" ); |
33 | EditWidgetLayout->addWidget( LineEditGroup, 1, 1 ); | 34 | EditWidgetLayout->addWidget( LineEditGroup, 1, 1 ); |
34 | 35 | ||
35 | TextLabelKey = new QLabel( this, "TextLabelKey" ); | 36 | TextLabelKey = new QLabel( this, "TextLabelKey" ); |
@@ -41,33 +42,56 @@ EditWidget::EditWidget( QWidget* parent, const char* name, WFlags fl ) | |||
41 | TextLabelValue = new QLabel( this, "TextLabelValue" ); | 42 | TextLabelValue = new QLabel( this, "TextLabelValue" ); |
42 | TextLabelValue->setText( tr( "Value:" ) ); | 43 | TextLabelValue->setText( tr( "Value:" ) ); |
43 | EditWidgetLayout->addWidget( TextLabelValue, 3, 0 ); | 44 | EditWidgetLayout->addWidget( TextLabelValue, 3, 0 ); |
44 | LineEditValue = new QLineEdit( this, "LineEditValue" ); | 45 | LineEditValue = new QLineEdit( this, "LineEditValue" ); |
45 | EditWidgetLayout->addWidget( LineEditValue, 3, 1 ); | 46 | EditWidgetLayout->addWidget( LineEditValue, 3, 1 ); |
46 | 47 | ||
48 | // layoutType(Nothing); | ||
47 | } | 49 | } |
48 | 50 | ||
49 | 51 | ||
50 | EditWidget::~EditWidget() | 52 | EditWidget::~EditWidget() |
51 | { | 53 | { |
52 | } | 54 | } |
53 | 55 | ||
54 | 56 | ||
55 | void EditWidget::isKey(bool h) | 57 | void EditWidget::layoutType(int t) |
56 | { | 58 | { |
57 | if (h) | 59 | switch (t) |
58 | { | 60 | { |
61 | case Entry: | ||
59 | LineEditGroup->setEnabled(false); | 62 | LineEditGroup->setEnabled(false); |
60 | TextLabelKey->show(); | 63 | TextLabelKey->show(); |
61 | LineEditKey->show(); | 64 | LineEditKey->show(); |
62 | TextLabelValue->show(); | 65 | TextLabelValue->show(); |
63 | LineEditValue->show(); | 66 | LineEditValue->show(); |
64 | }else{ | 67 | TextLabelGroup->show(); |
68 | LineEditGroup->show(); | ||
69 | TextLabelFileName->show(); | ||
70 | TextFileName->show(); | ||
71 | break; | ||
72 | case Group: | ||
65 | LineEditGroup->setEnabled(true); | 73 | LineEditGroup->setEnabled(true); |
66 | TextLabelKey->hide(); | 74 | TextLabelKey->hide(); |
67 | LineEditKey->hide(); | 75 | LineEditKey->hide(); |
68 | TextLabelValue->hide(); | 76 | TextLabelValue->hide(); |
69 | LineEditValue->hide(); | 77 | LineEditValue->hide(); |
78 | TextLabelGroup->show(); | ||
79 | LineEditGroup->show(); | ||
80 | TextLabelFileName->show(); | ||
81 | TextFileName->show(); | ||
82 | break; | ||
83 | default: | ||
84 | TextLabelKey->hide(); | ||
85 | LineEditKey->hide(); | ||
86 | TextLabelValue->hide(); | ||
87 | LineEditValue->hide(); | ||
88 | TextLabelGroup->hide(); | ||
89 | LineEditGroup->hide(); | ||
90 | TextLabelFileName->hide(); | ||
91 | TextFileName->hide(); | ||
70 | } | 92 | } |
71 | update(); | 93 | // update(); |
94 | // updateGeometry(); | ||
95 | // adjustSize(); | ||
72 | } | 96 | } |
73 | 97 | ||