<?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[[Moved] Trying to access QTextEdit instance via Ui pointer within QTimer-callback-function leads to SIGSEGV]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">my situation is as follows:<br />
I'm using QtCreator to design my GUI and thus have a main window like this:<br />
@WASABIWindow::WASABIWindow(QWidget *parent) :<br />
QMainWindow(parent),<br />
ui(new Ui::WASABIWindow)<br />
{<br />
ui-&gt;setupUi(this);<br />
setCentralWidget(ui-&gt;tabWidgetMain);@</p>
<p dir="auto">In the end of the constructor I instantiate a QTimer *timer; like this:<br />
@timer = new QTimer(this);<br />
connect(timer, SIGNAL(timeout()), this, SLOT(update()));<br />
timer-&gt;start(2000); // 50Hz@</p>
<p dir="auto">"update()" is defined as a "private slot" in the header and within that function I am calling another function "updateGUI" (among other things). Liek here:<br />
<a class="plugin-mentions-user plugin-mentions-a" href="/user/void">@<bdi>void</bdi></a> WASABIWindow::update() {<br />
updateGUI();<br />
}@<br />
This "updateGUI(bool force = false)" is a private member function of my WASABIWindow.<br />
In this function, then, the following line gives me a SIGSEGV:<br />
@ui-&gt;textEditPAD-&gt;acceptDrops();@</p>
<p dir="auto">and it is totally irrelevant, what I try to call on textEditPAD. It always fails.<br />
Even this<br />
@    if (!ui){<br />
return;<br />
}@</p>
<p dir="auto">Did not help.</p>
<p dir="auto">What is the magic about this Ui-concept?<br />
Please help, I am desperate..</p>
]]></description><link>https://forum.qt.io/topic/9670/moved-trying-to-access-qtextedit-instance-via-ui-pointer-within-qtimer-callback-function-leads-to-sigsegv</link><generator>RSS for Node</generator><lastBuildDate>Tue, 09 Jun 2026 05:02:22 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/9670.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 20 Sep 2011 15:54:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [Moved] Trying to access QTextEdit instance via Ui pointer within QTimer-callback-function leads to SIGSEGV on Wed, 21 Sep 2011 10:01:35 GMT]]></title><description><![CDATA[<p dir="auto">Hi there,</p>
<p dir="auto">thanks for the tipp to build a test case. Indeed, a similar application with only one QTextEdit runs just fine. After two more hours of debugging I found this to be the problem:<br />
@setCentralWidget(ui-&gt;tabWidgetMain);@<br />
Due to this (experimentally induced) line of code, the texEditPAD was not visible during runtime! (Just the tabWidget is visible, nothing else.)</p>
<p dir="auto">Thus, any call to any function of that TextEdit was doomed to fail.</p>
<p dir="auto">After removing the "setCentralWidget" line, it works fine.</p>
<p dir="auto">Thanks for your replies,<br />
wumpus</p>
]]></description><link>https://forum.qt.io/post/110301</link><guid isPermaLink="true">https://forum.qt.io/post/110301</guid><dc:creator><![CDATA[wumpus]]></dc:creator><pubDate>Wed, 21 Sep 2011 10:01:35 GMT</pubDate></item><item><title><![CDATA[Reply to [Moved] Trying to access QTextEdit instance via Ui pointer within QTimer-callback-function leads to SIGSEGV on Tue, 20 Sep 2011 22:21:47 GMT]]></title><description><![CDATA[<p dir="auto">you should not call your slot update! update is slot inside QWidget. Perhaps that has some influence here...</p>
]]></description><link>https://forum.qt.io/post/110221</link><guid isPermaLink="true">https://forum.qt.io/post/110221</guid><dc:creator><![CDATA[giesbert]]></dc:creator><pubDate>Tue, 20 Sep 2011 22:21:47 GMT</pubDate></item><item><title><![CDATA[Reply to [Moved] Trying to access QTextEdit instance via Ui pointer within QTimer-callback-function leads to SIGSEGV on Tue, 20 Sep 2011 22:14:24 GMT]]></title><description><![CDATA[<p dir="auto">In general it should work this way, and it does in all my projects. Did you try to rebuild (clean &amp; compile) the whole project. Sometimes this solves weird errors.</p>
<p dir="auto">If that doesn't work, a small yet complete testcase that we can build ourselfs would help.</p>
]]></description><link>https://forum.qt.io/post/110218</link><guid isPermaLink="true">https://forum.qt.io/post/110218</guid><dc:creator><![CDATA[goetz]]></dc:creator><pubDate>Tue, 20 Sep 2011 22:14:24 GMT</pubDate></item></channel></rss>