QWidget The specified module could not be found QObject
I have developed a widget which can fade in and out; fading in and out utilizes a timer. Because I want to share the look and feel of this widget with other widgets, I placed all the timing code into an artist object. Each widget with a certain look then derives an artist from the more generic artist and places specialized drawing code in the newly derived object. I created a Timer class derived from QObject, which (though possibly expensive) can be created in any class (GUI or not) that needs a timer. These libraries and others are all linked into my widget dll. The problem is, QT Creator (Designer) will not load the widget DLL claiming “The specified module could not be found.” Before adding the Timer code everything loaded inside QT Creator. Does anyone have any ideas of how I can get this dll to load without re-architecting my source? Also, if the widget has been added to a form (before this problem occurred) everything is fine, that is the widget behaves as expected; the problem is the designer will refuse to load the DLL with the Timer class linked in. Also, if I go to the DLL and rename it, QT Creator modifies its error code to list both the DLL before the name change along with the new name, therefore, it is seeing the DLL. This is not a problem of the DLL not being in the needed directory.
Why didn't you use QTimer?
I doubt we can help without seeing some code.
Because the containing class is not derived from QObject.
Basically, I have a widget which contains attributes for the states of the widget. This widget has a pointer to an artist. When a paint event occurs, the widget passes the paint command onto the artist. Whichever artist the widget has been given draws the widget. The artist specifies a minimal interface. One of my artists emulates a heads up display. This artist also allows fading in and out of the widget. If an artist does not support fading, calling Fade() will return false. Therefore, the artist owns the timer. However, the artist is a simple C++ class, it’s not derived from a QObject therefore, it cannot own a QTimer because it cannot connect callbacks to the QTimer. I created my own Timer class which is derived from QObject so anything, be it a C++ class or a QT class can instantiate a Timer object and receive expiration notifications. The problem is, when I did this, QT Creator no longer liked my dll. It seems strange to me that QT Creator would care, but it does.
If this is just about the fading, then you could just have a widget that does the fading and place the to-be-faded widgets into that one. That is what we do in places in Qt Creator. If this is about styling: Qt comes with a styling system that is meant for things like the ones you describe.
Sorry, have not really touched anything in Qt designer (the component used for widget UI design in Creator). My guess would be a conflict in symbol names or something similar. You could just grep the symbols of designer and Qt for the class/method names that break your designer-plugin to make sure there are no conflicts.
Should any unfortunate soul be cursed to wander this path know there is victory in adding the dll of the offending library (in my case it was Timer.dll, which was never present in the error message) to the QTCreator/bin directory.