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)
QObject::connect: No such slot QtCharts::QAreaSeries::setTextPosition(QRectF)
To copy to clipboard, switch view to plain text mode
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
};
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
};
To copy to clipboard, switch view to plain text mode
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
}
#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
}
To copy to clipboard, switch view to plain text mode
Most likely I missed something at school.
Thanks in advance for your replies.
Lars
Bookmarks