<?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[How to actually activate sub tab ?]]></title><description><![CDATA[<p dir="auto">I have a main  QTab (ui-&gt;tabWidget) containing sub-tabs.<br />
I can switch / activate another tab  using known index</p>
<p dir="auto">ui-&gt;tabWidget-&gt;setCurrentIndex(1);</p>
<p dir="auto">How can I<br />
select the new tab and also  select one of its  sub-tabs.</p>
<p dir="auto">Can that be done using sub-tab name instead of index?<br />
The sub-tab index is dynamic -  new sub-tabs are added using slot.</p>
]]></description><link>https://forum.qt.io/topic/138101/how-to-actually-activate-sub-tab</link><generator>RSS for Node</generator><lastBuildDate>Sun, 08 Nov 2026 20:35:19 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/138101.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 22 Jul 2022 17:51:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to actually activate sub tab ? on Fri, 22 Jul 2022 18:29:13 GMT]]></title><description><![CDATA[<p dir="auto">@AnneRanch<br />
<strong>QTabWidget::widget(int index)</strong><br />
returns the widget at index.<br />
If it's a tab, you have to make a cast:</p>
<pre><code>QWidget* w=tabWidget-&gt;widget(1);  // widget at tab index 1
QTabWidget* subTab=qobject_cast&lt;QTabWidget*&gt;(w);

if(subTab)
  {
  subTab-&gt;setCurrentIndex(0);  // select first tab
  }
</code></pre>
]]></description><link>https://forum.qt.io/post/722338</link><guid isPermaLink="true">https://forum.qt.io/post/722338</guid><dc:creator><![CDATA[mpergand]]></dc:creator><pubDate>Fri, 22 Jul 2022 18:29:13 GMT</pubDate></item></channel></rss>