Qt 5.5 Examples, missing QOpenGLWidget - c++

I'm trying to investigate using off-screen rendering, I would like to explore the examples that are installed with Qt5.5, but so far every attempt to open one of the existing projects and build results in:
QOpenGLWidget: No such file or directory
#include <QOpenGLWidget>
I have not modified the examples in any way, I'm running on Ubuntu 14.04.

The installation of Qt5.5 on Ubuntu 14.04 was not completed correctly, as a result I have two installations 5.2 and 5.5, however thank you to "peppe" I ran Qt Creator for 5.5 and after cleaning up the project by removing the "pro.user" file I was able to progress.

Related

How to use OpenCV on Qt 6 on MacOS Monterey

I am trying to create an application on Qt 6.4 for facial recognition. For this, I want to use OpenCV4. I am using a widget-based application with qmake on QtCreator.
How am I supposed to use OpenCV in this application? I have installed OpenCV using brew on the terminal. What exactly am I supposed to do now?
I have a Mac M2 chip running MacOS 12.5. All the tutorials on the internet are on the outdated versions of Qt and OpenCV which are not working on the current version.

Qt cannot load cocoa plugin

I'm trying to compile and run an application on a MacBook using Qt Creator. There are no issues compiling the project, but when I try and run it, it seems to be unable to load a plugin.
Could not load the Qt platform plugin "cocoa" in "" even though it was found.
The application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
This error occurs both when trying to run the application from Qt Creator or via Finder. It seems to only happen when I use the CMake build system (no issues when using QMake), but my existing project that I need to deploy on MacOS uses CMake.
My steps to reproduce are:
Install a completely clean MacOS (no user data)
Install Xcode 11
Install CMake 3.15
Install Qt 5.13.1 MacOS package
Open QtCreator->New Project->Qt Quick Application - Scroll
Set build system to CMake (important)
Compile and notice error
I am using:
Qt 5.13.1
macOS Catalina 10.15
Apple Clang 11
I recognize that for final user deployment I will need to use the macqtdeploy tool to copy the Qt libraries to the executable folder, but I should be able to run my app from QtCreator without doing this? Especially as it works fine when using QMake.
So it ended up being some kind of name resolution thing where Qt Creator couldn't decide whether to use the debug or release versions of the framework. Supplying DYLD_IMAGE_SUFFIX=_debug fixed this (add this to the environment section under Kits).

QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled

I have a unix binary file built with QT and OpenGL which I'm trying to execute on linux-64. It is a simple visual program that shows 2d and 3d graphics.
I have installed all necessary dependencies such as QT and openGL libraries.
However, I have stuck with the following error trying to execute the binary
QXcbIntegration: Cannot create platform OpenGL context, neither GLX
nor EGL are enabled
However, the binary eventually runs but with some missing features such as 3D graphics.
my setup includes: virtual linux-64 using virtualBox, Vagrant, x-11 forwarding, and a Mac machine.
Eventually I realised that OpenGL 3.3 wouldn't work easily on virtual machines .. yet. I had to boot from ubuntu usb and work from there by installing latest mesa 3d package.
This shows a similar issue and the developer in the comment said our 3D support is not very clean in Linux guests, hence the warnings. You can give a try to VMware.
After some time trying to get some opengl working on a particular locked down linux box, I ended up going back to Qt Creator 2.5.2 .
http://download.qt.io/archive/qtcreator/2.5/
http://download.qt.io/archive/qtcreator/2.5/qt-creator-linux-x86_64-opensource-2.5.2.bin
After getting it on the linux box...
chmod u+x *.bin
./qt-creator-linux-x86_64-opensource-2.5.2.bin
And after a short installer, Qt Creator is working!
Basically QtQuick is a requirement in any Qt Creator built after 2.5 (aka Qt 5.x) and QtQuick NEEDS opengl libraries and support.
Hope that helps.
I see this problem when executing Qt App, I was executing in dash prompt. (Ubuntu 16.04 has dash by default). I changed to bash prompt and rebuilt my QT App. This error is gone.
To configure bash I used below command.
sudo dpkg-reconfigure dash

Expected type-specifier before 'QSslSocket' in QT Application

I am still fairly new to Qt, but I'd like to write a program that allows a user to send a small message via email.
When I go to build my project I get errors like
expected type-specifier before 'QSslSocket' and 'QSslSocket' was not declared in this scope. I get these both when I try to compile my code and when I try to compile the demos from the git, so I don't think it is in my code.
Looking into this issue I have seen that most solutions involve making sure that openssl is installed on the machine and that Qt was built with the openssl flag set in the configuration. I have ensured that I have openssl and libssl-dev installed and I just rebuilt my version of Qt using the openssl flag. Still no luck.
In my project I have QT += core network added in my .pro file. I have #include <QtNetwork/QsslSocket> in my *.h file that requires it.
As for my system, I am working on Ubuntu 14.04 LTS. I have Qt 4.8.6 installed (again with -openssl included in the config file). Openssl and libssl-dev are both at 1.0.1f-1ubuntu2.11.
If you have any ideas they would be greatly appreciated!
Ultimately, it did come down to my configuration. I completely removed all versions of Qt4 off my computersudo make uninstall (since I installed from a tarball instead of from the repository), I cleaned my configuration file using make confclean, I rebuilt the configuration using ./configure -openssl, then make and finally sudo make install. I think the issue before was that I had not cleaned my config file first. I had a version installed for embedded Linux and it is possible that I was applying the -openssl flag to that build since I had installed that later. For the record both #include <QtNetwork/QSslSocket> and #include <QSslSocket> work, at least in my version of Qt (4.8.6).

building Qt 5.2.0 with mingw 4.8.1

this is the first time i am trying to build Qt from source. so i need help from a expert. previously i used qt by installing it using their offline installers. but open cv library cannot be used with it. so i need to build qu frim source. im using win 7 64 bit OS.
i installed active perl, active python, ruby and git. the niwest versions and and added them to path. my path variable llist looks like follows.
then my mingw gcc version looks like follows.
then i build and installed ICU librarys as discribed in http://qt-project.org/wiki/Compiling-ICU-with-MinGW
then opened a cmd as adminisrtator and cd into qt extracted folder and configured as
configure -prefix %CD%\qtbase -opensource -nomake tests -opengl desktop
after configure complets then mingw32-make
it tooks about 1 hour in my i5 2.6ghz processor and ended with following errors.
what may be dhe mistake. am i doing enything wrong. has enybody successfully compiled Qt 5.2 with mingw 4.8.1 on a win 7 64bit system. if qt build successfully will it end with a messsage that qt was build successfully or somthing similar.
i know qt creator can be installed seperatly. but qt designer, will it also be built with qt librarys. can some expert help me with this issue. im trying this for several days.
eny helpwill be highly appricated... thank you....
Try to run make again. It was the same for me.
After two tries it compiled successfully.
I don't remember if it was the same error, but it always fail first time for me and then after running make again it compiles.
Previous versions didn't have this problem.
I have now problem compiling my code, because gcc crashes, but that's different problem.