miivers
21st September 2010, 09:58
Hello
I have finished a qt tutorial from another site. Everything runs fine except the GUI i made in QT Designer does not show up. All tutorials I can find on the subject implements it the same way.
So to summon it up. I only get a blank window when I run my project.
Main.cpp
#include <QtCore/QCoreApplication>
#include "TempForm.h"
#include "Window.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Window mWindow;
mWindow.resize(800,600);
mWindow.show();
return a.exec();
}
#endif
Window.h
#ifndef WINDOW_H
#define WINDOW_H
#include <QtOpenGl/QGLWidget>
#include <QtGui>
#include "TempForm.h"
class Window : public QWidget , private Ui::MainWindow //MainWindow is the class name from QT Designer header file (TempForm.h)
{
public:
Window(QWidget *parent = 0);
~Window();
};
#endif
Window.cpp
#include <QtGui/QMouseEvent>
#include "Window.h"
Window::Window(QWidget *parent)
{
setupUi(&(QMainWindow)this); // this sets up GUI
}
Window::~Window()
{
}
If I manually call each guielemts show function my application crash.
Any suggestions?
I have finished a qt tutorial from another site. Everything runs fine except the GUI i made in QT Designer does not show up. All tutorials I can find on the subject implements it the same way.
So to summon it up. I only get a blank window when I run my project.
Main.cpp
#include <QtCore/QCoreApplication>
#include "TempForm.h"
#include "Window.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Window mWindow;
mWindow.resize(800,600);
mWindow.show();
return a.exec();
}
#endif
Window.h
#ifndef WINDOW_H
#define WINDOW_H
#include <QtOpenGl/QGLWidget>
#include <QtGui>
#include "TempForm.h"
class Window : public QWidget , private Ui::MainWindow //MainWindow is the class name from QT Designer header file (TempForm.h)
{
public:
Window(QWidget *parent = 0);
~Window();
};
#endif
Window.cpp
#include <QtGui/QMouseEvent>
#include "Window.h"
Window::Window(QWidget *parent)
{
setupUi(&(QMainWindow)this); // this sets up GUI
}
Window::~Window()
{
}
If I manually call each guielemts show function my application crash.
Any suggestions?