The solution of white screen crash when loading QML

1 reference link

qt – Rectangle element is not displayed – Stack Overflow

(122 messages) when QML starts on the development board, a white screen appears (two loading modes of QML)_ xi__ Q’s column CSDN blog

(122 messages) about the solution to the problem that the stackview cannot be displayed (white screen) on the target machine (customized Ubuntu) when QML is migrated from Ubuntu development_ Changsha red fat network technology (original name: Red Imitation workshop) – CSDN blog

2 best practices

main.cpp

#include <QGuiApplication>
#include <QQuickView>

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    QQuickView engine(QUrl(QStringLiteral("qrc:/main.qml")));
    engine.show();

    return app.exec();
}

Master.qml

import QtQuick 2.0

Rectangle {
    width: 100
    height: 100
    color: "red"
}

Read More: