ok, in QtDesigner i add four QLed widgets to a form, so i think its direct child, i dont use a QLed in a QFrame.
ok, in QtDesigner i add four QLed widgets to a form, so i think its direct child, i dont use a QLed in a QFrame.
It looks you have problem with your QLed library export/import, either the QLed class it self or the plugin.release/moc_qled.cpp:75: warning: 'QLed::staticMetaObject' redeclared without dllimport attribute after being referenced with dll linkage
release/moc_qled.cpp:84: warning: 'virtual const QMetaObject* QLed::metaObject() const' redeclared without dllimport attribute: previous dllimport ignored
release/moc_qled.cpp:89: warning: 'virtual void* QLed::qt_metacast(const char*)' redeclared without dllimport attribute: previous dllimport ignored
release/moc_qled.cpp:97: warning: 'virtual int QLed::qt_metacall(QMetaObject::Call, int, void**)' redeclared without dllimport attribute: previous dllimport ignored
Did you define the export macro when building the QLed plugin?
==========================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.
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)
Bookmarks