[Qt-interest] Q_DECLARE_INTERFACE trouble when using from different library
Thiago Macieira
thiago at kde.org
Wed Mar 31 12:44:29 CEST 2010
Em Quarta-feira 31 Março 2010, às 09:54:51, Jaco Naude escreveu:
> ../../ObjManagementLib/source/IContext.h:47: error: expected
> identifier before string constant
> ../../ObjManagementLib/source/IContext.h:47: error: expected ',' or
> '...' before string constant
> ../../ObjManagementLib/source/IContext.h:47: error: expected
> constructor, destructor, or type conversion before ';' token
I'd say you forgot to #include <QObject>
> #ifndef ICONTEXT_H
> #define ICONTEXT_H
>
> #include "ObjManagement_global.h"
> #include <QString>
>
> namespace Qtilities {
> namespace ObjManagement {
> namespace Interfaces {
> /*!
> \class IContext
> \brief Objects implementing this interface will have a
> context associated with them.
> */
> class OBJMANAGEMENT_SHARED_EXPORT IContext {
> public:
> IContext() {}
> virtual ~IContext() {}
>
> //! Returns a context string for the context
> represented by this interface.
> virtual QString contextString() const = 0;
> //! Returns a help ID for this context.
> virtual QString contextHelpId() const { return QString(); }
> };
> }
> }
> }
>
> Q_DECLARE_INTERFACE(Qtilities::ObjManagement::Interfaces::IContext,"com.Qti
> lities.ObjManagement.IContext/1.0");
>
> #endif // ICONTEXT_H
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Senior Product Manager - Nokia, Qt Development Frameworks
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100331/877b8354/attachment.bin
More information about the Qt-interest-old
mailing list