<?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[Calling update frequently]]></title><description><![CDATA[<p dir="auto">hi all,</p>
<p dir="auto">i am newbie to qt so please bear with me if solution is very obvious. My question is that i have a class MapGenerator which is calling  a function of my Qt class Mainwindow and updates the value of a variable and later this variable is used in paintevent method. i.e<br />
@class MapGenerator{<br />
void somefunction()<br />
{Mainwindow w:<br />
w.updatemap(data):<br />
}<br />
}:@</p>
<p dir="auto">Now in class Mainwindow i have</p>
<p dir="auto">@class MainWindow{<br />
void updatemap(int data)<br />
save data;</p>
<p dir="auto">}<br />
void paintEvent(){<br />
using that data doing painting<br />
}<br />
};@</p>
<p dir="auto">Now the problem is that when first time updatemap is called and paint event gets that data and paint but for the second call or frequent call i dont know how to handle recalling paintevent  . i tried update() in MainWindow::updateMap() after saving data but it yielded me segmentation fault.<br />
(p.s class MapGenerator is on other thread so updatemap is being called from other thread not the main thread so update() shouldnt work from there but signals/slot also gives the same error)</p>
<p dir="auto">i am using ubuntu 10.04 with qt 4. The code provided here is just psuedo code for keeping things simple.<br />
Thanks</p>
]]></description><link>https://forum.qt.io/topic/17633/calling-update-frequently</link><generator>RSS for Node</generator><lastBuildDate>Sun, 07 Jun 2026 04:14:58 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/17633.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 18 Jun 2012 09:48:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Calling update frequently on Tue, 19 Jun 2012 08:35:46 GMT]]></title><description><![CDATA[<p dir="auto">Emitting a signal in updateMap that is connected to MainWindow::update() should work, even when the signal is emitted from a seperate thread. The slot should then be executed in the receiver's thread.</p>
]]></description><link>https://forum.qt.io/post/142094</link><guid isPermaLink="true">https://forum.qt.io/post/142094</guid><dc:creator><![CDATA[mkuettler]]></dc:creator><pubDate>Tue, 19 Jun 2012 08:35:46 GMT</pubDate></item><item><title><![CDATA[Reply to Calling update frequently on Mon, 18 Jun 2012 11:46:31 GMT]]></title><description><![CDATA[<p dir="auto">How about timer which will check changing of value and signal update if value is changed.</p>
]]></description><link>https://forum.qt.io/post/141988</link><guid isPermaLink="true">https://forum.qt.io/post/141988</guid><dc:creator><![CDATA[AcerExtensa]]></dc:creator><pubDate>Mon, 18 Jun 2012 11:46:31 GMT</pubDate></item></channel></rss>