Michael Nutt
Michael Nutt

Reputation: 178

Is it possible to use Qt's built-in libpng library directly?

I'm saving a QImage to a PNG file and QPNGHandler isn't customizable enough (I need png_set_filter) so I need to write my own PNG handler. If Qt was configured without -system-libpng, is it possible for me to directly access Qt's bundled version?

Right now I'm statically compiling Qt, but that could change.

Upvotes: 2

Views: 1225

Answers (1)

Luca Carlon
Luca Carlon

Reputation: 9986

Yes, I suppose it should be possible. I see the symbols are inside libQtGui.so:

arm-none-linux-gnueabi-nm libQtGui.so.4.7.2 | grep png_create_read_struct
0027b7c0 T png_create_read_struct
0027b3b4 T png_create_read_struct_2

I see it includes all the sources inside libQtGui.so from src/gui/image/qpnghandler.pri unless system-png is specified in configure. I guess you'll have to manually get the headers ad specify in your .pro file cause I don't think Qt is exporting those when installing.

Upvotes: 1

Related Questions