QtSerialPort QSerialPort no such file or directory - c++

I use this tutorial : http://doc-snapshot.qt-project.org/qt5-stable/qtserialport/blockingmaster.html
But when I want to run it Qt Creator generates the following error:
error: Unknown module(s) in QT: serialport
When I hold mouse on #include <QtSerialPort/QSerialPort> it says:
include no such file or directory
I use Qt 5.0.1 any idea?

Try including #include <QtSerialPort/QSerialPort> instead of
#include <QSerialPort>, that worked for me

QtSerialPort module is not part of Qt 5.0. It was added to the upcoming release Qt 5.1.
You are looking at the documentation snapshot for the upcoming release Qt 5.1. See http://doc-snapshot.qt-project.org/qt5-stable/qtdoc/index.html.
The documentation for Qt 5.0 is here: http://qt-project.org/doc/qt-5.0/qtdoc/index.html.
If you still want to try QtSerialPort, the RC1 of Qt 5.1 was just released. You can download it here: http://download.qt-project.org/development_releases/qt/5.1/5.1.0-rc1/

try including
#include <QtSerialPort/QSerialPort>
also update your project.pro file, add this flag
QT += serialport
after that clean , qmake , rebuild the project

Related

Unknown module(s) in QT: webenginewidgets

Hi. I want to connect QtWebEngineWidgets. To do this, you need to write(https://doc.qt.io/qt-5/qtwebenginewidgets-module.html) in .cpp file
#include <QtWebEngineWidgets>
and
QT += webenginewidgets
inside .pro file.
The problem is that when writing to a .pro file, I get the error - Unknown module(s) in QT: webenginewidgets
Everywhere I read, it is only written that you need to connect the module in the .pro file, but it doesn’t work for me. Am I doing everything right?
• Qt Creator version - 5.0.0 Community
• Qt version - 6.1.3
• C++ compiler version - MSVC2019 64bit 17.032112.339(amd64)
UPD:
I want to add that this module is not in the installer.
Installer exaple1, Installer example2
It turned out that it was necessary to install a newer version of Qt. For example, since version 6.2.3.0 and newer, the installer contains the "WebView" item. I'm installing it now and I'll see if it helps. Thank you.
Possibly the needed files aren't installed. Try adding this package containing the development files:
sudo apt-get install qtwebengine5-dev

'QtSerialPort' file not found on Qt 5.12.0 on macOS 10.13.6 clang 7.0

I'm trying to add the QtSerialPort module, and the QSerialPort file isn't found.
I followed the command line steps on https://wiki.qt.io/Qt_Serial_Port but it still says that the QtSerialPort file is not found. I have both directories qtserialport and qtserialport-build. I couldn't find the branch for git checkout qt5.x.y so I did git checkout v5.12.0.
When I go to /Users/rmec/Qt/5.10.0/ios/include I don't see QSerialPort or QtSerialPort
When I hover over #include it says "QSerialPort: No such file or directory
/Users/rmec/Qt/5.10.0/ios/include
QSP does not supported for iOS!
BTW: I don't understand why you need to build the QSP from sources, because it already is shipped with the Qt installer (for Mac OSX only, not for iOS).

QPageSize: No such file or directory in qt c++

I am facing a problem with Qt. I am using Qt 5.5.1 with Qt Creator 3.5.1 on Ubuntu 16.04 32bit. I have a problem since I used a new class which is added after Qt 5.3. I got an error "No such file or directory". For example if I put
#include <QPageSize>
it gives me an error QPageSize: No Such file or directory. I used QT += gui & QT += widgets in my project file. Still I got this error. I don't understand how can I use these new classes in my program.

Moving from Qt 4.x (Ubuntu Linux) to Qt 5.1 (Windows 7)

I made a program by using Qt Creator in Qt 4.x on an Ubuntu Linux platform in the last year. Now I don't use linux, instead I use Windows 7. I once again need my program which I made last year. I downloaded and installed Qt Creator onto Windows 7 platform. It came with Qt 5.1. I try to rebuilt it. I got below messages. What should I do?
C1083: Cannot open include file: 'QtGui/QApplication': No such file or directory
C1083: Cannot open include file: 'QDialog': No such file or directory
Thanks
In Qt5 QApplication is no longer part of QtGui module, it's now in QtWidgets. In your #include directive use <QtWidgets/QApplication>, the same applies to QDialog.
Use this in your .pro file.
QT += ...
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
The Qt modules have been rearranged somewhat in Qt5. Also this will teach for leaving Linux!
There's a good guide on what has changed from QT 4.x to 5.x http://qt-project.org/wiki/Transition_from_Qt_4.x_to_Qt5

Unknown module(s) in QT: webkit

Added QT += network webkit and I tried just QT += webkit to the .pro solution file and ran qmake from inside the QtCreator and got this error:
error: Unknown module(s) in QT: webkit
I really need to make use of these includes:
#include <QWebView>
#include <QUrl>
Any ideas?
If you say you installed the beta version I suppose you installed Qt version 5. In that case webkit module does not exist anymore. You need webkitwidgets:
QT += webkitwidgets
That will add the module needed to use QWebView. QUrl is in the core module, so you don't need the network module.