I'm making a simple animation software, cutting it short, basically, i have made few classes out of which
FrameManager class manages animation frames (inside a QMap<int, Frame*> )
FramesEditor class inherits QGraphicsView and is used to view current active frame ( QGraphicsScene)
These classes are all implemented using singleton design pattern, however, im facing issue when defining connection only between FrameManager and FramesEditor instances
in FrameManager class
void FrameManager::setCurrentActiveFrame(int frameID)
{
qDebug()<<">>> frameManager.cpp : currentActiveFrame ID : "<<currentActiveFrame;
Frame *activeFrame = frameBank[keyStartFrame];
if(frameBank.contains(frameID)){
currentActiveFrame = frameID;
activeFrame = frameBank[currentActiveFrame];
}
qDebug()<<">>> frameManager.cpp : currentActiveFrame ID updated: "<<currentActiveFrame;
emit (FramesEditor::getInstance())->setNewActiveFrame(activeFrame); //causing error
}
void FrameManager::setCurrentActiveFrame(int frameID)
{
qDebug()<<">>> frameManager.cpp : currentActiveFrame ID : "<<currentActiveFrame;
Frame *activeFrame = frameBank[keyStartFrame];
if(frameBank.contains(frameID)){
currentActiveFrame = frameID;
activeFrame = frameBank[currentActiveFrame];
}
qDebug()<<">>> frameManager.cpp : currentActiveFrame ID updated: "<<currentActiveFrame;
emit (FramesEditor::getInstance())->setNewActiveFrame(activeFrame); //causing error
}
To copy to clipboard, switch view to plain text mode
the last line where im emitting the signal, it is causing the issue
E:\GITHUB_REPOSITORIES\ProtoAnimator\protoanimator\framemanager.cpp:74: error: undefined reference to `FramesEditor::setNewActiveFrame(Frame*)'
E:\GITHUB_REPOSITORIES\ProtoAnimator\protoanimator\framemanager.cpp:74: error: undefined reference to `FramesEditor::setNewActiveFrame(Frame*)'
To copy to clipboard, switch view to plain text mode
I've checked everything such as including frameseditor.h header and related files but could not figure out why is this happening
in case you need more code, here is how im defining connections
I have 3 classes (singleton)
1. Manager (this class is acting as a communication handler between other 2 manager classes)
2. FrameManager
3. SpriteManager
the manager class is acting as a central class that is initialized first
inside it's constructor, i have one of the connection
connect(FramesEditor::getInstance(), SIGNAL(setNewActiveFrame(Frame*)), FramesEditor::getInstance(), SLOT(renderFrame(Frame*)));
connect(FramesEditor::getInstance(), SIGNAL(setNewActiveFrame(Frame*)), FramesEditor::getInstance(), SLOT(renderFrame(Frame*)));
To copy to clipboard, switch view to plain text mode
note that renderFrame(Frame*) simply calls setScene() method
Bookmarks