Hello,
I have built my Qt6 snap so far using
build-packages
- pkg-config
- qt6-base-dev
- qt6-tools-dev
- qt6-connectivity-dev
- libqt6charts6-dev
- libqt6opengl6-dev
- libqt6serialport6-dev
- libqt6svg6-dev
stage-packages:
- libqt6core6
- libqt6gui6
- libqt6widgets6
- libqt6charts6
- libqt6serialport6
- libqt6bluetooth6
- libqt6help6
- libqt6sql6-sqlite
- libqt6svg6
- libqt6printsupport6
plugs:
- bluez
- bluetooth-control
Now I want to switch to the KDE Neon 6 extension.
This works, but Bluetooth fails there: no controller is detected when calling “QBluetoothLocalDevice::allDevices()”.
Normally the message “qt.bluetooth.bluez: Bluez 5 detected.” is shown on working variant but this is missing here. So I guess it s BlueZ releated.
Qt docs say “On Linux, Qt Bluetooth uses a separate executable, sdpscanner, to integrate with the official Linux Bluetooth protocol stack (BlueZ).” Maybe it’s missing?
I made a litte test package if somebody wants to try itself.
It contains a simple app
#include <QApplication>
#include <QMessageBox>
#include <QBluetoothLocalDevice>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QList <QBluetoothHostInfo> bhil = QBluetoothLocalDevice::allDevices();
if(bhil.count())
{
QMessageBox::information(NULL, "Snap BT-Test", QString("%1 Bluetooth controller found.").arg(bhil.count()));
}
else
{
QMessageBox::warning(NULL, "Snap BT-Test", "No Bluetooth controller found!");
}
return 0;
}
and the snapcraft.yaml
name: bt-test
version: 1.0
summary: BT-Test
description: Bluetooth Test for KDE-Neon
grade: stable
base: core24
confinement: strict
parts:
bt-test:
plugin: nil
override-build: |
export PATH=/snap/kde-qt6-core24-sdk/current/usr/bin/qt6:$PATH
qmake
make
install -Dt $SNAPCRAFT_PART_INSTALL/bin bt-test
source: bt-test
source-type: local
apps:
bt-test:
command: bin/bt-test
extensions:
- kde-neon-6
plugs:
- bluez
- bluetooth-control
to build the snap.
It simply shows the count of detected Bluetooth controllers and works fine native, as flatpak and snap without kde-neon.
What else is needed in KDE Neon environment to enable Bluetooth for Qt6?
Thanks!