Warning, /libraries/phonon/doc/Phonon4Qt5.dox is written in an unsupported language. File is not indexed.

0001 /**
0002 
0003 \page phonon4qt5 Phonon4Qt5
0004 
0005 <p><b>
0006 \ref index "Overview" |
0007 Phonon4Qt5
0008 </b></p>
0009 
0010 Phonon4Qt5, as the name suggests, is a version of the Phonon 4 library built
0011 against Qt5 rather than Qt4.
0012 
0013 It has the same API as a Phonon built against Qt4, but differs in ABI and file
0014 names.
0015 This allows development and/or delpoyment of your application to happen against
0016 either version of Qt.
0017 
0018 \section phonon4qt5_building Building
0019 
0020 If you are building against a qt-project provided binary build of Qt5
0021 you may have to define the CMAKE_PREFIX_PATH to make CMake find Qt5. If you are
0022 using QMake for your application you will additionally have to instruct cmake to
0023 install Qt extensions into the actual Qt directory using
0024 KDE_INSTALL_USE_QT_SYS_PATHS.
0025 
0026 For example:
0027 \verbatim
0028 mkdir build5
0029 cd build5
0030 cmake .. -DPHONON_BUILD_PHONON4QT5=ON -DCMAKE_PREFIX_PATH=/opt/Qt5.0.0/5.0.0/gcc_64 -DKDE_INSTALL_USE_QT_SYS_PATHS=ON
0031 \endverbatim
0032 
0033 Phonon4Qt5 installation does not conflict with regular Phonon installations in
0034 any way; It uses different file and folder names for everything installed.
0035 
0036 \section phonon4qt5_using Usage
0037 
0038 Except for a couple of lines in CMake, using Phonon4Qt5 is identical to using
0039 the (old) Qt4 Phonon.
0040 
0041 \subsection phonon4qt5_using_cmake CMake
0042 To check for Phonon4Qt5 in your CMake project simply use find_package. Variables
0043 other than *_FOUND variable will have a generic PHONON prefix making it easier
0044 to support both versions without excessive if/else blocks.
0045 
0046 \code{.cmake}
0047 if(BUILDING_AGAINST_QT5)
0048     find_package(Phonon4Qt5 REQUIRED)
0049 else()
0050     find_package(Phonon REQUIRED)
0051 endif()
0052 
0053 # These are present regardless of which path was chosen
0054 message("${PHONON_LIBRARY} contains the path to libphonon4qt5 or libphonon")
0055 message("${PHONON_INCLUDE_DIR} contains the phonon4qt5 or phonon include directory")
0056 \endcode
0057 
0058 \note While you were able to get away with not adding PHONON_INCLUDE_DIR to
0059 CMake's include_directories on various Unix systems, this will not work with
0060 Phonon4Qt5; It is using nested directories to achieve 100 % source compatibility
0061 with Phonon, so your compiler will not be able to find phonon/* includes by
0062 simply looking in standard paths.
0063 
0064 \subsection phonon4qt5_using_qmake QMake
0065 
0066 To use Phonon4Qt5 in your QMake project you can simply use:
0067 \code{.pro}
0068 QT += phonon4qt5
0069 \endcode
0070 
0071 QMake will take care of everything else. Except in certain situations QMake will
0072 not be able to find the files necessary to enable a phonon4qt5 build, building
0073 phono4qt5 with KDE_INSTALL_USE_QT_SYS_PATHS, as explained above,
0074 should prevent this from happening.
0075 
0076 \subsection phonon4qt5_using_cpp C++
0077 
0078 For the actual code there is absolutely no difference between Phonon and
0079 Phonon4Qt5.
0080 
0081 Consequently the following code example will work with either version:
0082 \code{.cpp}
0083 #include <QUrl>
0084 #include <phonon/MediaSource>
0085 
0086 int main()
0087 {
0088     QUrl url("file:///home/user/firefly.webm");
0089     Phonon::MediaSource source(url);
0090     if (!source.isValid())
0091         return 1;
0092     return 0;
0093 }
0094 \endcode
0095 
0096 */