PDA

View Full Version : connect failed, slot not found



mustermann.klaus@gmx.de
15th December 2017, 09:36
Hallo everybody,

please have a look:


I subclassed "QAreaSeries" to "myQAreaSeries". No I want to connect a selfdesigned slot to some signal emitted by a chart on mainWindow. Somehow Qt tells me:


QObject::connect: No such slot QtCharts::QAreaSeries::setTextPosition(QRectF)


And here's some wrap up:



QT_CHARTS_USE_NAMESPACE

namespace Ui {
class myQAreaSeries;
}

class myQAreaSeries : public QAreaSeries
{

public:
// some member

private slots:

// here it is:
void setTextPosition(QRectF rect);


private:

// some member
};



The implementation:



#include "myqareaseries.h"

myQAreaSeries::myQAreaSeries(qreal in, qreal out , int track, QChartView *Chartview){


// here it even offers me the setTextPosition-SLOT, which it later doesn't find
connect(chartview->chart(), SIGNAL(plotAreaChanged(QRectF)), this, SLOT(setTextPosition(QRectF)));
}



void myQAreaSeries::setTextPosition(QRectF rect){

// some action
}




Most likely I missed something at school.
Thanks in advance for your replies.

Lars

^NyAw^
15th December 2017, 10:49
Hi,



class myQAreaSeries : public QAreaSeries
{
Q_OBJECT
...
...
...
};

mustermann.klaus@gmx.de
15th December 2017, 11:56
Oh my, what do I have to pay you, to not to make this public :-) Cost' me half a day.
After all I got a 'undefined reference to 'vtable' error. Had to refresh my qmake. Now it works.

Thanks a million, Lars

d_stranz
15th December 2017, 14:38
When the invoice from the forum arrives in your Inbox, just pay it. Don't argue, don't make noise, just pay it... :cool:

^NyAw^
15th December 2017, 16:23
Oh my, what do I have to pay you, to not to make this public :-)


Only one smile. ;-)



When the invoice from the forum arrives in your Inbox, just pay it. Don't argue, don't make noise, just pay it...


50% for me and 50% for you? ;-)

Have a nice day