| | |
| | | } |
| | | ``` |
| | | |
| | | You can also initialize the agent after the window constructs. |
| | | If you don't want to derive a new widget class or change the constructor, you can initialize the agent after the window constructs. |
| | | |
| | | ```c++ |
| | | auto w = new MyWidget(); |
| | |
| | | private: |
| | | DynamicApis() { |
| | | #define DYNAMIC_API_RESOLVE(DLL, NAME) \ |
| | | p##NAME = reinterpret_cast<decltype(p##NAME)>(DLL.resolve(#NAME)) |
| | | p##NAME = reinterpret_cast<decltype(p##NAME)>(DLL.resolve(#NAME)) |
| | | |
| | | QSystemLibrary user32(QStringLiteral("user32")); |
| | | DYNAMIC_API_RESOLVE(user32, GetDpiForWindow); |