This is a good idea, we need a similar approach also in our projects, but QCoreApplicationPrivate::app_compile_version is not perfect, it is only valid after constructing QCoreApplication, I think we should change a better way to get a valid one at any time app_compile_version. I have an idea: we provide a static library, which defines only one function: int qt_app_compile_version() { return QT_VERSION; }, this static library will not be linked by any Qt library, we will add it to the provided by QtCore In the cmake pkgconfig and qmake modules, let other libraries or applications that use Qt link it statically, so that we can always get a valid app_compile_version in Qt library self's code.
________________________________ 发件人: Development <development-boun...@qt-project.org> 代表 Lars Knoll <lars.kn...@qt.io> 发送时间: 2022年6月9日 17:21 收件人: Alexander Akulich <akulichalexan...@gmail.com> 抄送: Qt development mailing list <development@qt-project.org> 主题: Re: [Development] Asking for a FF exception for ICU based QStringConverter > On 9 Jun 2022, at 19:16, Alexander Akulich <akulichalexan...@gmail.com> wrote: > > Hi everyone, > > On Wed, Jun 8, 2022 at 5:18 PM Fabian Kosmale <fabian.kosm...@qt.io> wrote: >> >> What remains to be done: >> - There are concerns that mixing Qt versions might lead to an unbounded >> memory leak with the current implementation. > > I can't find any precedent but if we *really* want then probably we > can get the "compiled with" Qt version from QCoreApplication > (QCoreApplicationPrivate::app_compile_version). > > 1. Allocate the resources only if the version >= 6.4.0 > 2. Probably add a "TODO: remove me" in 6.x.0 (e.g. after the next LTS) Nice idea. I could live with that solution. Only allocate the new codecs if Qt was compiled against 6.4.0 or greater, and if the app was compiled against an earlier version, simply return an invalid codec. Cheers, Lars _______________________________________________ Development mailing list Development@qt-project.org https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.qt-project.org%2Flistinfo%2Fdevelopment&data=05%7C01%7C%7C09274ddf101741d36ffb08da4a3cf005%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637903922842284753%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=0HnY8H73zAyqa0oNn71QsM5%2BktHUOnZmKlpJSI%2BYjrY%3D&reserved=0
_______________________________________________ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development