Code review comment for lp:~nick-dedekind/dee-qt/glib-events

Revision history for this message
Michal Hruby (mhr3) wrote :

> Well, you still need to cast it with G_CALLBACK([] () {}), that should do it.

Had hard time believing that it wouldn't work, but it doesn't indeed... Nonetheless with a cast in-between it does:

    typedef void(*DeeModelIterFunc)(DeeListModel*, DeeModelIter*);

    g_signal_connect_swapped(m_deeModel, "row-added", G_CALLBACK((DeeModelIterFunc)([] (DeeListModel* model, DeeModelIter* iter)
    {
        QGlibCallbackEvent::sendEvent(model, [model, iter](QObject*) {
            model->d->onRowAdded(iter);
        });
    })), m_parent);

« Back to merge proposal