QT program porting: porting from linux to Windows

After developing the QT program on linux, and trying to transfer the program to Windows, a series of problems occurred in the compilation.

1. To use QWebView on linux, you need to modify QWebview to QWebEngineView

2. Report an alarm: The file contains characters that cannot be represented in the current code page (936). Please save the file in Unicode format to prevent data loss.

Answer: This warning is followed by a series of errors, such as unexpected end of comment encountered, etc. Possibly because the code was ported from elsewhere, the format of the file might be different. Therefore, it is necessary to modify the encoding format of the file. Under normal circumstances, Unix is ​​UT-F8, and Windows is ANSI or GBk. You can change the encoding format of the file to UTF-8+BOM encoding.

3. When running, the Chinese interface displays garbled characters.


Answer: Do not use the tr() function. It is recommended to use functions such as QString:::fromXXX() or QStringLiteral("XXX");

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324476915&siteId=291194637