i actually tried putting the semicolon but the error still resides... 
and when i start another project and did the same thing, i actually get another set of errors! 
let me show u all my codes in the whole project..
here is the main.cpp...
#include <QApplication>
#include "BlinkingIcon.h"
int main(int argc, char *argv[])
{
BlinkingIcon picIcon;
picIcon.show();
return app.exec();
}
#include <QApplication>
#include "BlinkingIcon.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
BlinkingIcon picIcon;
picIcon.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
next is the blinkingicon.h...
#ifndef __BLINKINGICON_H__
#define __BLINKINGICON_H__
#include <QWidget>
#include <QLabel>
class BlinkingIcon
: public QWidget{
Q_OBJECT
public:
virtual ~BlinkingIcon();
private:
}
#endif //__BLINKINGICON_H__
#ifndef __BLINKINGICON_H__
#define __BLINKINGICON_H__
#include <QWidget>
#include <QLabel>
class BlinkingIcon : public QWidget
{
Q_OBJECT
public:
BlinkingIcon(QWidget *parent = 0);
virtual ~BlinkingIcon();
private:
QLabel * display_image;
}
#endif //__BLINKINGICON_H__
To copy to clipboard, switch view to plain text mode
following which, is the blinkingicon.cpp...
#include "BlinkingIcon.h"
BlinkingIcon
::BlinkingIcon(QWidget * parent
){
this->setWindowTitle(tr("My Blinking Icon"));
this->resize(200,200);
display_image
= new QLabel(this);
display_image
->setPixmap
(QPixmap("C:\HmiProject\blinkingIcon\sprites\ship\ship0000.png"));
display_image->adjustSize();
}
BlinkingIcon::~BlinkingIcon(){}
#include "BlinkingIcon.h"
BlinkingIcon::BlinkingIcon(QWidget * parent)
: QWidget(parent)
{
this->setWindowTitle(tr("My Blinking Icon"));
this->resize(200,200);
display_image = new QLabel(this);
display_image->setPixmap(QPixmap("C:\HmiProject\blinkingIcon\sprites\ship\ship0000.png"));
display_image->adjustSize();
}
BlinkingIcon::~BlinkingIcon(){}
To copy to clipboard, switch view to plain text mode
the new set of errors i am getting now is...
src\main.cpp:7: error: new types may not be defined in a return type
src\main.cpp:7: note: (perhaps a semicolon is missing after the definition of `BlinkingIcon')
src\main.cpp:7: error: extraneous `int' ignored
src\main.cpp: In function `BlinkingIcon qMain(int, char**)':
src\main.cpp:11: error: invalid conversion from `int' to `
QWidget*' src\main.cpp:11: error: initializing argument 1 of `BlinkingIcon::BlinkingIcon(QWidget*)'
src\main.cpp: In copy constructor `BlinkingIcon::BlinkingIcon(const BlinkingIcon&)':
../../HMIDeveloper/Qt/include/QtGui/../../src/gui/kernel/qwidget.h:720: error: `QWidget::QWidget(const QWidget&)' is private
src\main.cpp:11: error: within this context
src\main.cpp: In function `BlinkingIcon qMain(int, char**)':
src\main.cpp:11: error: initializing temporary from result of `BlinkingIcon::BlinkingIcon(QWidget*)'
mingw32-make[1]: *** [build\host\main.o] Error 1
mingw32-make: *** [release] Error 2
src\main.cpp:7: error: new types may not be defined in a return type
src\main.cpp:7: note: (perhaps a semicolon is missing after the definition of `BlinkingIcon')
src\main.cpp:7: error: extraneous `int' ignored
src\main.cpp: In function `BlinkingIcon qMain(int, char**)':
src\main.cpp:11: error: invalid conversion from `int' to `QWidget*'
src\main.cpp:11: error: initializing argument 1 of `BlinkingIcon::BlinkingIcon(QWidget*)'
src\main.cpp: In copy constructor `BlinkingIcon::BlinkingIcon(const BlinkingIcon&)':
../../HMIDeveloper/Qt/include/QtGui/../../src/gui/kernel/qwidget.h:720: error: `QWidget::QWidget(const QWidget&)' is private
src\main.cpp:11: error: within this context
src\main.cpp: In function `BlinkingIcon qMain(int, char**)':
src\main.cpp:11: error: initializing temporary from result of `BlinkingIcon::BlinkingIcon(QWidget*)'
mingw32-make[1]: *** [build\host\main.o] Error 1
mingw32-make: *** [release] Error 2
To copy to clipboard, switch view to plain text mode
I don't quite get it... line 7 of main.cpp is a "{", no BlinkingIcon definition until line 9... as for line 11 i tried changing the return type to "int" type by "int(app.exec() )" but it also doesn't work. another thing i tried was to put "QWidget main(int argc, char *argv[])" or "void main(int argc, char *argv[])" instead of "int main(int argc, char *argv[])" but it doesn't help either.
As for the other errors at line 11 (regarding qMain), I am totally lost.
Hope you guys can enlighten me... Thanks loads!!!
Bookmarks