Implement QWindowsMsaaAccessible::put_accValue

Implement QWindowsMsaaAccessible::put_accValue so automated UI tests
which utilize Accessibility API (at least WinLDTP
https://github.com/ldtp/cobra) can set values of QSliders,
QSpinBoxes, etc...

Task-number: QTBUG-55546
Change-Id: I0f3f21000fbf1468c35e322eff3f7224da746a0c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
This commit is contained in:
Teijo Hakala 2016-09-19 07:50:09 +03:00 committed by Jan Arve Sæther
parent 06bd93c4ac
commit 99b6eb4382

View File

@ -1053,11 +1053,24 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accValue(VARIANT varID, BS
return S_FALSE;
}
HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::put_accValue(VARIANT, BSTR)
HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::put_accValue(VARIANT, BSTR value)
{
QAccessibleInterface *accessible = accessibleInterface();
accessibleDebugClientCalls(accessible);
return DISP_E_MEMBERNOTFOUND;
if (!accessible || !accessible->isValid()) {
return E_FAIL;
}
QString qstrValue = QString::fromWCharArray(value);
if (accessible->valueInterface()) {
accessible->valueInterface()->setCurrentValue(qstrValue);
} else {
accessible->setText(QAccessible::Value, qstrValue);
}
return S_OK;
}
// moz: [important]