qt-interest@trolltech.com
[Top] [All Lists]

Problem setting connection between signals and slots

Subject: Problem setting connection between signals and slots
From: Elvis Dowson
Date: Sat, 25 Oct 2008 14:27:46 +0400
Hi,
       I'm stuck at trying to set up a connection between a signal and a slot defined in the following classes. Could some one please let me know what I am doing wrong? It seems something to do with the types passed to the connect method. How can I fix this error? I want to connect QGraphicsView subclass to QVTKInteractor subclassed from QObject. 

/Users/elvis/Project/C4I/Source/cxx/vtkOffScreenRenderingCarbonTest/QVTKInteractor.cpp:107: error: 
no matching function for call to 'QVTKInteractor::connect(QWidget*&, const char [31], QVTKInteractor* const, const char [30])'
/Developer/Applications/Qt-4.4.3/lib/QtCore.framework/Versions/4/Headers/qobject.h:197: 
note: candidates are: static bool QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)
/Developer/Applications/Qt-4.4.3/lib/QtCore.framework/Versions/4/Headers/qobject.h:302: 
note: bool QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const

Here is what I am trying to do in a QVTKIteractor::SetupConnections() method

/*! Setup connections
 */
void QVTKInteractor::SetupConnections(QWidget* qWidget, vtkRenderWindow* renWin)
{
// Set the QWidget instance associated with the interactor
QObject::connect(qWidget, SIGNAL(mouseMoveEvent1(QMouseEvent*)), this, SLOT(MouseMoveEvent(QMouseEvent*)));
}


Here are my classes:

class QVTKGraphicsView : public QGraphicsView
{

Q_OBJECT
public:
Q_SIGNALS:
// Description:
// Signal for mouse move events.
void mouseMoveEvent1(QMouseEvent* event);

// Description:
// Overloaded virtual method for handling mouse events.
void mouseMoveEvent(QMouseEvent* event);
........
..
....}

// D// Description:
// O// Overloaded virtual method for handling mouse move events.
void QVTKGraphicsView::mouseMoveEvent(QMouseEvent* event)
{ {
{
emit mouseMoveEvent1(event);
QGraphicsView::mouseMoveEvent(event);
} } }


}
class QVTK_EXPORT QVTKInteractor : public QObject, public vtkRenderWindowInteractor
{{ {
Q_OBJECT
pub

public Q_SLOTS:


// Mouse move event slot
virtual void MouseMoveEvent(QMouseEvent* event);

} }

/*! handle mouse move event
 */* */
void QVTKInteractor::MouseMoveEvent(QMouseEvent* event)
{
{
  vtkDebugMacro(<< " Mouse move event received!");

}
}
B Best regards,

W Elvis Dowson


cx



<Prev in Thread] Current Thread [Next in Thread>