No, the test project (like the plugin itself) are Release.
Then why does your original post say this?

D:\dev\Qt\ProvaEsempioPlugin\debug\moc_analogclock.cpp:59: error: C2491

Anyway, the error is because you are including the header file "analogclock.h" as part of the HEADERS section in your .pro file. This causes Qt to create the moc_analogclock.cpp and try to compile it. But that file has already been compiled and is in your plugin DLL. So the compiler is complaining that you have defined the same static variable in two different places, your DLL and your application. Just remove the "analogclock.h" line from your .pro file. You are using the header, not building it.

Where do I find the reference of dllimport in Qt code ?
The header analogclock.h decalares the AnalogClock class this way:

Qt Code:
  1. class QDESIGNER_WIDGET_EXPORT AnalogClock : public QWidget
To copy to clipboard, switch view to plain text mode 

The macro QDESIGNER_WIDGET_EXPORT expands to:

Qt Code:
  1. // qdesignerexportwidget.h
  2.  
  3. #if defined(QDESIGNER_EXPORT_WIDGETS)
  4. # define QDESIGNER_WIDGET_EXPORT Q_DECL_EXPORT
  5. #else
  6. # define QDESIGNER_WIDGET_EXPORT Q_DECL_IMPORT
  7. #endif
To copy to clipboard, switch view to plain text mode 

and Q_DECL_IMPORT and Q_DECL_EXPORT expand to:

Qt Code:
  1. // qcompilerdetection.h
  2.  
  3. # define Q_DECL_EXPORT __declspec(dllexport)
  4. # define Q_DECL_IMPORT __declspec(dllimport)
To copy to clipboard, switch view to plain text mode 

The .pro file for the plugin causes QDESIGNER_EXPORT_WIDGETS to be defined for the plugin build, probably by some combination of the QTDIR_build section and CONFIG += plugin and TEMPLATE = lib declarations.

If you are going to try to build a Qt Designer plugin in a Visual Studio project, then you need to add QDESIGNER_EXPORT_WIDGETS as a Preprocessor Definition in the C/C++ -> Preprocessor section of your plugin project Properties. That means the __declspec( dllexport ) declaration is active and causes the compiler to export the AnalogClock class from the DLL so you can use it in projects.

When you are using the plugin in an application project, you do not use this define. If QDESIGNER_EXPORT_WIDGETS is not defined, then the __declspec( dllimport ) declaration is active and your class is imported from the DLL.