So I've installed QtMultimedia and in the picture, you can see all the modules installed.
Then I added modules to my project's qmake
QT += multimedia
QT += multimediawidgets
And I can easily use stuff like QVideoWidget or QMediaPlayer and it compiles. But including QAbstractVideoSurface doesn't work!
#include <QAbstractVideoSurface> //file not found
I've tried updating components and installing Qt 6.3.0, but the result is the same.
What module did I miss or maybe it's a bug?
In Qt 6.0.0 and higher versions:
QAbstractVideoSurface has been replaced by the QVideoSink class, and
generic rendering support has been enhanced to cover all pixel formats
supported by Qt Multimedia.
please read Changes to Qt Multimedia.
Related
I have a Qt project previously build using Qt 5.11. In order to support MacOS Mojave'e Dark Mode, I have updated the build to use Qt 5.13.2. This works perfectly, but the kit version is stored locally in the session settings not with the .pro project file.
I wish to enforce a minimum Qt kit version for the build, so that the build will abort if the correct kit version is not selected, ideally in the .pro file rather then the source code. How can I do that?
using versionAtLeast or lessThan you can check the Qt version. For instance:
equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 12) {
message("Cannot use Qt $${QT_VERSION}")
error("Use Qt 5.12 or newer")
}
or better:
!versionAtLeast(QT_VERSION, 5.12.0) {
message("Cannot use Qt $${QT_VERSION}")
error("Use Qt 5.12 or newer")
}
I am a beginner in Qt and wanted to learn about 3D rendering in Qt. The first thing the official document http://doc.qt.io/qt-5/qt3d-index.html stated was to add the following line to its qmake .pro file:
QT += 3dcore 3drender 3dinput 3dlogic 3dextras 3danimation
However, running qmake after adding this line gave me an unknown module error:3danimation. I read this previous posted question Unknown module(s) in QT. The solution stated to use
QT += 3dcore 3drender 3dinput 3dlogic
This solution worked for me but I have also read that 3danimation contains various important classes from the Qt3DAnimation module. My question is that why following the official documentation gave me this error. Did I miss something. This question may sound very nooby, but I would appreciate if someone could explain this to me. Thanks in advance. BTW, I am using Qt creator 4.2.0 (based on Qt 5.7.1).
Because the Qt5 documentation follows the latest release which is Qt 5.10 at the moment and you are using older release (5.7).
If you take a look at archived Qt3D in Qt 5.7 documentation you can see that 3danimation is not mentioned there. According to this blog post the technology preview of the Qt3D Animation module was released first time as part of Qt 5.9.
You should move to a newer release if you want to use Qt3D Animation. I would recommend Qt 5.9 which is LTS (long time support) release. At the moment, Qt 5.9.5 is the newest version.
Hello in order to build static Qt for Windows, I followed the next article.
http://qt-project.org/wiki/How-to-build-a-static-Qt-for-Windows-MinGW
Using Qt vesion – 5.2.0. Operating System- Windows7.
The problem is that it says – no service found for – “org.qt-project.qt.mediaplayer” on building the project.
I searched the net, but no solution was useful. Maybe I’m not using them correctly because of some lack of knowledge of Qt infrastructure, but anyway if someone could give me some instructions of solving of this problem, I would really appreciate that.
I'm using statically Qt 5.2.1 OpenGL MinGW and had same problem (video wasn't playing with same "no service found"). In my case I solved the problem linking the static mediaplayer plugin (dsengine) in project. To do this I had to:
1) add in .pro file:
CONFIG += static
static:{
QTPLUGIN += dsengine
CONFIG += release
LIBS += -ldsengine
}
dsengine plugin is located in %QTDIR%/plugins/mediaservice/libdsengine.a
2) add somewhere in the code (around main.cpp):
#ifdef QT_STATIC
#include <QtCore/QtPlugin>
Q_IMPORT_PLUGIN(DSServicePlugin)
#endif
Qt is not recognizing the Qt/3d i am using. I have QT Creator 4.7, and do not know if the problem is something i should include in my .pro file. I have QT += opengl already. Some of what I am trying to #include are: QGLView, QGLBuilder, and QGLCube.
QGLView, QGLBuilder, QGLCube are introduced in QT 4.8. You need to update your QT library.
I just have installed Qt 4 on windows 7. I am now in a bit of a confusion
How do I get to install OpenGL so that it works with QT? Is there an installer for OpenGL?
Qt docs. say it has support for OpenGL, but when I include QTOpenGL and build, the compiler issues an error of "No such file or directory"
Thanks for the reply in advance!
Are you sure you followed this to the letter? You need to include <QtOpenGL> and set the QT += opengl option in your pro file.
What tool chain are you using? (Visual Studio, Qt Creator/g++) You need to specify somewhere in your project settings that you want to use the QtOpenGL module. This will result in a line in your .pro file similar to this:
QT = core gui opengl
This causes qmake to add the proper include path when invoking the compiler (I believe).
added the line QT += opengl to the .pro file