<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Add an accessible role to an existing class]]></title><description><![CDATA[<p dir="auto">Hi,<br />
I'm trying to add an accessible role to an existing class.<br />
For example, a role tree in a class of type QTreeWidget<br />
There is a way to do this without rewrite all code to create an accessible class?<br />
I readed all examples of qtbase/src/widget/accessible but I sucess nothing when I trying to use it on my existing app :(</p>
]]></description><link>https://forum.qt.io/topic/126699/add-an-accessible-role-to-an-existing-class</link><generator>RSS for Node</generator><lastBuildDate>Wed, 13 May 2026 07:28:36 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/126699.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 16 May 2021 13:31:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Add an accessible role to an existing class on Wed, 19 May 2021 11:53:46 GMT]]></title><description><![CDATA[<p dir="auto">Oh, hmmmm, I readed this doc but it's really difficult to do this I think :)</p>
]]></description><link>https://forum.qt.io/post/660502</link><guid isPermaLink="true">https://forum.qt.io/post/660502</guid><dc:creator><![CDATA[Oreonan]]></dc:creator><pubDate>Wed, 19 May 2021 11:53:46 GMT</pubDate></item><item><title><![CDATA[Reply to Add an accessible role to an existing class on Mon, 17 May 2021 19:16:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/oreonan">@<bdi>Oreonan</bdi></a> said in <a href="/post/660032">Add an accessible role to an existing class</a>:</p>
<blockquote>
<p dir="auto">I have a model representing a tree with 2 columns, one for item name, one for state (enabled/disabled). I want to set an accessible role to checkbox because I think like this a screen reader can be able to say if an item is enabled or disabled. Currently I use the accessible text role to do that but it's not a good solution for me.</p>
</blockquote>
<p dir="auto">i haven't used the accessible framework for a while, but i think you will have to create a <a href="https://doc.qt.io/qt-5/accessible-qwidget.html#implementing-accessibility" target="_blank" rel="noopener noreferrer nofollow ugc">custom accessible interface</a> (plugin or in source) for your tree widget to represent the checkbox in the interface</p>
]]></description><link>https://forum.qt.io/post/660175</link><guid isPermaLink="true">https://forum.qt.io/post/660175</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Mon, 17 May 2021 19:16:09 GMT</pubDate></item><item><title><![CDATA[Reply to Add an accessible role to an existing class on Mon, 17 May 2021 19:12:47 GMT]]></title><description><![CDATA[<p dir="auto">Hi,<br />
As suggested by <a class="plugin-mentions-user plugin-mentions-a" href="/user/raven-worx">@<bdi>raven-worx</bdi></a><br />
<a class="plugin-mentions-user plugin-mentions-a" href="/user/raven-worx">@<bdi>raven-worx</bdi></a> said in <a href="/post/659979">Add an accessible role to an existing class</a>:</p>
<blockquote>
<p dir="auto">Qt::AccessibleTextRole</p>
</blockquote>
<p dir="auto">Why not return the values you want for that role ?</p>
]]></description><link>https://forum.qt.io/post/660174</link><guid isPermaLink="true">https://forum.qt.io/post/660174</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Mon, 17 May 2021 19:12:47 GMT</pubDate></item><item><title><![CDATA[Reply to Add an accessible role to an existing class on Tue, 18 May 2021 09:16:15 GMT]]></title><description><![CDATA[<p dir="auto">It's representing by a QModel with 2 columns and using Qt::DisplayRole, here is a part of code:</p>
<pre><code>    case Qt::DisplayRole :
        if(orientation == Qt::Horizontal)
        {
            switch(section)
            {
            case COLUMN_NAME: return tr("Event");
            case COLUMN_CHECK: return tr("Enabled");
            }
        }
        break;

    case Qt::DisplayRole :
        if (index.column() == COLUMN_CHECK)
            return (m_ttsselected &amp; m_ttsevents[index.row()])? tr("Enabled") : tr("Disabled");
        Q_ASSERT(index.column() == COLUMN_NAME);
        switch(m_ttsevents[index.row()])
        {
        case TTS_USER_LOGGEDIN :
            return tr("User logged in");
        case TTS_USER_LOGGEDOUT :
            return tr("User logged out");
//...
</code></pre>
]]></description><link>https://forum.qt.io/post/660080</link><guid isPermaLink="true">https://forum.qt.io/post/660080</guid><dc:creator><![CDATA[Oreonan]]></dc:creator><pubDate>Tue, 18 May 2021 09:16:15 GMT</pubDate></item><item><title><![CDATA[Reply to Add an accessible role to an existing class on Mon, 17 May 2021 10:39:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/oreonan">@<bdi>Oreonan</bdi></a> said in <a href="/post/660032">Add an accessible role to an existing class</a>:</p>
<blockquote>
<p dir="auto">one for state (enabled/disabled)</p>
</blockquote>
<p dir="auto">How is this represented? <code>QTreeWidget</code> can represent "chackboxes" natively</p>
]]></description><link>https://forum.qt.io/post/660057</link><guid isPermaLink="true">https://forum.qt.io/post/660057</guid><dc:creator><![CDATA[VRonin]]></dc:creator><pubDate>Mon, 17 May 2021 10:39:40 GMT</pubDate></item><item><title><![CDATA[Reply to Add an accessible role to an existing class on Mon, 17 May 2021 08:04:15 GMT]]></title><description><![CDATA[<p dir="auto">I have a model representing a tree with 2 columns, one for item name, one for state (enabled/disabled). I want to set an accessible role to checkbox because I think like this a screen reader can be able to say if an item is enabled or disabled. Currently I use the accessible text role to do that but it's not a good solution for me.</p>
]]></description><link>https://forum.qt.io/post/660032</link><guid isPermaLink="true">https://forum.qt.io/post/660032</guid><dc:creator><![CDATA[Oreonan]]></dc:creator><pubDate>Mon, 17 May 2021 08:04:15 GMT</pubDate></item><item><title><![CDATA[Reply to Add an accessible role to an existing class on Sun, 16 May 2021 20:41:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/oreonan">@<bdi>Oreonan</bdi></a><br />
what do you mean with that?</p>
]]></description><link>https://forum.qt.io/post/659997</link><guid isPermaLink="true">https://forum.qt.io/post/659997</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Sun, 16 May 2021 20:41:28 GMT</pubDate></item><item><title><![CDATA[Reply to Add an accessible role to an existing class on Sun, 16 May 2021 20:34:17 GMT]]></title><description><![CDATA[<p dir="auto">So I can't associate a QTreeWidgetItem to checkbox accessible role for example?</p>
]]></description><link>https://forum.qt.io/post/659994</link><guid isPermaLink="true">https://forum.qt.io/post/659994</guid><dc:creator><![CDATA[Oreonan]]></dc:creator><pubDate>Sun, 16 May 2021 20:34:17 GMT</pubDate></item><item><title><![CDATA[Reply to Add an accessible role to an existing class on Sun, 16 May 2021 19:27:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/oreonan">@<bdi>Oreonan</bdi></a><br />
a little bit more information would be helpful in order to help you<br />
<a href="https://doc.qt.io/qt-5/qt.html#ItemDataRole-enum" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qt.html#ItemDataRole-enum</a><br />
There is no <code>Qt::AccessibleRole</code> value for example, but a <code>Qt::AccessibleTextRole</code></p>
]]></description><link>https://forum.qt.io/post/659979</link><guid isPermaLink="true">https://forum.qt.io/post/659979</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Sun, 16 May 2021 19:27:07 GMT</pubDate></item><item><title><![CDATA[Reply to Add an accessible role to an existing class on Sun, 16 May 2021 19:05:48 GMT]]></title><description><![CDATA[<p dir="auto">Yes :), however I tried to set Qt::AccessibleRole, but it gives an compilation error</p>
]]></description><link>https://forum.qt.io/post/659976</link><guid isPermaLink="true">https://forum.qt.io/post/659976</guid><dc:creator><![CDATA[Oreonan]]></dc:creator><pubDate>Sun, 16 May 2021 19:05:48 GMT</pubDate></item><item><title><![CDATA[Reply to Add an accessible role to an existing class on Sun, 16 May 2021 18:00:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/oreonan">@<bdi>Oreonan</bdi></a><br />
for items widgets (which QTreeWidget is) the accesible data is coming from the model data</p>
]]></description><link>https://forum.qt.io/post/659956</link><guid isPermaLink="true">https://forum.qt.io/post/659956</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Sun, 16 May 2021 18:00:04 GMT</pubDate></item></channel></rss>