[Interest] Accessibility - Different output to braille display and speech?
SM Clarke
forum19 at trumpton.org.uk
Fri Jun 21 18:52:18 CEST 2019
Is it possible to write a Qt application which passes two strings to a
screenreader (I'm using NVDA), such that the first string is what is
displayed on a Braille display, and the second string is spoken.
The reason is that I have a calendar application, with entries on the
screen in the form: "29 Aug 12:00 - 13:00 : Appointment", and I'd like to
see that visually on the screen and also on the braille display, but I'd
like the screen reader to speak "29th of August, 12pm to 1pm".
In this case, the string is in a QListView, and I've extended the Model to
manage and provide responses to the Qt::DsiplayRole and
Qt::AccessibleTextRole - see snippet below.
QVariant AccessibleStringListModel::data(const QModelIndex &index, int
role) const
>
> {
>
> int row = index.row() ;
>
> if (row<0 || row>=modeldata.size()) return QVariant() ;
>
> const QList<QVariant>& selected = modeldata.at(row) ;
>
> switch (role){
>
> case Qt::DisplayRole:
>
> return selected.at(0) ;
>
> break ;
>
> case Qt::AccessibleTextRole:
>
> return selected.at(1) ;
>
> break ;
>
> // case Qt::UserRole:
>
> // return selected.at(2) ;
>
> // break ;
>
> default: return QVariant() ;
>
> }
>
> }
>
>
The QListView correctly uses the DisplayRole to show the 'selected.at(0)'
on the screen.
It also uses the AccessibleTextRole to speak the 'selected.at(1)'.
But also uses the AccessibleTextRole for the output on the braille display.
Note: I realise that the UserRole has nothing to do with the screen /
display output.
I've also tried using the AccessibleDescriptionRole - this sends the same
output to the Braille display and speech, so doesn't help.
*Q: Is there a way to override the text used for speech such that the
Braille display and speech output are different?*
Thanks and Regards,
Steve C
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20190621/6d3d586c/attachment.html>
More information about the Interest
mailing list