trying to stop calling into the MainWindow

Lubomir I. Ivanov neolit123 at gmail.com
Fri Nov 6 05:34:21 PST 2015


On 6 November 2015 at 15:14, Tomaz Canabrava <tcanabrava at kde.org> wrote:
>
>
> On Fri, Nov 6, 2015 at 10:59 AM, Lubomir I. Ivanov <neolit123 at gmail.com>
> wrote:
>>
>> On 6 November 2015 at 07:29, Dirk Hohndel <dirk at hohndel.org> wrote:
>> > We have created a monster.
>> >
>>
>> when the Qt UI began it's incarnation, i saw the
>> MainWindow::instance() method and secretly told myself "i know where this
>> is going".
>> but i left Tomaz do this thing because, after all he obviously
>> understand things that we don't and i really *hate* arguing with
>> people.
>
>
> I don't like it, I never liked it, and I don't argue, I talk and if anyone
> has a better idea than I do, I'll accept.
>
> the thing was, at that time I was pretty crazy doing the UI mostly alone (no
> one here had any Qt  knowledge at the beginning but me) and I wanted to
> create something fast - the GTK UI was a mess where every widget had a
> pointer to the main. this was the fastest (not the cleanest) approach.
>

true.

>> on the other hand, i can probably write a 10 page article (i.e. rant)
>> on signals/slots vs callbacks/interfaces.
>
> didn't really understood this rant, for me they are basically the same thing.

in the signals/slots design there could be one dispatcher with many listeners.
the connection and dispatching itself happens behind the scene via the
connect() / emit()
things. it eases the hole notification process and makes the user
write less code.

from there on, things can go horribly wrong.

> connect( sender, &SenderClass::method, receiver, &ReceiverClass::method);
>

method referencing in Qt, yey!

lubomir
--


More information about the subsurface mailing list