Morea
14th January 2007, 14:32
error: 'connect' was not declared in this scope
this is the error I get when trying to compile this code:
------ cpp file --------
#include "Fraga.h"
#include <QtGui>
#include <QtCore>
Fraga::Fraga()
{
_nyttsvar = new QAction("new answer",0);
qDebug()<<"hej"<<connect(_nyttsvar,SIGNAL(triggered()),this,SLOT(ad dNewSvar()));
}
----------- h file-----------
#ifndef FRAGA_H
#define FRAGA_H
#include <QtCore>
#include <QtGui>
class Fraga:public QGraphicsRectItem{
Q_OBJECT
public:
Fraga();
public slots:
void addNewSvar();
protected:
QAction* _nyttsvar;
};
#endif
I do not understand what's wrong.
this is the error I get when trying to compile this code:
------ cpp file --------
#include "Fraga.h"
#include <QtGui>
#include <QtCore>
Fraga::Fraga()
{
_nyttsvar = new QAction("new answer",0);
qDebug()<<"hej"<<connect(_nyttsvar,SIGNAL(triggered()),this,SLOT(ad dNewSvar()));
}
----------- h file-----------
#ifndef FRAGA_H
#define FRAGA_H
#include <QtCore>
#include <QtGui>
class Fraga:public QGraphicsRectItem{
Q_OBJECT
public:
Fraga();
public slots:
void addNewSvar();
protected:
QAction* _nyttsvar;
};
#endif
I do not understand what's wrong.