Help writing an image format plugin
-
Hi
I want to write a plugin based on QImageIOPlugin.
There doesn't seem to be a fully worked example or tutorial, I am trying to follow the old Qt Quarterly article at https://doc.qt.io/archives/qq/qq17-imageio.html the how to at https://doc.qt.io/qt-5/plugins-howto.html and the docs for https://doc.qt.io/qt-5/qimageioplugin.html
QMake reports
Project WARNING: CONFIG-=import_qpa_plugin is deprecated. Use QTPLUGIN.platforms=- instead.
and when I run make the header for QImageIOPlugin is not found.
I would probably like to build as a KDE plugin in the future so any tips about that would also be welcome.
-
Hi,
Out of curiosity, why do you have
CONFIG-=import_qpa_plugin
in your .pro file ?One place you can get inspiration from is the qtimageformats module.
Depending on the plugin you are writing you might even consider contributing it to the module.
-
Which version of Qt are you using ?
-
I'm currently using Qt 5.5 on Mac and Linux.
Last night I put together a new project file based on the JP2 one in the imageformats module. Now I am getting tons of errors of the type "no type named 'u16string' in namespace 'std'" for qstring.h. I'm going to have to do a lot more digging to get this to work.
-
Which version of OS X and Xcode ?
Ensure that you are using the macx-clang mkspecs
-
Which version of OS X and Xcode ?
The latest.
10.11.4 and 7.3.I wouldn't say I use xcode. I use "xcode command line tools".
I'm currently using macx-g++ but I don't remember why - isn't g++ an alias to clang on Mac ? Using clang seems to have fixed the errors above though.
-
Yes it is but the g++ mkspec is tailored for when there was only g++ hence it's linking to libstdc++ and not libc++.
That mkspec is to be considered deprecated and not used anymore.