-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Use QtAV In Your Projects
For QtAV version >= 1.3.4, QtAV can be installed as Qt5 modules easily. Integrating QtAV in your project is very easy.
There are 2 ways to install QtAV SDK:
-
Install without building QtAV https://github.com/wang-bin/QtAV/wiki/Deploy-SDK-Without-Building-QtAV
-
Or download the latest QtAV code and build by yourself. Then go to building directory,
sdk_install.sh
orsdk_install.bat
.OSX is a little different because the shared library id must be modified but
sdk_install.sh
just simply copy files. you have to runQtAV/tools/sdk_osx.sh
.Assume your Qt is installed in
$HOME/Qt5.7
, then runQtAV/tools/sdk_osx.sh QtAV_buildDir/lib_mac_x86_64_llvm/QtAV*.framework ~/Qt5.7/5.7/clang_64/lib`
But on OS X, notice that you still need to run
QtAV_buildDir/sdk_install.sh
if you need to use QtAV's QML modules. (QtAV/tools/sdk_osx.sh
will NOT install QML module)
-
qmake Project (
.pro
file)-
In Qt4:
CONFIG += avwidgets
-
In Qt5:
QT += avwidgets
In Qt5, if
QWidgets
module and QtAV widget based renderers are not required by your project (For example, you just need QML modules only), you can simply addQT += av
There is an template pro you can use: https://github.com/wang-bin/QtAV/blob/master/tools/qtav_app_template.pro
-
-
C++ Code
add
#include <QtAV> #include <QtAVWidgets>
Make sure
QtAV::Widgets::registerRenderers()
is called before creating a renderer. -
QML Code
import QtAV 1.6
If your QtCreator cannot recognize QtAV in QML code, maybe can try add following line in
*.pro
QML_IMPORT_PATH += [QtAVSourceCodeDir]/qml
In the latest code, examples/simpleplayer_sdk
is a complete example to show how to use QtAV SDK to write an multimedia app. You can use simpleplayer_sdk.pro
as a template.
Because qt automatically rename the module if it's name contains Qt
, so you may get cannot find -lQt5AVWidgets
. As a temporary workaround, please manually rename libQtAVWidgets.so
to libQt5AVWidgets.so
(windows is Qt5AV.lib or Qt5AV.a) in $QTDIR/lib
. -lQt5AV
error is the same.
It should be fixed in 1.9.0