问题
I have an application (audio player for http://vk.com) which uses OAuth 2.0 authorization. What i did was that i implemented QtWebEngineView object and used it to open an authorization page. Basically, it looks like currently i'm using quite a big class for such a little job. Anyway, i need to make a static build of my application — unfortunately, from my researches i've discovered people saying that making a static build of QtWebEngine-dependent application is not possible for some reasons.
Is this true? If so, are there any alternatives — maybe some classes made for OAuth 2.0 authentication?
Any help would be much appreciated!
回答1:
Yes, webengine can't be built statically. More info is here: http://lists.qt-project.org/pipermail/qtwebengine/2015-December/000264.html.
What you can do, is use C++ libraries (such as https://github.com/sirikata/liboauthcpp) for OAuth and add them to your project: http://doc.qt.io/qt-5/third-party-libraries.html. After that expose that to qml which is fairly simple: http://doc.qt.io/qt-5/qtqml-cppintegration-exposecppattributes.html
That way you can create simple authorization page using QML and authenticate using underlying C++ library.
来源:https://stackoverflow.com/questions/37093711/static-build-of-qtwebengine-dependent-application