Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 8

Qt-interest Archive, March 2002
How can one overwrite ImageIO handlers in Qt3 ?


Message 1 in thread

Hi,
in Qt2, it was possible to overwrite an existing (built-in) ImageIO handler. 
E.g. for the PNM reader/writer, one could simply implement a read/write 
function and call

QImageIO::defineIOHandler("PPM","^P3","t",
	                            my_read_pbm_image,my_write_pbm_image );
and so on...

If I try the same using Qt3, nothing works; I'm no longer able to read/write 
PNM images and my own functions are never called.
Does anyone have an explanation for this ? How can I implement my own ImageIO 
handler as a replacement for a built-in one (without using plugins, if 
possible) ?

Thanks
Michael


Message 2 in thread

mh, Mittwoch, 20. März 2002 21:04:
> Hi,
> in Qt2, it was possible to overwrite an existing (built-in) ImageIO
> handler. E.g. for the PNM reader/writer, one could simply implement a
> read/write function and call
>
> QImageIO::defineIOHandler("PPM","^P3","t",
> 	                            my_read_pbm_image,my_write_pbm_image );
> and so on...

Ok, I just saw, that the documentation in Qt3 has been extended:

"If two handlers support the same operation, Qt chooses one arbitrarily."
                                                                              
This, unfortunately, is a completely useless design :-(

Michael