Devices

QFile is really a descendant class of QIODevice ("input/output device"), which is a Qt interface used to abstract entities related to reading and writing of blocks of data. There are two types of devices: sequential and random access devices. QFile belongs to the latter group; it has the concepts of start, end, size, and current position that can be changed by the user with the seek() method. Sequential devices, such as sockets and pipes, represent streams of data—there is no way to rewind the stream or check its size; you can only keep reading the data sequentially—piece by piece, and you can check how far away you currently are from the end of data. We will work with such devices in Chapter 7, Networking.

All I/O devices can be ...

Get Game Programming using Qt 5 Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.