Tag Archives: Software development

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"
}

Several reasons of program flashback crash

There are many reasons for software crashes.
 
The

memory

1. Memory leak; 2. Load resource crash.
CPU 1. The program is too complicated.

software and hardware compatibility

1. The runtime environment and hardware support do not match. For example, the Android system does not match, and the software running environment is missing.

system memory recovery mechanism

1. The system will recycle foreground processes when memory is tight.

program internal mechanisms

1. Some plug-ins or code actively performs software exit when it detects an abnormal running state at runtime.

[Reprint please indicate the link of this article]

Fatal error C1853 error occurs when there are mixed .c files in the VS project

Fatal error C1853 appears in VS project with.c file mixed in
The CPP files in the project after the C file and an error occurs at compile time fatal error C1853: “the debug/1 _1. PCH” is not a precomplied header file with this complier…
Reason for error: This error is because when the.cpP and.c files are mixed in the project, the compiler compiles them differently (mainly because of the way it handles function declarations) and cannot share the same precompiled header file.
In VC++, the default precompiled header is for C++ (stdafx.h and stdafx.cpp), but it is also possible to create precompiled headers for C. Interestingly, in older versions of VC++, the error message was misleading: fatal error C1853: ‘XXX. PCH’ is not a precompiled header file created with this compiler. It’s often confusing. It should be said that this tip in the new edition is an improvement. However, a search of the Internet on this issue is often recommended for the entire project to remove the precompiled header setting. This is clearly not a good solution. For a large project, using precompiled headers can significantly reduce the total compile time. Therefore, it is a better solution to leave the precompiled header Settings. Search MSDN, for different situations, there can be different solutions:
Plan 1
This applies if the vast majority of files are.cpP or.c.
In this case, it would be more balanced to set a few files of different classes to not use precompiled headers by:
For VC++6.0, right-click the.c (or.cpp) file in the FileView to uncompile, select Settings, and on the right side of the dialog box, select category as precompiled headers, and set the option not using… ;
For VS2005, right-click on the corresponding file in the Solution Explorer and select Properties, and set Not using… under preHeaders. Can.
If you need to set more than one file, hold down the Ctrl key and select both files and set.

Scheme 2
If you have a large number of files affected, disabling precompilation headers on all of them will still make the overall compilation speed of the project much slower than it would otherwise be. Consider creating a dedicated precompiled header for this set of files. In very early versions of VC++ (1.5 and before), it was possible to create precompiled headers for.c and.cpp in a single project, but later versions only supported separate precompiled headers. In this case, we can set up a new Static Library project in the workspace (or Solution), add all.c files to the project and compile them separately, so that we can create a precompiled header for.c files in the Static Library. But to do so requires that the code that is separated logically belongs to the same module in order to be maintainable. From a design point of view, however, this requirement is generally met; otherwise, consider the overall design of the project 😛 And finally, don’t forget to set the original project’s dependency as a separate static library project.