<?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[[SOLVED] QRectF crashes the GUI upon exiting]]></title><description><![CDATA[<p dir="auto">Hi all,</p>
<p dir="auto">I am currently creating a half circle gauge widget using qpainter. However, just the creation of QRectF object itself makes the GUI to be crashing when exiting. Attached below are my code, and I am just creating this object as normal in main.cpp. If the creation of QRectF is commented out, there is no problem. I have also tried with pointer creation and it still gives the same result. Please guide me.</p>
<p dir="auto">@<br />
#ifndef GAUGE_H<br />
#define GAUGE_H</p>
<p dir="auto">#include &lt;QWidget&gt;<br />
#include &lt;QPainter&gt;</p>
<p dir="auto">class Gauge : public QWidget<br />
{<br />
Q_OBJECT<br />
public:<br />
Gauge();</p>
<p dir="auto">protected:<br />
void paintEvent ( QPaintEvent *  );<br />
private:<br />
QPainterPath* greenRegion, *amberRegion, *redRegion;<br />
QRectF rect;<br />
};</p>
<p dir="auto">#endif<br />
@</p>
]]></description><link>https://forum.qt.io/topic/42889/solved-qrectf-crashes-the-gui-upon-exiting</link><generator>RSS for Node</generator><lastBuildDate>Sun, 03 May 2026 00:55:49 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/42889.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 24 Jun 2014 06:40:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [SOLVED] QRectF crashes the GUI upon exiting on Thu, 03 Jul 2014 10:44:05 GMT]]></title><description><![CDATA[<p dir="auto">I think even in QT Creator we need to manually run the qmake. Have a look at this "thread":<a href="http://qt-project.org/forums/viewthread/40352" target="_blank" rel="noopener noreferrer nofollow ugc">http://qt-project.org/forums/viewthread/40352</a>.</p>
<p dir="auto">Anyway thank you for the reply. By running the qmake everytime after adding a .h file, the problem is no longer there.</p>
]]></description><link>https://forum.qt.io/post/234461</link><guid isPermaLink="true">https://forum.qt.io/post/234461</guid><dc:creator><![CDATA[nanthiran_2005]]></dc:creator><pubDate>Thu, 03 Jul 2014 10:44:05 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QRectF crashes the GUI upon exiting on Thu, 03 Jul 2014 08:55:52 GMT]]></title><description><![CDATA[<p dir="auto">Yea I got in the habit of making sure I qmake all the time.  I do it a lot even when I don't need to.  Nothing more annoying than searching out a compiler issue because you didn't qmake. :)</p>
<p dir="auto">Anyway, that being said, just make sure you do it after any changes to your pro file.  If you are using Qt Creator I thought this was supposed to be automatic.  I'm not sure though I tend to use SlickEdit or just vim for editing and build via qmake/make on the command line or in slickedit.  So I always need to run qmake manually.</p>
]]></description><link>https://forum.qt.io/post/234454</link><guid isPermaLink="true">https://forum.qt.io/post/234454</guid><dc:creator><![CDATA[ambershark]]></dc:creator><pubDate>Thu, 03 Jul 2014 08:55:52 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QRectF crashes the GUI upon exiting on Thu, 03 Jul 2014 04:55:08 GMT]]></title><description><![CDATA[<p dir="auto">I see. Yes, I actually never re-run the qmake every time after I add a new header file. I didn't know that I have to.</p>
<p dir="auto">Thank you <em>ambershark</em></p>
]]></description><link>https://forum.qt.io/post/234424</link><guid isPermaLink="true">https://forum.qt.io/post/234424</guid><dc:creator><![CDATA[nanthiran_2005]]></dc:creator><pubDate>Thu, 03 Jul 2014 04:55:08 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QRectF crashes the GUI upon exiting on Wed, 02 Jul 2014 21:37:29 GMT]]></title><description><![CDATA[<p dir="auto">No problem.  I'm guessing you may have just needed to run a qmake.  You probably added the header to the pro file and Qt Creator never re-ran qmake thus it didn't realize things had changed.</p>
<p dir="auto">Just a guess without seeing it, but I'm pretty sure that's what happened if the qmake/make worked for you. :)</p>
]]></description><link>https://forum.qt.io/post/234385</link><guid isPermaLink="true">https://forum.qt.io/post/234385</guid><dc:creator><![CDATA[ambershark]]></dc:creator><pubDate>Wed, 02 Jul 2014 21:37:29 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QRectF crashes the GUI upon exiting on Wed, 02 Jul 2014 06:57:00 GMT]]></title><description><![CDATA[<p dir="auto">I did as you said. And at the time the problem is not there after I add a variable and make changes in the corresponding .cpp file.</p>
<p dir="auto">I hope that really solves it.</p>
<p dir="auto">Thanks <em>ambershark</em>.</p>
]]></description><link>https://forum.qt.io/post/234293</link><guid isPermaLink="true">https://forum.qt.io/post/234293</guid><dc:creator><![CDATA[nanthiran_2005]]></dc:creator><pubDate>Wed, 02 Jul 2014 06:57:00 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QRectF crashes the GUI upon exiting on Wed, 02 Jul 2014 06:09:21 GMT]]></title><description><![CDATA[<p dir="auto">Hmm, if it's mingw this is definitely odd behavior indeed.</p>
<p dir="auto">Maybe try running qmake to make sure that your project.pro.user file is up to date.</p>
<p dir="auto">If it were me I would take it down to the command line and cut out the ide.  Then use:</p>
<p dir="auto">@<br />
$ qmake<br />
$ make<br />
@</p>
<p dir="auto">And then once the build is complete, modify that header file (add a variable or whatever), touch the corresponding cpp file and make again.  If it picks it up then it should be fine, there may be an issue with your ide at that point.</p>
<p dir="auto">I don't know what else it could be it's a weird problem.</p>
]]></description><link>https://forum.qt.io/post/234290</link><guid isPermaLink="true">https://forum.qt.io/post/234290</guid><dc:creator><![CDATA[ambershark]]></dc:creator><pubDate>Wed, 02 Jul 2014 06:09:21 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QRectF crashes the GUI upon exiting on Wed, 02 Jul 2014 05:45:52 GMT]]></title><description><![CDATA[<p dir="auto">I am using MinGW 4.8.2 compiler.</p>
]]></description><link>https://forum.qt.io/post/234286</link><guid isPermaLink="true">https://forum.qt.io/post/234286</guid><dc:creator><![CDATA[nanthiran_2005]]></dc:creator><pubDate>Wed, 02 Jul 2014 05:45:52 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QRectF crashes the GUI upon exiting on Wed, 02 Jul 2014 04:41:46 GMT]]></title><description><![CDATA[<p dir="auto">Is your compiler mingw or msvc?  I'm going to guess msvc cause your pro file looks good with the headers so mingw shouldn't be having the missing .h file checks that is causing your problem.</p>
<p dir="auto">If it is msvc I'll have to let someone else help you.  I don't really use it anymore, I think I have one legacy project that still uses it over mingw, but I haven't put any time into it since like 2000.  So I just don't have the knowledge of it's idiosyncrasies.</p>
]]></description><link>https://forum.qt.io/post/234280</link><guid isPermaLink="true">https://forum.qt.io/post/234280</guid><dc:creator><![CDATA[ambershark]]></dc:creator><pubDate>Wed, 02 Jul 2014 04:41:46 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QRectF crashes the GUI upon exiting on Wed, 02 Jul 2014 04:36:07 GMT]]></title><description><![CDATA[<p dir="auto">Attached below is my .pro file. I am currently using Qt Creator 5.3.</p>
<p dir="auto">@<br />
QT       += core gui</p>
<p dir="auto">greaterThan(QT_MAJOR_VERSION, 4): QT += widgets</p>
<p dir="auto">TARGET = gui<br />
TEMPLATE = app</p>
<p dir="auto">HEADERS  += widget.h <br />
data.h <br />
graph.h <br />
barchart.h <br />
udp.h <br />
gauge.h <br />
gauge2.h</p>
<p dir="auto">SOURCES += main.cpp<br />
widget.cpp <br />
data.cpp <br />
graph.cpp <br />
barchart.cpp <br />
udp.cpp <br />
gauge.cpp <br />
gauge2.cpp</p>
<p dir="auto">FORMS    += widget.ui</p>
<p dir="auto">QT += multimedia</p>
<p dir="auto">win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../Qwt-6.1.0/lib/ -lqwt<br />
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../../Qwt-6.1.0/lib/ -lqwtd</p>
<p dir="auto">INCLUDEPATH += $$PWD/../../../../../../Qwt-6.1.0/include<br />
DEPENDPATH += $$PWD/../../../../../../Qwt-6.1.0/include<br />
@</p>
]]></description><link>https://forum.qt.io/post/234279</link><guid isPermaLink="true">https://forum.qt.io/post/234279</guid><dc:creator><![CDATA[nanthiran_2005]]></dc:creator><pubDate>Wed, 02 Jul 2014 04:36:07 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QRectF crashes the GUI upon exiting on Tue, 01 Jul 2014 21:33:26 GMT]]></title><description><![CDATA[<p dir="auto">Can you post your .pro file?  Also what is your compiler?  Are you using an IDE (msvc/qt creator/etc)?</p>
]]></description><link>https://forum.qt.io/post/234227</link><guid isPermaLink="true">https://forum.qt.io/post/234227</guid><dc:creator><![CDATA[ambershark]]></dc:creator><pubDate>Tue, 01 Jul 2014 21:33:26 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QRectF crashes the GUI upon exiting on Tue, 01 Jul 2014 08:44:22 GMT]]></title><description><![CDATA[<p dir="auto">The header files are already included. <em>asperamanca</em> yes I am working with qwt library.</p>
]]></description><link>https://forum.qt.io/post/234127</link><guid isPermaLink="true">https://forum.qt.io/post/234127</guid><dc:creator><![CDATA[nanthiran_2005]]></dc:creator><pubDate>Tue, 01 Jul 2014 08:44:22 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QRectF crashes the GUI upon exiting on Tue, 01 Jul 2014 06:32:00 GMT]]></title><description><![CDATA[<p dir="auto">Yea it's not memory corruption.  It is the compiler not picking up the header changes, thus forcing a rebuild to pick them up.</p>
<p dir="auto">Make sure you have the header files defined in your *.pro file.</p>
<p dir="auto">I.e.</p>
<p dir="auto">@<br />
HEADERS += <br />
myheader.h <br />
anotherheader.h</p>
<p dir="auto">SOURCES += <br />
myheader.cpp <br />
anotherheader.cpp<br />
@</p>
<p dir="auto">Without that HEADERS line it will seem to compile properly but won't actually pick up header changes and can cause some really weird issues (at least with gcc).</p>
]]></description><link>https://forum.qt.io/post/234103</link><guid isPermaLink="true">https://forum.qt.io/post/234103</guid><dc:creator><![CDATA[ambershark]]></dc:creator><pubDate>Tue, 01 Jul 2014 06:32:00 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QRectF crashes the GUI upon exiting on Tue, 01 Jul 2014 06:18:16 GMT]]></title><description><![CDATA[<p dir="auto">This sounds like your compiler somehow does not get the required dependency information, and does not recompile all files that use this changed header file.</p>
<p dir="auto">Is this a single project, or are you working with libraries?</p>
]]></description><link>https://forum.qt.io/post/234099</link><guid isPermaLink="true">https://forum.qt.io/post/234099</guid><dc:creator><![CDATA[Asperamanca]]></dc:creator><pubDate>Tue, 01 Jul 2014 06:18:16 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QRectF crashes the GUI upon exiting on Mon, 30 Jun 2014 13:01:34 GMT]]></title><description><![CDATA[<p dir="auto">May be change the order of variables you declare inside class and see how it goes.</p>
]]></description><link>https://forum.qt.io/post/234007</link><guid isPermaLink="true">https://forum.qt.io/post/234007</guid><dc:creator><![CDATA[dheerendra]]></dc:creator><pubDate>Mon, 30 Jun 2014 13:01:34 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QRectF crashes the GUI upon exiting on Mon, 30 Jun 2014 09:21:52 GMT]]></title><description><![CDATA[<p dir="auto">I realized that the problem happens whenever I add a new variable (NOT a pointer variable) in .h file. So I believe it is memory issue as mentioned earlier. Is there way to solve it? At time being I am overcoming this problem by rebuilding the project.</p>
]]></description><link>https://forum.qt.io/post/233967</link><guid isPermaLink="true">https://forum.qt.io/post/233967</guid><dc:creator><![CDATA[nanthiran_2005]]></dc:creator><pubDate>Mon, 30 Jun 2014 09:21:52 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QRectF crashes the GUI upon exiting on Wed, 25 Jun 2014 04:49:42 GMT]]></title><description><![CDATA[<p dir="auto">It is running on windows 7. I think it is indeed memory corruption as the problem is no longer there after I clean and rebuild it. I will keep this in mind <em>Asperacama</em>. Thanks.</p>
]]></description><link>https://forum.qt.io/post/233346</link><guid isPermaLink="true">https://forum.qt.io/post/233346</guid><dc:creator><![CDATA[nanthiran_2005]]></dc:creator><pubDate>Wed, 25 Jun 2014 04:49:42 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QRectF crashes the GUI upon exiting on Tue, 24 Jun 2014 14:27:08 GMT]]></title><description><![CDATA[<p dir="auto">It seems unlikely that a relatively simple class such as QRectF would cause this issue. It is more likely that there's some kind of memory corruption in your code, and the QRectF just happens to be in the affected memory area.</p>
<p dir="auto">Take a close look at your object destruction order and whether there are any problems about the order or destroyed objects, or whether some objects are not destroyed when they should be. One way is to add a breakpoint to every constructor and destructor, and see whether the order you arrive at them makes any sense.</p>
<p dir="auto">If you are working on Linux, you can use the valgrind memory analyzer to find possible causes.</p>
]]></description><link>https://forum.qt.io/post/233251</link><guid isPermaLink="true">https://forum.qt.io/post/233251</guid><dc:creator><![CDATA[Asperamanca]]></dc:creator><pubDate>Tue, 24 Jun 2014 14:27:08 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] QRectF crashes the GUI upon exiting on Tue, 24 Jun 2014 07:15:04 GMT]]></title><description><![CDATA[<p dir="auto">It should not crash. Which platform ? Also can you paste the entire code ?</p>
]]></description><link>https://forum.qt.io/post/233165</link><guid isPermaLink="true">https://forum.qt.io/post/233165</guid><dc:creator><![CDATA[dheerendra]]></dc:creator><pubDate>Tue, 24 Jun 2014 07:15:04 GMT</pubDate></item></channel></rss>