'Call to implicitly-deleted copy constructor' when attempting to implement class inheritance

  • Hi,

    I have a generic Worksheet class, and am trying to create a new inherited class called LocalWorksheet. Here is the stripped out source code that I am using.


    #include <worksheet.h>
    class LocalWorksheet : public Worksheet
        LocalWorksheet(const QString &title);


    #include "localworksheet.h"
    LocalWorksheet::LocalWorksheet(const QString &title) : Worksheet(title)

    The error I'm getting is this:

        LocalWorksheet w = LocalWorksheet(title);
                       ^   ~~~~~~~~~~~~~~~~~~~~~

    What am I doing wrong?

  • Lifetime Qt Champion


    QObject is a non copyable type. See here for more information.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.