<?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[exe closes immediately after compiling]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I have a question about my programm.<br />
After compiling it, i only see a few moment a graphical interface and then the programm will closed.<br />
I tryed to copy some synthax from working example code but it seems that i have somewhere do a mistake...<br />
I thinkt it´s not a hard problem, but for hel i´m really grateful.<br />
Here a snippet of my code:</p>
<pre><code>//main.h , in my case it will open the NeuLoad case:

#include &lt;QApplication&gt;
#include "Hauptmenu.h"
#include "Funktionen.h"

int main(int argc, char *argv[] )
{
	QApplication app(argc,argv);
	Funktionen funktionen;	
	if(funktionen.FolderCheck()==true)
	{
		Hauptmenu window;
		window.show();
	}
	
	else
	{
		NeuLoad window2;
		window2.show();
	}
	
	return app.exec();
}
</code></pre>
<pre><code>//NeuLoad.h

#ifndef NEULOAD_H
#define NEULOAD_H
#include &lt;QtGui&gt;
#include &lt;QDialog&gt;
#include &lt;QMessageBox&gt;
#include "ui_NeuLoad.h"

class NeuLoad : public QDialog, private Ui::NeuLoad
{
	Q_OBJECT
	
	public:
		NeuLoad();
		~NeuLoad() {}
	protected slots:
		void openHauptmenu();
		void openFreischaltcode();
	
		
	
};
#endif // NEULOAD_H
</code></pre>
<p dir="auto">and the NeuLoad.cpp:</p>
<pre><code>//NeuLoad.cpp

#include "NeuLoad.h"
#include "Hauptmenu.h"
#include "Freischaltcode.h"

NeuLoad::NeuLoad()
{
		
	setupUi(this);	

//Bereich für Signal Slot Verbindungen:
connect(neu, SIGNAL(clicked()),	
		this, SLOT(openHauptmenu()));			//Button neu ruft Hauptmenü auf
			
connect(best, SIGNAL(clicked()),	
		this, SLOT(openFreischaltcode()));		//Button best ruft Freischaltcodemenü auf
}
	
void NeuLoad::openHauptmenu()
{
	
	Hauptmenu *HaMenu = new Hauptmenu();
	HaMenu-&gt;show();
}
	
void NeuLoad::openFreischaltcode()
{
	Freischaltcode *FrMenu = new Freischaltcode();
	FrMenu-&gt;show();
}
</code></pre>
<p dir="auto">Thank you for your help.</p>
<p dir="auto">greetings<br />
Allerknappe</p>
<p dir="auto"><em>[Edit: fixed markup ~~ @Wieland]</em></p>
]]></description><link>https://forum.qt.io/topic/83937/exe-closes-immediately-after-compiling</link><generator>RSS for Node</generator><lastBuildDate>Sat, 26 Sep 2026 07:32:42 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/83937.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 06 Oct 2017 10:10:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to exe closes immediately after compiling on Fri, 06 Oct 2017 10:22:44 GMT]]></title><description><![CDATA[<pre><code>if ( ... )
{ 
    // local scope begins here 
    Hauptmenu window; // create window in local scope 
    ...
    // local scope ends, window gets destroys	
}
</code></pre>
<p dir="auto">Hi! Your windows are created in the local scope of your <code>if</code> statement. Thus they are created on the stack and get destroyed once the control leaves the local scope.</p>
]]></description><link>https://forum.qt.io/post/419148</link><guid isPermaLink="true">https://forum.qt.io/post/419148</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 06 Oct 2017 10:22:44 GMT</pubDate></item><item><title><![CDATA[Reply to exe closes immediately after compiling on Fri, 06 Oct 2017 19:20:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/allerknappe">@<bdi>Allerknappe</bdi></a> if your problem is solved, could you please mark your post as such? Thanks.</p>
]]></description><link>https://forum.qt.io/post/419227</link><guid isPermaLink="true">https://forum.qt.io/post/419227</guid><dc:creator><![CDATA[Pablo J. Rogina]]></dc:creator><pubDate>Fri, 06 Oct 2017 19:20:46 GMT</pubDate></item><item><title><![CDATA[Reply to exe closes immediately after compiling on Fri, 06 Oct 2017 10:34:17 GMT]]></title><description><![CDATA[<p dir="auto">ah ok so easy... thank you for help</p>
]]></description><link>https://forum.qt.io/post/419151</link><guid isPermaLink="true">https://forum.qt.io/post/419151</guid><dc:creator><![CDATA[Allerknappe]]></dc:creator><pubDate>Fri, 06 Oct 2017 10:34:17 GMT</pubDate></item><item><title><![CDATA[Reply to exe closes immediately after compiling on Fri, 06 Oct 2017 10:22:44 GMT]]></title><description><![CDATA[<pre><code>if ( ... )
{ 
    // local scope begins here 
    Hauptmenu window; // create window in local scope 
    ...
    // local scope ends, window gets destroys	
}
</code></pre>
<p dir="auto">Hi! Your windows are created in the local scope of your <code>if</code> statement. Thus they are created on the stack and get destroyed once the control leaves the local scope.</p>
]]></description><link>https://forum.qt.io/post/419148</link><guid isPermaLink="true">https://forum.qt.io/post/419148</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 06 Oct 2017 10:22:44 GMT</pubDate></item></channel></rss>