it is custom widget plugin for QtDesigner and contains Q_EXPORT_PLUGIN2(customwidgetplugin, QLedPlugin) .
it is custom widget plugin for QtDesigner and contains Q_EXPORT_PLUGIN2(customwidgetplugin, QLedPlugin) .
you didn't answer my question, did you understand what I asked?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
QLed is a custom widget in QLed.h file exist :
class QDESIGNER_WIDGET_EXPORT QLed : public QWidget
Is this your answer !!??
Partly.
This define either will expand to __declspec( dllimport ) or __declspec( dllexport ), depending if you define the define variable in your plugin project.
In your plugin you should have a header with something like:
Qt Code:
#if defined(FOO_LIBRARY) # define FOOSHARED_EXPORT Q_DECL_EXPORT #else # define FOOSHARED_EXPORT Q_DECL_IMPORT #endifTo copy to clipboard, switch view to plain text mode
and you have to define FOO_LIBRARY in your plugin project, otherwise the class doesn't get exported.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Hello high_flyer, thanks for replies,
Dear Sir, Qts manual says i can design a custom widget and make a dll also plugin export what it need, and use it in QtDesigner, i think you say i make new other dll for using in QtCreator, but then is it possible two dll and same QLed class??
i also tested this on Q3Frame it is a custom widget plugin in QtDesigner and same problem.
did you find in your project the code I posted in my last post?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
in custom widgets have not any
//////////////////
__declspec( dllimport ) or __declspec( dllexport )
#if defined(FOO_LIBRARY)
# define FOOSHARED_EXPORT Q_DECL_EXPORT
#else
# define FOOSHARED_EXPORT Q_DECL_IMPORT
#endif
///////////////////////
my project and QLed also have not,
but my plugin has QDESIGNER_WIDGET_EXPORT "class QDESIGNER_WIDGET_EXPORT QLed : public QWidget"
and to what does QDESIGNER_WIDGET_EXPORT expand to?
In should expand to __declspec( dllimport ) under windows.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
as QT manual and it's samples said custom widget plugin make by using QDESIGNER_WIDGET_EXPORT keyword.
i can not understand how i can use QDESIGNER_WIDGET_EXPORT keyword and you said __declspec( dllimport ) to have both of them.
Thanks in Advanced
try adding this to your QLed.h
Qt Code:
#if defined(QLED_LIBRARY) //this should be defined in your preprocessor when you build the plugin # define QDESIGNER_WIDGET_EXPORT Q_DECL_EXPORT #else # define QDESIGNER_WIDGET_EXPORT Q_DECL_IMPORT //this will be defined on the user application side. You don't need to do anything for that. #endifTo copy to clipboard, switch view to plain text mode
if it didn't help you will have to read about how to export\import classes over DLLs.
http://doc.qt.nokia.com/4.7-snapshot/sharedlibrary.html
It looks like you are not importing your QLed library.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
serjik (24th May 2011)
Thanks high_flyer
I fix my problem by reading this link:
http://doc.qt.nokia.com/latest/desig...a-ui-file.html
But I didnt use UiLoader,Regards Lopez.
Hi, ok first i compile my plugin (here QLed you can get it http://qt-apps.org/content/show.php?content=72482), after compilation i add some QLed widgets to my FORM by QDesigner, then i copy QLed.h and QLed.cpp to my own project and in QLed.h file i delete QDESIGNER_WIDGET_EXPORT keyword, and now i can access my FORM children, BUT I DIDnt do with UiLoader, (if any body can do it please modify my code and upload, thanks in advance), now you can find my test program in attachment, Regards Serjik.
Bookmarks