dajunior
5th April 2015, 22:09
I read similar threads but they didn't help me.
What's wrong with my code?
the file is included in the pro file.
Anyway there are errors about vtable...
#ifndef CUBE_H
#define CUBE_H
#include <QObject>
class cube: public QObject
{
Q_OBJECT
public:
explicit cube(QObject *parent=0)
{
for(int i=0; i<9; i++)
{
front[i]=Qt::white;
back[i]=Qt::yellow;
up[i]=Qt::green;
down[i]=Qt::blue;
left[i]=Qt::red;
right[i]=Qt::magenta;
}
}
~cube()
{
}
public:
void draw(QPainter & painter);
void moveFront();
void moveBack();
void moveUp();
void moveDown();
void moveLeft();
void moveRight();
void moveFrontInverted();
void moveBackInverted();
void moveUpInverted();
void moveDownInverted();
void moveLeftInverted();
void moveRightInverted();
void rotateSide(Qt::GlobalColor side[9]);
void rotateSideInverted(Qt::GlobalColor side[9]);
void rotateRibs(Qt::GlobalColor &a1, Qt::GlobalColor &a2, Qt::GlobalColor &a3, Qt::GlobalColor &b1, Qt::GlobalColor &b2, Qt::GlobalColor &b3, Qt::GlobalColor &c1, Qt::GlobalColor &c2, Qt::GlobalColor &c3, Qt::GlobalColor &d1, Qt::GlobalColor &d2, Qt::GlobalColor &d3);
void rotateRibsInverted(Qt::GlobalColor &a1, Qt::GlobalColor &a2, Qt::GlobalColor &a3, Qt::GlobalColor &b1, Qt::GlobalColor &b2, Qt::GlobalColor &b3, Qt::GlobalColor &c1, Qt::GlobalColor &c2, Qt::GlobalColor &c3, Qt::GlobalColor &d1, Qt::GlobalColor &d2, Qt::GlobalColor &d3);
private:
Qt::GlobalColor front[9];
Qt::GlobalColor back[9];
Qt::GlobalColor up[9];
Qt::GlobalColor down[9];
Qt::GlobalColor left[9];
Qt::GlobalColor right[9];
signals:
void changed();
};
#endif // CUBE_H
Added after 37 minutes:
the problem is with the QtCreator, because the code works well being compiling manually with qmake and make utilities.
What can be wrong with the QtCreator?
What's wrong with my code?
the file is included in the pro file.
Anyway there are errors about vtable...
#ifndef CUBE_H
#define CUBE_H
#include <QObject>
class cube: public QObject
{
Q_OBJECT
public:
explicit cube(QObject *parent=0)
{
for(int i=0; i<9; i++)
{
front[i]=Qt::white;
back[i]=Qt::yellow;
up[i]=Qt::green;
down[i]=Qt::blue;
left[i]=Qt::red;
right[i]=Qt::magenta;
}
}
~cube()
{
}
public:
void draw(QPainter & painter);
void moveFront();
void moveBack();
void moveUp();
void moveDown();
void moveLeft();
void moveRight();
void moveFrontInverted();
void moveBackInverted();
void moveUpInverted();
void moveDownInverted();
void moveLeftInverted();
void moveRightInverted();
void rotateSide(Qt::GlobalColor side[9]);
void rotateSideInverted(Qt::GlobalColor side[9]);
void rotateRibs(Qt::GlobalColor &a1, Qt::GlobalColor &a2, Qt::GlobalColor &a3, Qt::GlobalColor &b1, Qt::GlobalColor &b2, Qt::GlobalColor &b3, Qt::GlobalColor &c1, Qt::GlobalColor &c2, Qt::GlobalColor &c3, Qt::GlobalColor &d1, Qt::GlobalColor &d2, Qt::GlobalColor &d3);
void rotateRibsInverted(Qt::GlobalColor &a1, Qt::GlobalColor &a2, Qt::GlobalColor &a3, Qt::GlobalColor &b1, Qt::GlobalColor &b2, Qt::GlobalColor &b3, Qt::GlobalColor &c1, Qt::GlobalColor &c2, Qt::GlobalColor &c3, Qt::GlobalColor &d1, Qt::GlobalColor &d2, Qt::GlobalColor &d3);
private:
Qt::GlobalColor front[9];
Qt::GlobalColor back[9];
Qt::GlobalColor up[9];
Qt::GlobalColor down[9];
Qt::GlobalColor left[9];
Qt::GlobalColor right[9];
signals:
void changed();
};
#endif // CUBE_H
Added after 37 minutes:
the problem is with the QtCreator, because the code works well being compiling manually with qmake and make utilities.
What can be wrong with the QtCreator?