hi ppl,
it may be a silly problem, but im unable to crack it. pls point it out.
1. main.cpp
#include <QApplication>
#include "mainwindow.h"
int main(int argc,char **argv)
{
MainWindow win;
win.show();
return app.exec();
}
#include <QApplication>
#include "mainwindow.h"
int main(int argc,char **argv)
{
QApplication app(argc,argv);
MainWindow win;
win.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
2. mainwindow.h
#ifndef __MAINWINDOW_H__
#define __MAINWINDOW_H__
#include <QMainWindow>
{
public:
MainWindow();
};
#endif // __MAINWINDOW_H__
#ifndef __MAINWINDOW_H__
#define __MAINWINDOW_H__
#include <QMainWindow>
class MainWindow: public QMainWindow
{
public:
MainWindow();
};
#endif // __MAINWINDOW_H__
To copy to clipboard, switch view to plain text mode
3. mainwindow.cpp
#include "mainwindow.h"
MainWindow::MainWindow()
{
qDebug("Test");
}
#include "mainwindow.h"
MainWindow::MainWindow()
{
qDebug("Test");
}
To copy to clipboard, switch view to plain text mode
4. randomplot.h
#ifndef __RANDOMPLOT_H__
#define __RANDOMPLOT_H__
#include<qwt_plot.h>
{
Q_OBJECT
MyPlot();
};
#endif // __RANDOMPLOT_H__
#ifndef __RANDOMPLOT_H__
#define __RANDOMPLOT_H__
#include<qwt_plot.h>
class MyPlot: public QwtPlot
{
Q_OBJECT
MyPlot();
};
#endif // __RANDOMPLOT_H__
To copy to clipboard, switch view to plain text mode
5. randomplot.cpp
#include "randomplot.h"
MyPlot::MyPlot()
{
qDebug("Indent");
}
#include "randomplot.h"
MyPlot::MyPlot()
{
qDebug("Indent");
}
To copy to clipboard, switch view to plain text mode
6. plot.pro
TEMPLATE = app
SOURCES += main.cpp mainwindow.cpp randomplot.cpp
HEADERS += mainwindow.h randomplot.h
CONFIG += release warn_on qt console
QT += core gui
INCLUDEPATH += c:\qwt-5.1.1\src
LIBS += c:\qwt-5.1.1\lib\libqwt5.a
I successfully, compiled the application on QDevelop on Windows XP. But when i tried to execute it, its giving the following error:
The application failed to initialize properly (0x0000005). Click on OK to terminate the application.
whats the problem?
When i removed the Q_OBJECT macro, its executing properly, no error was coming. whats that silly misake, pls suggest... thanks in advance.....bye
Bookmarks