#include "ui_ugp3-population-inspector.h"
#include "MicroGPMainWindow.h"
#include "MicroGPApplication.h"
using namespace std;
using namespace Ui;
// main
int main(int argc, char* argv[])
{
// create application
MicroGPApplication app(argc, argv);
// create widget that will be used as anchor for the ugp3.ui interface
// create window class defined by the ugp3.ui file
MicroGPMainWindow ugp3Window;
// bind window to widget
ugp3Window.setupUi(mainWindow);
// show window
mainWindow->show();
// return exit value of the application
return app.exec();
}
#include "ui_ugp3-population-inspector.h"
#include "MicroGPMainWindow.h"
#include "MicroGPApplication.h"
using namespace std;
using namespace Ui;
// main
int main(int argc, char* argv[])
{
// create application
MicroGPApplication app(argc, argv);
// create widget that will be used as anchor for the ugp3.ui interface
QMainWindow* mainWindow = new QMainWindow;
// create window class defined by the ugp3.ui file
MicroGPMainWindow ugp3Window;
// bind window to widget
ugp3Window.setupUi(mainWindow);
// show window
mainWindow->show();
// return exit value of the application
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Here it is! Apparently, the program crashes when it tries to create a MicroGPApplication object (which is a class inherited from QApplication). Here is the code for the MicroGPApplication class (it's just a header file):
#ifndef MICROGPAPPLICATION
#define MICROGPAPPLICATION
#include <QtGui>
#include <QApplication>
#include <QMessageBox>
{
public:
MicroGPApplication
(int
& argc,
char ** argv
) : QApplication(argc, argv
) { } virtual ~MicroGPApplication() { }
// reimplemented from QApplication so we can throw exceptions in slots
{
try
{
}
catch(std::exception& e)
{
QMessageBox::warning( 0, tr
("An error occurred"), e.
what() );
}
return false;
}
};
#endif
#ifndef MICROGPAPPLICATION
#define MICROGPAPPLICATION
#include <QtGui>
#include <QApplication>
#include <QMessageBox>
class MicroGPApplication : public QApplication
{
public:
MicroGPApplication(int& argc, char ** argv) : QApplication(argc, argv) { }
virtual ~MicroGPApplication() { }
// reimplemented from QApplication so we can throw exceptions in slots
virtual bool notify(QObject * receiver, QEvent * event)
{
try
{
return QApplication::notify(receiver, event);
}
catch(std::exception& e)
{
QMessageBox::warning( 0, tr("An error occurred"), e.what() );
}
return false;
}
};
#endif
To copy to clipboard, switch view to plain text mode
Added after 22 minutes:
Just a quick update: I finally managed to solve the issue. I have another system with Win7 64-bit, I just installed Qt 5.1.1 along with mingw 4.8, and - after a minor tweaking with the .pro - Qt Creator was able to successfully build and run the program.
On the other system, I had a separate, different version of mingw already installed when I installed Qt 5.1.1; so, my guess is that there was some kind of issue between the two versions (and probably the folders of *both* were inside PATH).
Thanks everyone for your help! :-)
Bookmarks