Не удается найти заголовок / наклон QtBluetooth, включить его в QtCreator

это мой первый вопрос здесь 🙂

Я пытаюсь разработать приложение на C ++, которое я могу использовать для удаленного управления Lego NXT с настольного ПК через Bluetooth. Чтобы достичь этого, я хочу использовать библиотеку QBluetooth (и другие библиотеки QtGui, а также).

Моя проблема в том, что заголовков QBluetooth нет. Когда я смотрю в каталог / usr / include / qt5, я получаю это:

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$

Я не могу найти заголовки, и когда я хочу включить их в свое приложение (в QtCreator), автозаполнение не найдет его. Я уже добавил «bluetooth» к «QT» в моем файле проекта.

#-------------------------------------------------
#
# 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 = appSOURCES += main.cpp\
nxtcontroller.cpp

HEADERS  += nxtcontroller.h

Можете ли вы помочь мне с моей проблемой?

2

Решение

Это работает для меня:

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) сделать

6) sudo сделать установку

Затем я вижу это:

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

Что касается find | grep blue -> Вы можете взглянуть на -(i)name вариант.

QT += core gui Это не нужно, потому что модули ядра и графического интерфейса добавляются по умолчанию. Я знаю, что QtCreator добавляет его по умолчанию, но это неправильно. Приятно осознавать это.

1

Другие решения


По вопросам рекламы [email protected]