Skip to content

Commit

Permalink
docs: Added README."en".md translation via https://github.com/dephrai…
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed May 6, 2024
1 parent a52f020 commit d6f85c9
Showing 1 changed file with 53 additions and 35 deletions.
88 changes: 53 additions & 35 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
- [Simplified Chinese](README.md)
- [English](README.en.md)

Picture resources, etc. come from the Internet.
This code repository is for learning only. If it is used for commercial purposes by others, it has nothing to do with me! Please obey the license!
> Picture resources, etc. come from the Internet.
> This code repository is for learning only. If it is used for commercial purposes by others, it has nothing to do with me! Please obey the license!
## Qt-App

Expand All @@ -28,58 +28,76 @@ crash reporting program;
1. [utils](cmake/utils.cmake): Utility function;
2. [doc](doc):Document description and pictures;
3. [examples](examples):Sample code;
4. [packaging](packaging): Packaging and publishing;
4. [packaging](packaging):Packaging and publishing;
5. [src](src): source code;

1. [3rdparty](src/3rdparty): Third-party library;
1. [qtlockedfile](src/3rdparty/qtlockedfile):Qt file lock;
2. [qtsingleapplication](src/3rdparty/qtsingleapplication): Qt single instance;
3. [breakpad](src/3rdparty/breakpad.hpp): Crash capture based on Google Breakpad package;

2. [aggregate](src/aggregate):polymerization;

3. [apps](src/apps):app;
1. [app](src/apps/app):Qt-App;
2. [crashreport](src/apps/crashreport):CrashReport;

4. [core](src/core): Plug-ins are inherited here;
5. [extensionsystem](src/extensionsystem): Plug-in system, the code comes from Qt-Creator, with some modifications;
6. [gui](src/gui): Encapsulated interface component;
7. [plugins](src/plugins):Plug-in;

5. [dump](src/dump): Crash capture function;

1. [breakpad](src/dump/breakpad.hpp): Crash capture based on Google Breakpad package;
2. [crashpad](src/dump/crashpad.hpp): Crash capture based on Google Crashpad package;

> Under unix systems, you may need to`crashpad_handler`Grant execution permission, otherwise it will not start normally.
```bash
chmod +x crashpad_handler
```

6. [extensionsystem](src/extensionsystem): Plug-in system, the code comes from Qt-Creator, with some modifications;

7. [gui](src/gui): Encapsulated interface component;

8. [plugins](src/plugins):Plug-in;
1. [aboutplugin](src/plugins/aboutplugin):About the plug-in;
2. [coreplugin](src/plugins/coreplugin): Core plug-in, main interface, menu, toolbar, status bar, settings, plug-in manager, etc.;
3. [guiplugin](src/plugins/guiplugin): GUI plug-in, some GUI components customized based on QSS style;
4. [hashplugin](src/plugins/hashplugin): Hash plug-in, the hash algorithm provided by QT;
5. [helloplugin](src/plugins/helloplugin):Hello plug-in, used for testing plug-in development;
6. [systeminfoplugin](src/plugins/systeminfoplugin): System information plug-in;
8. [resource](resource): Pictures and QSS files;
9. [utils](utils): Tool function encapsulation;
6. [translations](translations):translate a file;

## Questions and comments

- MacOS, the bundle generated by cmake is not generated in the .app/Contents/ folder.`PkgInfo`document;
1. [app/CMakeLists](/apps/app/CMakeLists.txt), using this CMakeLists.txt, you can generate a bundle on MacOS and the icon can be displayed normally, but there is no PkgInfo file;
2. How does cmake generate PkgInfo files?
1. WireShark use`set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/PkgInfo PROPERTIES MACOSX_PACKAGE_LOCATION .)`Similar to this method, copy it to the bundle;
3. qmake will generate a PkgInfo file by default, you only need to specify`TARGET=app`or`CONFIG+=bundle`That’s it;
9. [resource](resource): Pictures and QSS files;

- Under Unix systems, you need to use static libraries as much as possible to avoid dependence on dynamic libraries;
1. Several modules in this project are dynamic libraries, and because they are plugins, they need to be loaded dynamically;
2. Then you need to package these dynamic libraries and load them at runtime. You also need to modify the rpath`"-Wl,-rpath,\'\$$ORIGIN\':\'\$$ORIGIN/lib\':'\$$ORIGIN/../lib'")`,进行设置,否则会找不到动态库;
3. Or use install_name_tool (macos), patchelf/chrpath (linux) to modify the dependency path of the dynamic library, which is very troublesome;
4. Also consider that these libraries can be shared, so do not package them repeatedly;
5. For details, please see[workflows](.github/workflows/cmake.yml)

- MacOS,[vcpkg](https://github.com/microsoft/vcpkg)Issues with compiling third-party libraries;
1. because[vcpkg](https://github.com/microsoft/vcpkg)at present[Only supports separate compilation of x64-osx and arm64-osx](https://github.com/microsoft/vcpkg/discussions/19454)
2. In use[cmake](.github/workflows/cmake.yml), you need to specify`CMAKE_OSX_ARCHITECTURES=x86_64`or`CMAKE_OSX_ARCHITECTURES=arm64`;
3. In use[qmake](.github/workflows/qmake.yml), you need to specify`QMAKE_APPLE_DEVICE_ARCHS=x86_64`or`QMAKE_APPLE_DEVICE_ARCHS=arm64`

- Why not use google crashpad as crash capture module?
1. [vcpkg](https://github.com/microsoft/vcpkg)right[crashpad](https://github.com/chromium/crashpad)exist`macos`and`linux`Poor support;
2. If you want to use[crashpad](https://github.com/chromium/crashpad)[Reference Code](https://github.com/RealChuan/Cpp-Examples/tree/master/Crashpad);
10. [utils](utils): Tool function encapsulation;
6. [translations](translations):translate a file;

- International real-time translation. After changing the translation settings, you need to restart the program to take effect;
## Questions and comments

1. Too lazy to change the code;
2. [Specific reference: QT practical tips (update as soon as I think of it)](https://realchuan.github.io/2021/10/12/QT%E5%AE%9E%E7%94%A8%E5%B0%8F%E6%8A%80%E5%B7%A7%EF%BC%88%E6%83%B3%E5%88%B0%E5%B0%B1%E6%9B%B4%E6%96%B0%EF%BC%89/), core code;
- > MacOS, the bundle generated by cmake is not generated in the .app/Contents/ folder`PkgInfo`document;
>
> 1. [app/CMakeLists](/apps/app/CMakeLists.txt), use this CMakeLists.txt to generate a bundle on MacOS, and the icon can be displayed normally, but there is no PkgInfo file;
> 2. How does cmake generate PkgInfo files?
> 1. WireShark use`set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/PkgInfo PROPERTIES MACOSX_PACKAGE_LOCATION .)`Similar to this method, copy it to the bundle;
> 3. qmake will generate a PkgInfo file by default, you only need to specify`TARGET=app`or`CONFIG+=bundle`That’s it;

- > Under Unix systems, you need to use static libraries as much as possible to avoid dependence on dynamic libraries;
>
> 1. Several modules in this project are dynamic libraries, and because they are plugins, they need to be loaded dynamically;
> 2. Then you need to package these dynamic libraries and load them at runtime. You also need to modify the rpath`"-Wl,-rpath,\'\$$ORIGIN\':\'\$$ORIGIN/lib\':'\$$ORIGIN/../lib'")`, set it, otherwise the dynamic library will not be found;
> 3. Or use install_name_tool (macos), patchelf/chrpath (linux) to modify the dependency path of the dynamic library, which is very troublesome;
> 4. Also consider that these libraries can be shared, so do not package them repeatedly;
> 5. For details, please see[workflows](.github/workflows/cmake.yml);

- > MacOS,[vcpkg](https://github.com/microsoft/vcpkg)Issues with compiling third-party libraries;
>
> 1. because[vcpkg](https://github.com/microsoft/vcpkg)at present[Only supports separate compilation of x64-osx and arm64-osx](https://github.com/microsoft/vcpkg/discussions/19454);
> 2. In use[cmake](.github/workflows/cmake.yml), you need to specify`CMAKE_OSX_ARCHITECTURES=x86_64`or`CMAKE_OSX_ARCHITECTURES=arm64`;
> 3. In use[qmake](.github/workflows/qmake.yml), you need to specify`QMAKE_APPLE_DEVICE_ARCHS=x86_64`or`QMAKE_APPLE_DEVICE_ARCHS=arm64`

- > International real-time translation. After changing the translation settings, you need to restart the program to take effect;
>
> 1. Too lazy to change the code;
> 2. [Specific reference: QT practical tips (update as soon as I think of it)](https://realchuan.github.io/2021/10/12/QT%E5%AE%9E%E7%94%A8%E5%B0%8F%E6%8A%80%E5%B7%A7%EF%BC%88%E6%83%B3%E5%88%B0%E5%B0%B1%E6%9B%B4%E6%96%B0%EF%BC%89/), core code;

```cpp
void Widget::changeEvent(QEvent *e)
Expand Down

0 comments on commit d6f85c9

Please sign in to comment.