Image Plugin Strangeness

  • I've been beating my head against the wall now for two weeks on this; time to ask for help.

    I'm trying to create a simple image plugin for a custom file type. I've read everything on the forums, and Google'd extensively, but QT simply won't recognize my plugin. It finds the DLL, and reads it in, and calls the 'keys()' routine in my plugin class, and therefore recognizes my file type, but it dies at that point. Specifically, this line, in 'qimagereader.cpp', at line 290 (in version 4.7.4):

    @ QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(QString::fromLatin1(suffix))); @

    Always sets 'plugin' to NULL. The reason it does so is because it thinks that my plugin class, which is defined thusly:

    @ class MskPlugin : public QImageIOPlugin {} @

    Is somehow NOT derived from 'QImageIOPlugin'. It therefore never calls either the 'capabilities, or the 'create' methods in my plugin, (as determined by lines 263-273 in 'qmetaobject.cpp'), and hence the whole thing bombs.

    I've tried everything I can think of to fix this. Can anyone give me a hint of the direction to take? This looks so simple -- and I created the actual 'msk' file decoder in like half an hour. Two weeks later, I'm still trying to get QT to recognize my stupid plugin. I'm using Visual Studio 2010, by the way as an IDE.

    Thanks, in advance, for any and all help!


Log in to reply