[Aptitude-devel] aptitude-qt code design
Daniel Burrows
dburrows at google.com
Thu Jun 10 20:19:38 UTC 2010
On Wed, Jun 9, 2010 at 1:22 PM, Piotr Galiszewski <piotr at galiszewski.pl> wrote:
> 2010/6/7 Daniel Burrows <dburrows at google.com>:
>> So, to bring this to a more specific level, here are the translations you
>> definitely need to do:
>>
>> 1. Passing a Qt slot as a sigc++ slot.
>> 2. Receiving sigc++ slots and invoking them in the main UI thread.
>>
>> For 1, I don't think that a translation is necessary, actually, except
>> maybe derving the Qt object from sigc::trackable. Qt slots are just
>> normal function calls (IIRC), so you can use sigc::mem_fun as usual
>> to set up the callback slot.
>>
>> For 2, I have no idea how to do it in Qt :). I doubt it requires a new
>> internal API, though, since it just requires writing a single function
>> somewhere (to receive and interpret the slots).
>>
>
> It is not a problem to mix Qt and sigc++ code in the same class.
> Program only need to be compiled with no_keywords flag and later use
> macros instead of standard keywords for example: signals -> Q_SIGNALS.
>
> I planned to do this to make GUI code cleaner and make writing this easier :)
Do you have a draft of the interface for your proposed abstraction
layer that I could look at to see what you want to do? i.e., give an
example of defining a slot in a Qt class and passing it to the backend
via the wrapper.
>> For now, I think I'd prefer to have you work in a separate repository.
>> I can merge your work into the main branch.
>>
>
> OK. IIRC Arthur prefers hosting gsoc code on alioth, so I will create
> there new project "AptitudeQt". Mirror on gitorious.org is also an
> option. The project will be mirror of official Aptitude repository and
> all my work will be done in aptitude-qt branch
Personally, I don't care whether you store your code on alioth or
gitorious or github or your own personal server. Well, the personal
server might be less desirable since it's probably not backed up :).
Daniel
More information about the Aptitude-devel
mailing list