[Qt-interest] Q_DECLARE_INTERFACE trouble when using from different library

Jaco Naude naude.jaco at gmail.com
Wed Mar 31 14:55:33 CEST 2010


Aha that was it, thank you very much.

Cheers,
Jaco

On Wed, Mar 31, 2010 at 10:44 AM, Thiago Macieira <thiago at kde.org> wrote:
> 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
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>




More information about the Qt-interest-old mailing list