<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Linux Forum &mdash; Исспользование setCentralWidget в QT (4.1)]]></title>
		<link>https://linuxforum.ru/viewtopic.php?id=38054</link>
		<atom:link href="https://linuxforum.ru/extern.php?action=feed&amp;tid=38054&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «Исспользование setCentralWidget в QT (4.1)».]]></description>
		<lastBuildDate>Fri, 30 Dec 2016 19:42:08 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Исспользование setCentralWidget в QT (4.1)]]></title>
			<link>https://linuxforum.ru/viewtopic.php?pid=450003#p450003</link>
			<description><![CDATA[<p>Здравствуйте.<br />Хочу добавить возможность выбора центрального виджета. Выбор будет осуществляться в ToolBar.</p><p>В MainWindows создал toolBat и добавил два действия.<br /></p><div class="codebox"><pre><code>    toolBar = new QToolBar (&quot;Work Place&quot;);
    toolBar-&gt;addAction (&quot;Read&quot;, this, SLOT(creatReadWidget()));
    toolBar-&gt;addAction (&quot;Write&quot;, this, SLOT(createWriteWidget()));
    addToolBar (Qt::TopToolBarArea, toolBar);</code></pre></div><p>В слотах устанавливается виджет.<br /></p><div class="codebox"><pre><code>    setCentralWidget(pbtХ);</code></pre></div><p>При смене виджетов (нажатии Read-&gt;Write-&gt;Read) приложение завершается с ошибкой &quot;The program has unexpectedly finished.&quot; При этом множественная смена центрального виджета в конструкторе MainWindows проблем не вызывает.<br />Подскажите в чем может быть проблема ? Может есть другой подход к решению задачи ?</p>]]></description>
			<author><![CDATA[null@example.com (marik)]]></author>
			<pubDate>Fri, 30 Dec 2016 19:42:08 +0000</pubDate>
			<guid>https://linuxforum.ru/viewtopic.php?pid=450003#p450003</guid>
		</item>
	</channel>
</rss>
