diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bluetooth/doc/qtbluetooth.qdocconf | 11 | ||||
-rw-r--r-- | src/bluetooth/doc/src/bluetooth-cpp.qdoc | 4 | ||||
-rw-r--r-- | src/bluetooth/doc/src/bluetooth-overview.qdoc | 4 | ||||
-rw-r--r-- | src/bluetooth/doc/src/bluetooth-qml.qdoc | 2 | ||||
-rw-r--r-- | src/bluetooth/qbluetooth.h | 24 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothhostinfo.cpp | 2 | ||||
-rw-r--r-- | src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp | 2 | ||||
-rw-r--r-- | src/imports/bluetooth/qdeclarativebluetoothservice.cpp | 83 | ||||
-rw-r--r-- | src/imports/bluetooth/qdeclarativebluetoothsocket.cpp | 19 |
9 files changed, 99 insertions, 52 deletions
diff --git a/src/bluetooth/doc/qtbluetooth.qdocconf b/src/bluetooth/doc/qtbluetooth.qdocconf index 99bf575b..3f748c36 100644 --- a/src/bluetooth/doc/qtbluetooth.qdocconf +++ b/src/bluetooth/doc/qtbluetooth.qdocconf @@ -2,21 +2,22 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtBluetooth description = Qt Bluetooth Reference Documentation -version = 5.0.0 +url = http://qt-project.org/doc/qt-$QT_VER/qtbluetooth +version = $QT_VERSION examplesinstallpath = bluetooth qhp.projects = QtBluetooth qhp.QtBluetooth.file = qtbluetooth.qhp -qhp.QtBluetooth.namespace = org.qt-project.qtbluetooth.500 +qhp.QtBluetooth.namespace = org.qt-project.qtbluetooth.$QT_VERSION_TAG qhp.QtBluetooth.virtualFolder = qtbluetooth qhp.QtBluetooth.indexTitle = Qt Bluetooth qhp.QtBluetooth.indexRoot = -qhp.QtBluetooth.filterAttributes = qtbluetooth 5.0.0 qtrefdoc -qhp.QtBluetooth.customFilters.Qt.name = QtBluetooth 5.0.0 -qhp.QtBluetooth.customFilters.Qt.filterAttributes = qtbluetooth 5.0.0 +qhp.QtBluetooth.filterAttributes = qtbluetooth $QT_VERSION qtrefdoc +qhp.QtBluetooth.customFilters.Qt.name = QtBluetooth $QT_VERSION +qhp.QtBluetooth.customFilters.Qt.filterAttributes = qtbluetooth $QT_VERSION qhp.QtBluetooth.subprojects = overviews classes qml examples qhp.QtBluetooth.subprojects.classes.title = C++ Classes qhp.QtBluetooth.subprojects.classes.indexTitle = Qt Bluetooth C++ Classes diff --git a/src/bluetooth/doc/src/bluetooth-cpp.qdoc b/src/bluetooth/doc/src/bluetooth-cpp.qdoc index 26bbc3e9..ae15b869 100644 --- a/src/bluetooth/doc/src/bluetooth-cpp.qdoc +++ b/src/bluetooth/doc/src/bluetooth-cpp.qdoc @@ -34,8 +34,8 @@ and connecting them. The \l{Qt Bluetooth} C++ API enables an application to scan for devices and - connect and interact with them in a more flexible way than the \l{Qt - Bluetooth QML API}. + connect and interact with them in a more flexible way than the \l {Qt + Bluetooth QML Types}. To use the C++ library in your application, add the following configuration option to your \c .pro file: diff --git a/src/bluetooth/doc/src/bluetooth-overview.qdoc b/src/bluetooth/doc/src/bluetooth-overview.qdoc index d62321f7..941219f8 100644 --- a/src/bluetooth/doc/src/bluetooth-overview.qdoc +++ b/src/bluetooth/doc/src/bluetooth-overview.qdoc @@ -87,12 +87,12 @@ To be able to create SPP connections, you need to register a Server one one device by using QRfcommServer. - \snippet chatserver.cpp Create the server + \snippet btchat/chatserver.cpp Create the server Connect to this server from another device playing the client role by using a QBluetoothSocket. - \snippet chatclient.cpp startClient + \snippet btchat/chatclient.cpp startClient Using such a connection allows to exchange any form of data in both directions. It is perfectly suited for use cases like gaming or syncing the state between two instances of diff --git a/src/bluetooth/doc/src/bluetooth-qml.qdoc b/src/bluetooth/doc/src/bluetooth-qml.qdoc index 19e4fa4e..dd3141d3 100644 --- a/src/bluetooth/doc/src/bluetooth-qml.qdoc +++ b/src/bluetooth/doc/src/bluetooth-qml.qdoc @@ -33,7 +33,7 @@ \ingroup qmlmodules \brief Provides QML types for basic Bluetooth operations on devices -The Qt Bluetooth QML API enables an application to scan for devices and connect and +The Qt Bluetooth QML Types enable an application to scan for devices and connect and interact with them in an easier way than the C++ Classes. However, it is a bit more limited than the C++ API. You can always use the C++ API to create QML plugins with the flexibility you need. diff --git a/src/bluetooth/qbluetooth.h b/src/bluetooth/qbluetooth.h index 3c3c6d31..314de6ee 100644 --- a/src/bluetooth/qbluetooth.h +++ b/src/bluetooth/qbluetooth.h @@ -47,19 +47,21 @@ QT_BEGIN_NAMESPACE_BLUETOOTH +#ifdef Q_QDOC +// workaround for QTBUG-31851 +class FakeClassForQDoc; +#endif namespace QBluetooth { -enum Security { - NoSecurity = 0x00, - Authorization = 0x01, - Authentication = 0x02, - Encryption = 0x04, - Secure = 0x08 -}; - -Q_DECLARE_FLAGS(SecurityFlags, Security) - -Q_DECLARE_OPERATORS_FOR_FLAGS(SecurityFlags) + enum Security { + NoSecurity = 0x00, + Authorization = 0x01, + Authentication = 0x02, + Encryption = 0x04, + Secure = 0x08 + }; + Q_DECLARE_FLAGS(SecurityFlags, Security) + Q_DECLARE_OPERATORS_FOR_FLAGS(SecurityFlags) } QT_END_NAMESPACE_BLUETOOTH diff --git a/src/bluetooth/qbluetoothhostinfo.cpp b/src/bluetooth/qbluetoothhostinfo.cpp index 72fb956a..ea72107e 100644 --- a/src/bluetooth/qbluetoothhostinfo.cpp +++ b/src/bluetooth/qbluetoothhostinfo.cpp @@ -109,7 +109,7 @@ QString QBluetoothHostInfo::name() const } /*! - Sets the name of the host info object. + Sets the \a name of the host info object. */ void QBluetoothHostInfo::setName(const QString &name) { diff --git a/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp b/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp index 260ed6ec..25b9402d 100644 --- a/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp +++ b/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp @@ -124,7 +124,7 @@ void QDeclarativeBluetoothDiscoveryModel::componentComplete() } /*! - \qmlproperty bool BluetoothSocket::discovery + \qmlproperty bool BluetoothDiscoveryModel::discovery This property starts or stops discovery. diff --git a/src/imports/bluetooth/qdeclarativebluetoothservice.cpp b/src/imports/bluetooth/qdeclarativebluetoothservice.cpp index 3f2a4cf5..18152662 100644 --- a/src/imports/bluetooth/qdeclarativebluetoothservice.cpp +++ b/src/imports/bluetooth/qdeclarativebluetoothservice.cpp @@ -57,8 +57,8 @@ \inqmlmodule QtBluetooth 5.0 \brief Provides information about a particular Bluetooth service. - \sa QBluetoothAddress - \sa QBluetoothSocket + \sa QBluetoothAddress + \sa QBluetoothSocket The BluetoothService type was introduced in \b{QtBluetooth 5.0}. @@ -66,6 +66,21 @@ for a BluetoothSocket to connect to. */ +/*! + \qmlsignal BluetoothService::detailsChanged() + + This handler is called when any of the following properties changes: + + \list + \li deviceAddress + \li deviceName + \li serviceDescription + \li serviceName + \li servicePort + \li serviceProtocol + \li serviceUuid + \endlist +*/ class QDeclarativeBluetoothServicePrivate { @@ -126,9 +141,10 @@ void QDeclarativeBluetoothService::componentComplete() /*! - \qmlproperty string BluetoothService::deviceName + \qmlproperty string BluetoothService::deviceName - This property holds the name of the remote device. + This property holds the name of the remote device. Changing this property emits the + detailsChanged signal. */ QString QDeclarativeBluetoothService::deviceName() const @@ -140,10 +156,12 @@ QString QDeclarativeBluetoothService::deviceName() const } /*! - \qmlproperty string BluetoothService::deviceAddress + \qmlproperty string BluetoothService::deviceAddress + + This property holds the remote device's MAC address. It must be a valid address to + connect to a remote device using a Bluetooth socket. Changing this property emits the + detailsChanged signal. - This property holds the remote device's MAC address. Must be a valid address to - connect to a remote device using a Bluetooth socket. */ QString QDeclarativeBluetoothService::deviceAddress() const @@ -165,9 +183,10 @@ void QDeclarativeBluetoothService::setDeviceAddress(QString address) } /*! - \qmlproperty string BluetoothService::serviceName + \qmlproperty string BluetoothService::serviceName - This property holds the name of the remote service if available. + This property holds the name of the remote service if available. Changing this property emits the + detailsChanged signal. */ QString QDeclarativeBluetoothService::serviceName() const @@ -188,9 +207,10 @@ void QDeclarativeBluetoothService::setServiceName(QString name) /*! - \qmlproperty string BluetoothService::serviceDescription + \qmlproperty string BluetoothService::serviceDescription - This property holds the description provided by the remote service. + This property holds the description provided by the remote service. Changing this property emits the + detailsChanged signal. */ QString QDeclarativeBluetoothService::serviceDescription() const { @@ -210,10 +230,12 @@ void QDeclarativeBluetoothService::setServiceDescription(QString description) } /*! - \qmlproperty string BluetoothService::serviceProtocol + \qmlproperty string BluetoothService::serviceProtocol + + This property holds the protocol used for the service. Can be the string, + "l2cap" or "rfcomm". Changing this property emits the + detailsChanged signal. - This property holds the protocol used for the service. Can be the string, - "l2cap" or "rfcomm" */ QString QDeclarativeBluetoothService::serviceProtocol() const @@ -242,13 +264,15 @@ void QDeclarativeBluetoothService::setServiceProtocol(QString protocol) } /*! - \qmlproperty string BluetoothService::serviceUuid + \qmlproperty string BluetoothService::serviceUuid - This property holds the UUID of the remote service. Service UUID or port, - and the address must be set to connect to a remote service. If UUID and - port are set, the port is used. The UUID takes longer to connect as - service discovery must be initiated to discover the port value. - */ + This property holds the UUID of the remote service. Service UUID or port, + and the address must be set to connect to a remote service. If UUID and + port are set, the port is used. The UUID takes longer to connect as + service discovery must be initiated to discover the port value. Changing + this property emits the detailsChanged signal. + +*/ QString QDeclarativeBluetoothService::serviceUuid() const { @@ -272,12 +296,13 @@ void QDeclarativeBluetoothService::setServiceUuid(QString uuid) } /*! - \qmlproperty int BluetoothService::servicePort + \qmlproperty int BluetoothService::servicePort - This property holds the port value for the remote service. Bluetooth does not - use well defined port values, so port values should not be stored and used - later. Connecting using UUID is much more consistent. - */ + This property holds the port value for the remote service. Bluetooth does not + use well defined port values, so port values should not be stored and used + later. Connecting using UUID is much more consistent. Changing this property emits the + detailsChanged signal. +*/ qint32 QDeclarativeBluetoothService::servicePort() const { if (d->m_port > 0) @@ -305,11 +330,11 @@ void QDeclarativeBluetoothService::setServicePort(qint32 port) } /*! - \qmlproperty string BluetoothService::registered + \qmlproperty string BluetoothService::registered - This property holds the registration/publication status of the service. If true, the service - is published during service discovery. Not implemented in 1.2. - */ + This property holds the registration/publication status of the service. If true, the service + is published during service discovery. +*/ bool QDeclarativeBluetoothService::isRegistered() const { diff --git a/src/imports/bluetooth/qdeclarativebluetoothsocket.cpp b/src/imports/bluetooth/qdeclarativebluetoothsocket.cpp index 78a837f0..15b733aa 100644 --- a/src/imports/bluetooth/qdeclarativebluetoothsocket.cpp +++ b/src/imports/bluetooth/qdeclarativebluetoothsocket.cpp @@ -308,6 +308,25 @@ void QDeclarativeBluetoothSocket::socket_state(QBluetoothSocket::SocketState sta emit stateChanged(); } +/*! + \qmlproperty string BluetoothSocket::state + + This property holds the current state of the socket. The property can be one + of the following strings: + + \list + \li \c{No Service Set} + \li \c{Unconnected} + \li \c{Service Lookup} + \li \c{Connecting} + \li \c{Connected} + \li \c{Closing} + \li \c{Listening} + \li \c{Bound} + \endlist + + The states are derived from QBluetoothSocket::SocketState. This property is read-only. +*/ QString QDeclarativeBluetoothSocket::state() { return d->m_state; |