[scribus-dev] Tables GSoC - Weekly Report #6

Elvis Stansvik elvstone at gmail.com
Mon Jul 11 15:56:56 UTC 2011


2011/7/11 Andreas Vox <andreas.vox at googlemail.com>:
> Hi Elvis!
>
> Yes, listening to the StyleContext is the way to go.
> For listening to an Observable you can just derive from this class and
> implement ist changed() method:
>
> // in observabe.h:
>
> template<class OBSERVED>
> class SCRIBUS_API Observer {
> public:
>        virtual void changed(OBSERVED) = 0;
>        virtual ~Observer() {}
> };
>
> or you use
>      bool Observable::connectObserver(QObject* o, const char* slot);
>        bool Observable::disconnectObserver(QObject* o, const char* slot =
> 0);
>
> to connect an Observable to an QObject-observer; in that case deriving from
> QObject is enough.
> The Observable::update() method will notify both kinds of observers.

Ah. Great. Thanks.

Elvis



More information about the scribus-dev mailing list