*** zbenjamin_ is now known as zbenjamin | 02:30 | |
*** frinring_ is now known as frinring | 06:27 | |
attah | Dear Qt wizards... let's say i have an QProcess, and by virtue of being a QIODevice i want to pass it to QNetworkAccessManager::post(), but i need to prepend some data... is there some good way to do that? | 11:14 |
---|---|---|
attah | I could probably do it in the program running in the QProcess, but that feels unnecessarily fragile | 11:15 |
Nico[m] | Maybe you could add a proxy IODevice, that first returns the prepended data and then reads from the other IODevice? | 11:18 |
attah | Yeah, that's what i was looking for... but that would involve writing a read loop that is forwarding the data? | 11:19 |
attah | That sounds inefficient with the volumes i want to process | 11:20 |
attah | Or wait... maybe i don't have to | 11:20 |
attah | i guess just calling the second stream's read function would do | 11:21 |
Nico[m] | Couldn't you just create one IODevice per process? Or do you want to prepend the output from the same process multiple times? | 11:22 |
attah | Not sure i understand... i have one QByteArray, and will add a QProcess, the output data of which i want to append to the array, and pass to a http request as one contiguous piece of data | 11:23 |
attah | they can both be treated as single use if that helps | 11:24 |
Nico[m] | Then just implement your own IODevice, that on read first reads from the Array and when that is empty, reads from the process | 11:25 |
Nico[m] | I don't think you need a loop there | 11:25 |
attah | hopefully not, i'll try | 11:25 |
attah | just realized, i can test without the process, and just a file... should have the same effect and less other issues | 11:26 |
Nico[m] | Yep | 11:26 |
*** JohanSmits[m] is now known as johansmitsnl | 11:37 | |
attah | It's official, c++ and me don't mix... I can't instantiate the subclass because certain functions are protected, and i can't forward them to the other IODevice, because they are protected | 12:45 |
Nico[m] | The constructor is protected? | 13:22 |
attah | Nico[m]: Sorry, went out for a bit... no, i don't think so, but other functions that i need to implement, are still not public on the other derived classes | 14:47 |
Nico[m] | Hm, which functions? If they are not public on the other derived classes, are you sure you need to implement them? | 14:49 |
attah | readData for example | 14:50 |
attah | well, if they are are virtual in my derived class, i cannot make an instance | 14:50 |
attah | pure virtual | 14:50 |
Nico[m] | Couldn't you inplement readData in terms of read from Process and Array? | 14:52 |
attah | yes, i too just realized read is very similar... let's see if it flies | 14:52 |
attah | in other news... when i was out i printed a pre-encoded file to a AirPrint-only printer | 14:55 |
attah | not even Android do that afaik | 14:56 |
Nico[m] | Woah, nice! | 14:56 |
attah | Yeah... i have to give up for the time being, it just hangs when i pass it my class, as if it is waiting for something | 17:45 |
*** flipper-maniac_ is now known as flipper-maniac | 20:08 |
Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!