Код: Выделить всё
test.cppКод: Выделить всё
#include
#include
#include
#include
class Exposed : public QQuickItem {
Q_OBJECT
public:
Q_PROPERTY(int property READ getProperty NOTIFY never)
~Exposed() { qInfo() setContextProperty("exposed", &e);
engine.load("test.qml");
app.exec();
engine.unload_the_object_loaded_two_lines_above();
// e will still be destroyed before engine but that's fine because nobody needs it anymore
Подробнее здесь: https://stackoverflow.com/questions/799 ... engineload
Мобильная версия