Mariam
Mariam

Reputation: 342

Alternatives to QtBluetooth on Windows?

I have two PCs, not connected with a cable and not in a network that need to communicate with each other. I'm doing two Qt apps and wanted to make the communication via Bluetooth. However, I found out that Qt does not support Bluetooth for Windows (Does Qt support the windows bluetooth API?). (It produces qt.bluetooth: Dummy backend running. Qt Bluetooth module is non-functional.)

So what other alternatives do I have to bluetooth to establish this connection? Or how can I make QtBluetooth work? I am open for new suggestions.

The data to be transferred is a QByteArray.

I am running Windows 10 Pro and Qt 5.11.1.

Edit: According to the new answer on Does Qt support the windows bluetooth API?, QtBluetooth can indeed work on Windows. I have two windows devices with exactly the same windows and Qt version. On one of them the Bluetooth chat example works perfectly, on the other one it still doesn't and I get the error message that Qt Bluetooth module is non-functional. Can someone tell me when and why this error appears?

I have also seen this thread but it doesn't help me, because it's linux-specific.

Upvotes: 0

Views: 2408

Answers (3)

artaxerx
artaxerx

Reputation: 313

Now it seems that QT supports Bluetooth on Windows since version 5.14

Upvotes: 0

Mariam
Mariam

Reputation: 342

This thread on the QtForum delivered the answer. It works when you switch to the MSVC compiler instead of the standard MinGW!

This is how you do it:

After installing Microsoft Visual Studio and having the MSVC package in Qt (see mentioned thread), you need to set the compiler for c++ by going to Tools>Options>Kits. There you choose the MSVC compiler and in "Compiler: C++:" you choose Microsoft Visual C++ Compiler.

I hope this helps someone else.

Upvotes: 1

You "exactly the same windows" most likely aren't. What is the exact version? The most current Windows 10 version is 1803, and the minimum needed for fully functional Qt Bluetooth support is 1607.

Upvotes: 0

Related Questions