I was able to reproduce your problem and it seems that Designer gets confused when you have two plugins for widgets with the same class name.

Make sure:
  • that the name of a class in XML snippet returned by domXml() and the string returned by name() are the same as the widget's class name,
  • that there are no other plugins which name() method returns the same string (you might already have one plugin for AnalogClock widget installed),
  • and finally that you compile your plugin in release mode.


Rename AnalogClock to something like AnalogClockX, update your plugin's code:
Qt Code:
  1. ...
  2.  
  3. QString AnalogClockPlugin::name() const
  4. {
  5. return "AnalogClockX";
  6. }
  7.  
  8. ...
  9.  
  10. QString AnalogClockPlugin::domXml() const
  11. {
  12. return "<widget class=\"AnalogClockX\" name=\"analogClock\">\n"
  13. ...
  14. "</widget>\n";
  15. }
  16.  
  17. ...
  18.  
  19. QString AnalogClockPlugin::includeFile() const
  20. {
  21. return "mycustom.h";
  22. }
To copy to clipboard, switch view to plain text mode 
and run:
Qt Code:
  1. make -f Makefile.Release
To copy to clipboard, switch view to plain text mode 
After this you should get a working plugin:
Qt Code:
  1. <customwidget>
  2. <class>AnalogClockX</class>
  3. <extends>QWidget</extends>
  4. <header>mycustom.h</header>
  5. <container>0</container>
  6. <pixmap></pixmap>
  7. </customwidget>
To copy to clipboard, switch view to plain text mode