[Interest] QBluetoothSocket not derived from QAbstractSocket?

Thiago Macieira thiago.macieira at intel.com
Sun May 6 18:17:28 CEST 2018


On domingo, 6 de maio de 2018 05:24:07 PDT Jason H wrote:
> I was surprised to learn that QBluetoothSocket is not derived from
> QAbstractSocket? This caused meet to write nore code than I feel I should
> have. QBluetoothSocket does derive from QIODevice at least so reading and
> writing is not affected. It seemed that because Bluetooth is a "service"
> that the connect to host and disconnect from host functions disqualify it
> from being an abstract socket? That's not very abstract... It seems that
> QAbstractSocket should handle multiple destination types, maybe with a
> connectTo(QAbstractNetworkDestination) so that the only code needed to be
> different for Bluetooth is the code to populate the QBluetoothInfo
> information.

QAbstractSocket is not a very good class. It's actually a full TCP and UDP 
socket implementation. QUdpSocket provides a few datagram-specific functions. 
QTcpSocket is a very, very thin wrapper.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center






More information about the Interest mailing list