* BUG: ComboBox does not lose focus when its ReadOnly property is set.


git-svn-id: svn://localhost/gambas/trunk@3163 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2010-08-30 14:42:18 +00:00
parent 967a26bd68
commit aa2fbbb4d4
2 changed files with 13 additions and 4 deletions

View file

@ -387,6 +387,7 @@ static void combo_set_editable(void *_object, bool ed)
{
QLineEdit *textbox;
QString text;
bool hasFocus = COMBOBOX->hasFocus();
COMBOBOX->blockSignals(true);
text = COMBOBOX->currentText();
@ -411,11 +412,17 @@ static void combo_set_editable(void *_object, bool ed)
}
else
{
get(THIS, &textbox);
textbox->setFocusProxy(0);
COMBOBOX->setEditable(false);
COMBOBOX->update();
}
combo_set_text(THIS, text);
if (hasFocus)
COMBOBOX->setFocus();
if (CWIDGET_test_flag(THIS, WF_DESIGN))
COMBOBOX->setFocusPolicy(Qt::NoFocus);

View file

@ -1894,11 +1894,11 @@ void CWidget::destroy()
GB.Unref(POINTER(&ob));
}
static void post_dblclick_event(void *control)
/*static void post_dblclick_event(void *control)
{
GB.Raise(control, EVENT_DblClick, 0);
GB.Unref(&control);
}
}*/
static void post_focus_change(void *)
{
@ -2042,7 +2042,7 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
__FOCUS_IN:
{
//qDebug("FocusIn: %p %s (%p)", control, control->name, CWIDGET_active_control);
//qDebug("FocusIn: %p %s (%p %s)", control, control->name, CWIDGET_active_control, CWIDGET_active_control ? CWIDGET_active_control->name : "");
CWIDGET_active_control = control;
handle_focus_change();
CWINDOW_activate(control);
@ -2051,7 +2051,7 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
__FOCUS_OUT:
{
//qDebug("FocusOut: %p %s (%p)", control, control->name, CWIDGET_active_control);
//qDebug("FocusOut: %p %s (%p %s)", control, control->name, CWIDGET_active_control, CWIDGET_active_control ? CWIDGET_active_control->name : "");
CWIDGET_active_control = NULL;
handle_focus_change();
goto __NEXT;
@ -2200,6 +2200,7 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
goto __NEXT;
}
/*
__DBL_CLICK:
{
if (!original)
@ -2213,6 +2214,7 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
}
goto __NEXT;
}
*/
__KEY:
{