2

its my first Question here :)

Im trying to develop a C++ Application which i can use to control a Lego NXT remotely from my Desktop PC over Bluetooth. To achieve this i want to use the QBluetooth Library(and other QtGui Libs aswell).

My Problem is the QBluetooth Headers are not there. When i look into the /usr/include/qt5 directory i get this:

paul@Paul-RoboAG:/usr/include/qt5$ ls
QtConcurrent  QtNetwork           QtPrintSupport    QtQuickTest  QtXml
QtCore        QtOpenGL            QtQml             QtSql
QtDBus        QtOpenGLExtensions  QtQuick           QtTest
QtGui         QtPlatformSupport   QtQuickParticles  QtWidgets
paul@Paul-RoboAG:/usr/include/qt5$ find | grep Blue
paul@Paul-RoboAG:/usr/include/qt5$ find | grep blue
paul@Paul-RoboAG:/usr/include/qt5$ 

I dont find the headers, and when i want to include them in my App(in QtCreator) the AutoCompletion wont find it. I Already added "bluetooth" to "QT" in my project file.

#-------------------------------------------------
#
# Project created by QtCreator 2014-05-16T21:06:59
#
#-------------------------------------------------

QT       += core gui
QT       += bluetooth

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = NXT-Control
TEMPLATE = app


SOURCES += main.cpp\
        nxtcontroller.cpp

HEADERS  += nxtcontroller.h

Can you help me with my problem?

Mureinik
  • 297,002
  • 52
  • 306
  • 350

1 Answers1

2

This works for me:

1) wget http://download.qt-project.org/development_releases/qt/5.3/5.3.0-rc/submodules/qtconnectivity-opensource-src-5.3.0-RC.tar.xz

2) tar xvpf qtconnectivity-opensource-src-5.3.0-RC.tar.xz

3) cd qtconnectivity-opensource-src-5.3.0-RC

4) qmake -r

5) make

6) sudo make install

Then, I see this:

ls /usr/include/qt/QtBluetooth/
5.3.0/                             qbluetoothglobal.h                 qbluetoothserver.h                 QBluetoothTransferManager          qbluetoothuuid.h
QBluetoothAddress                  qbluetooth.h                       QBluetoothServiceDiscoveryAgent    qbluetoothtransfermanager.h        QtBluetooth
qbluetoothaddress.h                QBluetoothHostInfo                 qbluetoothservicediscoveryagent.h  QBluetoothTransferReply            QtBluetoothDepends
QBluetoothDeviceDiscoveryAgent     qbluetoothhostinfo.h               QBluetoothServiceInfo              qbluetoothtransferreply.h          QtBluetoothVersion
qbluetoothdevicediscoveryagent.h   QBluetoothLocalDevice              qbluetoothserviceinfo.h            QBluetoothTransferRequest          qtbluetoothversion.h
QBluetoothDeviceInfo               qbluetoothlocaldevice.h            QBluetoothSocket                   qbluetoothtransferrequest.h        
qbluetoothdeviceinfo.h             QBluetoothServer                   qbluetoothsocket.h                 QBluetoothUuid   

As for find | grep blue -> you may wish to take a look at the -(i)name option.

QT += core gui is needless because the core and gui modules are added by default. I know that QtCreator adds it by default, but it is wrong. It is good to be aware of it.

László Papp
  • 51,870
  • 39
  • 111
  • 135
  • It works, QT Creator provides AutoCompletion for it aswell, but is there package in the official repos? – CaptainRuhrpott May 16 '14 at 21:40
  • @CaptainRuhrpott: I gave the official repository of the Qt Project. You mean the official repository of your distribution? Then the answer is no. – László Papp May 16 '14 at 21:46
  • I mean is there something i can install over apt? I installed the standard qt packages with qt5-default, is there a way to do the same with such addons – CaptainRuhrpott May 18 '14 at 18:55