On Friday 29 May 2015 16:27:59 Denis Shienkov wrote:
> I don't know as how will look the CanDevice (derived from QIODevice),
> because QIODevice::read/write methods has not sense. Because, what is
> happens in case I want to write half (or part) of CAN message?
>
> IMHO, this is non-trivial issue to try to unify all interfaces to
> QIODevice.. :)
QCanBusMessage msg = ...;
QIODevice *bus = ...;
{
QDataStream s(bus);
s << msg;
}
To write only part of a message (why would you ever want do that?), use
QBuffer instead of *bus, then get only the first N bytes.
--
Marc Mutz <[email protected]> | Senior Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
Tel: +49-30-521325470
KDAB - The Qt Experts
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development