Hi All,

I have successful created a Qt Designer plugin (customer groupbox) on linux. This plugin I also can successful use in my main window where I do display some customer information(compile and run without any errors).

Now I'm switching over to windows and I'm getting my first trouble with it. Creating the dll and the lib files could be done without any problems. But if I use the created plugin in a main window, I get the follwing errors/warnigs:

Qt Code:
  1. 1>moc_userdetailsgb.cpp
  2. 1>.\debug\moc_userdetailsgb.cpp(41) : warning C4273: 'staticMetaObject': Inkonsistente DLL-Bindung.
  3. 1> d:\development\projects\test_mainwindow\debug\../userdetailsgb.h(52): Siehe vorherige Definition von 'public: static QMetaObject const UserDetailsGB::staticMetaObject'
  4. 1>.\debug\moc_userdetailsgb.cpp(41) : error C2491: 'UserDetailsGB::staticMetaObject': Definition von Statisches Datenmember für dllimport nicht zulässig
  5. 1>.\debug\moc_userdetailsgb.cpp(47) : warning C4273: 'UserDetailsGB::metaObject': Inkonsistente DLL-Bindung.
  6. 1> d:\development\projects\test_mainwindow\debug\../userdetailsgb.h(52): Siehe vorherige Definition von 'metaObject'
  7. 1>.\debug\moc_userdetailsgb.cpp(52) : warning C4273: 'UserDetailsGB::qt_metacast': Inkonsistente DLL-Bindung.
  8. 1> d:\development\projects\test_mainwindow\debug\../userdetailsgb.h(52): Siehe vorherige Definition von 'qt_metacast'
  9. 1>.\debug\moc_userdetailsgb.cpp(60) : warning C4273: 'UserDetailsGB::qt_metacall': Inkonsistente DLL-Bindung.
  10. 1> d:\development\projects\test_mainwindow\debug\../userdetailsgb.h(52): Siehe vorherige Definition von 'qt_metacall'
  11. 1>Das Buildprotokoll wurde unter "file://d:\Development\Projects\Test_MainWindow\debug\BuildLog.htm" gespeichert.
  12. 1>testApp - 1 Fehler, 4 Warnung(en)
  13. ========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========
To copy to clipboard, switch view to plain text mode 

Here the plugin pro file.
Qt Code:
  1. TEMPLATE = vclib
  2. LANGUAGE = C++
  3. TARGET = userdetailsgb
  4. DESTDIR = C:\Qt\4.2.3\plugins\designer
  5.  
  6. target.path = $$[QT_INSTALL_PLUGINS]/designer
  7. INSTALLS += target
  8. CONFIG += designer plugin debug_and_release
  9.  
  10. DEFINES += USERDETAILSGB_LIB
  11.  
  12. ######################################
  13. # Header files
  14. ######################################
  15. HEADERS = ./src/userdetailsgb.h \
  16. ./src/userdetailsgbplugin.h \
  17. ./src/userdetailsgbpluginglobal.h \
  18.  
  19.  
  20. ######################################
  21. # Source files
  22. ######################################
  23. SOURCES = ./src/userdetailsgb.cpp \
  24. ./src/userdetailsgbplugin.cpp
To copy to clipboard, switch view to plain text mode 

here the userdetailsgbpluginglobal.h file:
Qt Code:
  1. #ifndef USERDETAILSGBPLUGINGLOBAL_H
  2. #define USERDETAILSGBPLUGINGLOBAL_H
  3.  
  4. #include <Qt/qglobal.h>
  5.  
  6. #ifdef USERDETAILSGB_LIB
  7. # define USERDETAILSGBPLUGIN_EXPORT Q_DECL_EXPORT
  8. #else
  9. # define USERDETAILSGBPLUGIN_EXPORT Q_DECL_IMPORT
  10. #endif
  11.  
  12. #endif // USERDETAILSGBPLUGINGLOBAL_H
To copy to clipboard, switch view to plain text mode 

here the userdetailsgbplugin.h file
Qt Code:
  1. #ifndef USERDETAILSGBPLUGIN_H
  2. #define USERDETAILSGBPLUGIN_H
  3.  
  4. #include "userdetailsgbpluginglobal.h"
  5.  
  6. #include <QObject>
  7. #include <QDesignerCustomWidgetInterface>
  8.  
  9. class USERDETAILSGBPLUGIN_EXPORT UserDetailsGBPlugin : public QObject, public QDesignerCustomWidgetInterface
  10. {
  11. Q_OBJECT
  12.  
  13. public:
  14. UserDetailsGBPlugin( QObject *parent = 0 );
  15.  
  16. bool isContainer() const;
  17. bool isInitialized() const;
  18. QIcon icon() const;
  19. QString domXml() const;
  20. QString group() const;
  21. QString includeFile() const;
  22. QString name() const;
  23. QString toolTip() const;
  24. QString whatsThis() const;
  25. QWidget *createWidget( QWidget *parent );
  26. void initialize( QDesignerFormEditorInterface *core );
  27.  
  28. private:
  29. bool initialized;
  30. };
  31.  
  32. #endif // USERDETAILSGBPLUGIN_H
To copy to clipboard, switch view to plain text mode 

here the userdetailsgb.h file
Qt Code:
  1. #ifndef USERDETAILSGB_H
  2. #define USERDETAILSGB_H
  3.  
  4. #include <QObject>
  5. #include <QGroupBox>
  6. #include <QtDesigner/QDesignerExportWidget>
  7.  
  8. class QDESIGNER_WIDGET_EXPORT UserDetailsGB : public QGroupBox
  9. {
  10. Q_OBJECT
  11.  
  12. public:
  13. UserDetailsGB( QWidget * parent = 0 );
  14. ~UserDetailsGB() {}
  15.  
  16. };
  17.  
  18. #endif // USERDETAILSGB_H
To copy to clipboard, switch view to plain text mode 

and finally here the main app pro file
Qt Code:
  1. TEMPLATE = vcapp
  2. TARGET = testApp
  3. DEPENDPATH += .
  4. INCLUDEPATH += .
  5.  
  6. # Input
  7. HEADERS += testmainwindow.h userdetailsgb.h
  8. FORMS += mainwindow.ui
  9. SOURCES += main.cpp testmainwindow.cpp
To copy to clipboard, switch view to plain text mode 

I'm using MSVC 2005 Express, Windows XP, Qt 4.2.3.
Any help on this would be great. Many thanks.
big4mil