QIODevice keeps a track of the number of bytes read (i.e. the pos()) and allows you to skip about with seek(). If your subclass implements a seek() override that does something special, or some other function that affects the current position, it should call QIODevice::seek() so the base class is updated properly. That is:
bool MyIODevice::seek ( qint64 pos ) {
// Do your sub-class magic with pos here
// e.g. if you need to issue commands to hardware to rewind to the corresponding position
}
bool MyIODevice::seek ( qint64 pos ) {
QIODevice::seek(pos);
// Do your sub-class magic with pos here
// e.g. if you need to issue commands to hardware to rewind to the corresponding position
}
To copy to clipboard, switch view to plain text mode
If you do not override the base class seek() then you don't need to do anything special.
Bookmarks