Can't access QBluetoothDeviceInfo and QBluetoothDeviceDiscoveryAgent in qt 5.15
-
I'm trying to reproduce a BLE code to receive chunks but can't seem to access the QBluetooth libraries in QT. Any leads please?
-
@bludger said in Can't access QBluetoothDeviceInfo and QBluetoothDeviceDiscoveryAgent in qt 5.15:
QT += bluetooth
Thank you, it worked! but I have this specific error, attached the snip below. Could you please help?
-
Please show me your include statement. It must be:
#include <QBluetoothDeviceDiscoveryAgent>
@bludger Hi , thanks again. it's like below.
-
Alright, that seems to be fine. Some things you can do:
- Clean out your build directory (remove it from disk) and rebuild your project. This makes sure all makefiles will be regenerated (by qmake) so they're up to date and all include directories are being updated properly
- Check if the file does exists on your harddrive. It must be located in the include folder of Qt
[QT_BASE]/include/QtBluetooth
- Check if your Qt version in the current kit is >= 5.2
- If you put the QBluetoothDeviceInfo include before QBluetoothDeviceDiscoveryAgent, do you still get the same error on the QBluetoothDeviceDiscoveryAgent include?
-
Alright, that seems to be fine. Some things you can do:
- Clean out your build directory (remove it from disk) and rebuild your project. This makes sure all makefiles will be regenerated (by qmake) so they're up to date and all include directories are being updated properly
- Check if the file does exists on your harddrive. It must be located in the include folder of Qt
[QT_BASE]/include/QtBluetooth
- Check if your Qt version in the current kit is >= 5.2
- If you put the QBluetoothDeviceInfo include before QBluetoothDeviceDiscoveryAgent, do you still get the same error on the QBluetoothDeviceDiscoveryAgent include?
@bludger Thank you very much but strangely when I reorder, the error is with QBluetoothDeviceInfo
84bd1866-fc8d-4ae0-a0ad-599e241e8c00-image.png -
@bludger Thank you very much but strangely when I reorder, the error is with QBluetoothDeviceInfo
84bd1866-fc8d-4ae0-a0ad-599e241e8c00-image.png@Raviteja0101 Did you check step 2 in my previous post?
-
I did check and it's there. Also my qt version is Qt 5.15.2 (MSVC 2019, 64 bit)
-
I did clean and build and it worked :) Thank you so much! I was wondering if you could help with one last issue. I'm getting this error in plot.cpp but I've used ui -> plot in mainwindow.cpp where it works but gives me a declaration error in plot.cpp
-
I did clean and build and it worked :) Thank you so much! I was wondering if you could help with one last issue. I'm getting this error in plot.cpp but I've used ui -> plot in mainwindow.cpp where it works but gives me a declaration error in plot.cpp
@Raviteja0101 The error you're getting is pretty clear. The plot class doesn't have a variable named ui. I'm not familiar with the code in plot class, but probably by removing
ui->plot->
it might work.