Qt Not Recognizing Qt/3D Libraries - qt

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.

Related

QAbstractVideoSurface file not found

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.

Specify minimum Qt version for QtCreator / QMake build

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")
}

Qt Creator 3 for windows - KDiff build error

I'm getting the following error message when building a project (KDiff3) in Qt Creator for Windows, any help would be appreciated.
C:\kdiff3\src-QT4\kreplacements\kreplacements.h:27:
error: QMainWindow: No such file or directory
#include < QMainWindow>
When updating a QT project from QT4 to QT5 if you see the above error, you will need to edit your .pro file to include:
QT += widgets
Transition from Qt 4.x to Qt5

Qt Creator with Cmake

I followed these instructions here : Qt with CMake
so now I can build my project but the problem is, I can't see the project's sources and headers. I have just a CMakeLists.txt on the left and that's it. I don't understand how can I fix this. On Visual Studio, when I used CMake, all sources and headers of my project were appeared.
Thanks you.
Qt Creator shows only files which are listed in your CMakeLists.txt as source files. Add them there and they will show up in the UI.
cmake_minimum_required(VERSION 2.8)
project(MyProject)
add_executable(my_exe main.cpp)
Now main.cpp will be visible in the "Projects" pane in Qt Creator.

Installing OpenGL for Qt

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

Resources