Problem subclassing QIODevice
-
wrote on 9 Aug 2022, 19:27 last edited by
I want to subclass QIODevice, so that I can implement a class which operates in Sequential mode (not random access).
However, it appears that the Sequential property offers a getter (isSequential) but no setter. How can my subclass set Sequential mode?
-
Hi,
isSequential is virtual. You overload that method.
There's no reason for a setter as devices usually can't change their type like that on the fly.
-
Hi,
isSequential is virtual. You overload that method.
There's no reason for a setter as devices usually can't change their type like that on the fly.
wrote on 9 Aug 2022, 20:15 last edited by@SGaist I saw some (old) source from IODevice.cpp that showed isSequential checking bits/flags of mode. But another source showing it just returning false.
So if I simply override the function to return true, there is nothing further I need to do/set?
-
You need to implement it to work sequentially and that should be it.
1/4