This is the part of my Class definition/.hpp file:
class RenderGraphFrame : public QGLWidget
{
public:
RenderGraphFrame(QWidget *parent);
private slots:
void PrevButton();
void NextButton();
private:
void draw();
QWidget *p_parent;
bool ButtonsInited;
QPushButton *nextButton;
QPushButton *prevButton;
}
And this are the related source parts:
RenderGraphFrame::RenderGraphFrame(QWidget *parent)
: QGLWidget(QGLFormat(/*QGL::SampleBuffers*/), parent)
{
p_parent = parent;
/* ... */
}
void RenderGraphFrame::draw()
{
if (ButtonsInited == false)
{
bool tmpttest_success;
nextButton = parent->findChild<QPushButton *>("nextButton", Qt::FindChildrenRecursively);
prevButton = p_parent->findChild<QPushButton *>("prevButton", Qt::FindChildrenRecursively);
tmpttest_success = connect(_nextButton, SIGNAL (released()), this, SLOT(NextButton()));
if (tmptest_success == false)
{
//this is what happens but I don't want it to happen...
}
}
/*....*/
}
void RenderGraphFrame::NextButton()
{
/*somestuff*/
return;
}
void RenderGraphFrame::PrevButton()
{
/*somestuff*/
return;
}
and I get the error:
QObject::connect: No such slot QGLWidget::NextButton() in ..\Graph\some\path\to.cpp:160
QObject::connect: (sender name: 'nextButton')
Ofcouse there isn't, because I don't want to connect QGLWidget::NextButton()
, as I want to connect RenderGraphFrame::NextButton()
.
How I can solve this? I allready locked up all these posts about "no such slot" qt errors. but they seemed to be at all caused by other problems than mine.
So any suggestions how to fix this?