Is there a different way to create a dynamic array of QObject? The following code would not compile:
QStringList labels = defaultScene->getLabels();
QAction* traceActions = new QAction[labels.size()];
The error is:
C2512: ‘QAction’ : no appropriate default constructor available
You’re seeing this because QAction doesn’t have a default constructor.
You could create an array of pointers to QAction and then instantiate each QAction on it’s own.
Something roughly like: