Hi,

I am relatively new to Qt and am having a problem with a signal/slot configuration. I am using Qt version 4.2.2, Win.

I have a QMainWindow ho have a toolbar and QGraphicsView .
I want to draw a QGraphicsItem when a action(toolbar button) is clicked.

h file
class FoApp : public QMainWindow
{
Q_OBJECT
......
QAction *warkCj
QToolBar *workToolbar;

FoMap *view;
}

cpp file
void FoApp::initActions()
{
....
warkCj = new QAction(tr("C&j"), this);
warkCj->setShortcut(tr("Ctrl+J"));
warkCj->setStatusTip(tr("Insert CJ in the document"));
warkCj->setIcon(QIcon(QString::fromUtf8("../bitmaps/service.png")));
connect(warkCj, SIGNAL(triggered()), view, SLOT(AddCj));
....
}

h file
class FoMap : public QGraphicsView
{
Q_OBJECT
......
public slots:
virtual void AddCj();
...
private:
QGraphicsScene *scene;

}

cpp file

void FoMap::AddCablu()
{
item << new Cablu(scene,200, 100);
item.last()->setPos(QPointF(0, 100));
scene->addItem(item.last());
scene->update();
}


The code builds and there are no error messages displayed , but whwn i run the program, the program crash

If i comment connect(warkCj, SIGNAL(triggered()), view, SLOT(AddCj));
program run.