[Aptitude-devel] 002-qt-stubs review
Piotr Galiszewski
piotr at galiszewski.pl
Wed Jul 14 00:09:15 UTC 2010
2010/7/13 Daniel Burrows <dburrows at google.com>:
> On Mon, Jul 12, 2010 at 4:45 PM, Piotr Galiszewski <piotr at galiszewski.pl> wrote:
>> In Qt to receive signal it is needed to use connect functions. connect
>> requires a pointer to a sender and a receiver of this particular
>> signal. tabs_manager do not know about classes which want to connect
>> to his signal. So receiver needs a pointer to tabs_manager_impl.
>> There are many solution of this problem, but I am not sure which will
>> be the best e.g.
>
> I guess the main thing that confuses me here is that I can't see the
> signal, even in 004. Is it something you haven't added yet?
>
Yes. I will add this signal in new version
> The way that I would expose a read-only slot in sigc++ is to pass a
> slot object into an (abstract) method, e.g.:
>
> virtual sigc::connection connect_tab_changed(const
> sigc::slot<void, tab *> &slot) = 0;
>
> If Qt has no way of abstracting over slots, that would make this
> difficult. In that case maybe you could just make a public signal for
> now?
>
There is another problem. Qt moc requires that all declaration of
signals and slots have to be placed in header file. Due to that,
completely hiding implementation will not work and there have to be
another header. I can create tabs_manager_impl.h header, but I do not
know if it is acceptable solution. Another solutions are not using
normal class as it was written before, or something different than Qt
signals and slots mechanism. Maybe I am wrong, but my google skill is
to low to find better solution :/
Any suggestions are much appreciated. I will finish this patch tomorrow
Second problem is that I do not know for now, how to force one
packages_tab per window. Probably I will delay it for some later patch
> Daniel
>
--
Regards
Piotr Galiszewski
More information about the Aptitude-devel
mailing list