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 @@ -8,66 +8,90 @@ #include <qtooltip.h> #include <qwhatsthis.h> #include <qtimer.h> #include <qpopupmenu.h> #include <qaction.h> #include "listviewitemconfigentry.h" EditWidget::EditWidget( QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ) { EditWidgetLayout = new QGridLayout( this ); - EditWidgetLayout->setSpacing( 3 ); - EditWidgetLayout->setMargin( 3 ); + EditWidgetLayout->setSpacing( 0 ); + EditWidgetLayout->setMargin( 0 ); +// setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum));//, sizePolicy().hasHeightForWidth() ) ); - QLabel *TextLabelFileName = new QLabel( this, "TextLabelFileName" ); + 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 ); - QLabel *TextLabelGroup = new QLabel( this, "TextLabelGroup" ); + 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::isKey(bool h) +void EditWidget::layoutType(int t) { - if (h) + switch (t) { + case Entry: LineEditGroup->setEnabled(false); TextLabelKey->show(); LineEditKey->show(); TextLabelValue->show(); LineEditValue->show(); - }else{ + 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(); +// update(); +// updateGeometry(); +// adjustSize(); } |