bruceariggs
18th November 2011, 15:16
Okay,
I am trying to get a class that inherits from QGraphicsView (ChartViewer) and a class that inherits from QGraphicsScene (ChartScene) to use signals and slots to work with another class that inherits from QWidget (ChartPage).
ChartPage works fine with signals and slots to other objects.
ChartViewer and ChartScene however, cannot seem to use signals and slots. When I put the Q_OBJECT part at the beginning of the class, the code doesn't even seem to run. When I remove the Q_OBJECT part but leave my signals and slots in, the code builds, but all of my connect functions return a "No such signal: SIGNAL_NAME in QGraphicsView" for any signal or slot for either the view or the scene.
Here's a sample of the output I get:
Object::connect: No such signal QGraphicsScene::focusPointChanged( int, int )
Object::connect: No such slot QGraphicsView::enableMouseTracking( bool )
Object::connect: No such slot QGraphicsView::acknowledgePressed()
Object::connect: No such slot QGraphicsView::panLeft()
Object::connect: No such slot QGraphicsView::panRight()
Object::connect: No such slot QGraphicsView::panUp()
Object::connect: No such slot QGraphicsView::panDown()
Object::connect: No such slot QGraphicsView::setFollowOwnship( bool )
Object::connect: No such slot QGraphicsView::resetView()
Object::connect: No such slot QGraphicsView::toggleFreeze()
Object::connect: No such slot QGraphicsView::increaseScale()
Object::connect: No such slot QGraphicsView::decreaseScale()
Object::connect: No such slot QGraphicsView::setNorthUp( bool )
Object::connect: No such slot QGraphicsView::addWaypoint()
Object::connect: No such slot QGraphicsView::addMarkpointAtOwnship()
Object::connect: No such slot QGraphicsView::setMarkpointCursor()
Object::connect: No such slot QGraphicsScene::toggleRing( int )
Object::connect: No such slot QGraphicsScene::clearTargets()
Object::connect: No such slot QGraphicsScene::updateWaypoints()
Object::connect: No such slot QGraphicsScene::clearRoute()
Object::connect: No such signal QGraphicsView::launchRouteDialog()
Object::connect: (receiver name: 'ChartPage')
Object::connect: No such signal QGraphicsView::launchTargetDialog()
Object::connect: (receiver name: 'ChartPage')
Object::connect: No such slot QGraphicsScene::updateTargetRouteIndex( short )
Object::connect: (sender name: 'ChartPage')
So... can QGraphicsView and QGraphicsScene use signals and slots? If so... what's the trick to getting that to happen?
I am trying to get a class that inherits from QGraphicsView (ChartViewer) and a class that inherits from QGraphicsScene (ChartScene) to use signals and slots to work with another class that inherits from QWidget (ChartPage).
ChartPage works fine with signals and slots to other objects.
ChartViewer and ChartScene however, cannot seem to use signals and slots. When I put the Q_OBJECT part at the beginning of the class, the code doesn't even seem to run. When I remove the Q_OBJECT part but leave my signals and slots in, the code builds, but all of my connect functions return a "No such signal: SIGNAL_NAME in QGraphicsView" for any signal or slot for either the view or the scene.
Here's a sample of the output I get:
Object::connect: No such signal QGraphicsScene::focusPointChanged( int, int )
Object::connect: No such slot QGraphicsView::enableMouseTracking( bool )
Object::connect: No such slot QGraphicsView::acknowledgePressed()
Object::connect: No such slot QGraphicsView::panLeft()
Object::connect: No such slot QGraphicsView::panRight()
Object::connect: No such slot QGraphicsView::panUp()
Object::connect: No such slot QGraphicsView::panDown()
Object::connect: No such slot QGraphicsView::setFollowOwnship( bool )
Object::connect: No such slot QGraphicsView::resetView()
Object::connect: No such slot QGraphicsView::toggleFreeze()
Object::connect: No such slot QGraphicsView::increaseScale()
Object::connect: No such slot QGraphicsView::decreaseScale()
Object::connect: No such slot QGraphicsView::setNorthUp( bool )
Object::connect: No such slot QGraphicsView::addWaypoint()
Object::connect: No such slot QGraphicsView::addMarkpointAtOwnship()
Object::connect: No such slot QGraphicsView::setMarkpointCursor()
Object::connect: No such slot QGraphicsScene::toggleRing( int )
Object::connect: No such slot QGraphicsScene::clearTargets()
Object::connect: No such slot QGraphicsScene::updateWaypoints()
Object::connect: No such slot QGraphicsScene::clearRoute()
Object::connect: No such signal QGraphicsView::launchRouteDialog()
Object::connect: (receiver name: 'ChartPage')
Object::connect: No such signal QGraphicsView::launchTargetDialog()
Object::connect: (receiver name: 'ChartPage')
Object::connect: No such slot QGraphicsScene::updateTargetRouteIndex( short )
Object::connect: (sender name: 'ChartPage')
So... can QGraphicsView and QGraphicsScene use signals and slots? If so... what's the trick to getting that to happen?