Important: Please read the Qt Code of Conduct -

Concentric circles example

  • Hi there,

    I'm unable to get the concentric circles example found here working:

    There are a couple of mistakes on this page:

    • On line 3 '#include <QtWidgets>'
    • I do not see the 'circleWidgets' array defined anywhere.

    But the problem is when I attempt to implement the code in a similar fashion, I'm running into this error:

    c:\qt5\qtbase\include\QtWidgets/qwidget.h:720:5: error: 'QWidget::QWidget(const QWidget&)' is private

    Which seems to relate to the constructor in circlewidget.cpp or perhaps its header?

    CircleWidget::CircleWidget(QWidget *parent)
    : QWidget(parent)

    Can anyone offer some advice? Thank you.

  • As advised on the #qt freenode channel, this is due to the way in which I was declaring circle widgets when calling it from window.cpp, I had missed off the pointer definition (*) when instantiating it.

    CircleWidget* circleWidgets = new CircleWidget

    I then received an error about vtables, so need to work on the Q_OBJECT macro in the header files.

Log in to reply