QCustomPlot Discussion and Comments

QCPAxis subclassReturn to overview

Hello QCustomPlot users,

I am trying to subclass QCPAxis without success.
With the following code, i have the error "error C2512: 'QCPAxis' : no default constructor available".
I don't know why. Normally, QCPAxis constructor is already deined int the base class.

class CAxis : public QCPAxis
//using QCPAxis::QCPAxis;
CAxis(QCPAxisRect *parent, AxisType type)
QCPAxis::QCPAxis(parent, type);



Your help will be appreciated.

somewhere you're trying to call a default constructor for QCPAxis (a constructor without parameters). For example that line using QCPAxis::QCPAxis; could potentially be a problem... but it's commented out in your case. Also make sure to not comment-out the Q_OBJECT macro as in your code above.