From 7914500c96ebe2106716a001ca2b93594d3c07a5 Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 19 Aug 2010 09:04:47 +0000 Subject: Fixed problems with eventOnChange. --- client/widgets/altcombobox.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'client/widgets/altcombobox.cc') diff --git a/client/widgets/altcombobox.cc b/client/widgets/altcombobox.cc index fac2610..6146624 100644 --- a/client/widgets/altcombobox.cc +++ b/client/widgets/altcombobox.cc @@ -188,22 +188,25 @@ void AltComboBox::onValueChange(int index) altvalue.toStdString().c_str()); if(cmb->itemData(index).toString() == altvalue) { - // altframe->setEnabled(true); + altframerepl->setVisible(false); frame->layout()->removeWidget(altframerepl); frame->layout()->addWidget(altframe); altframe->setVisible(true); + } else { - // altframe->setEnabled(false); + altframe->setVisible(false); frame->layout()->removeWidget(altframe); frame->layout()->addWidget(altframerepl); altframerepl->setVisible(true); + } - eventOnChange(true); + emit eventOnChange(true); + innerwidget->runEventOnChange(); } void AltComboBox::onValueChange(const QString &text) @@ -214,8 +217,8 @@ void AltComboBox::onValueChange(const QString &text) void AltComboBox::onChildChange() { + emit eventOnChange(true); emit wasChanged(); - eventOnChange(true); } bool AltComboBox::setKeyboardFocus() @@ -230,6 +233,8 @@ bool AltComboBox::setKeyboardFocus() void AltComboBox::setWdgValid(bool valid) { + DEBUG(altcombobox, "Set valid(%s)", valid?"true":"false"); + QPalette palette; if(valid) { @@ -242,5 +247,5 @@ void AltComboBox::setWdgValid(bool valid) frame->setPalette(palette); combobox->qwidget()->setPalette(palette); - if(innerwidget) innerwidget->setWdgValid(valid); + // if(innerwidget) innerwidget->setWdgValid(valid); } -- cgit v1.2.3