Code review comment for lp:~aacid/unity8/verticalJournal

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

> > ---------------------------
> >
> > void VerticalJournal::createDelegateModel()
> > {
> > #if (QT_VERSION < QT_VERSION_CHECK(5, 1, 0))
> > m_delegateModel = new QQuickVisualDataModel(qmlContext(this), this);
> > connect(m_delegateModel, SIGNAL(createdItem(int,QQuickItem*)), this,
> > SLOT(itemCreated(int,QQuickItem*)));
> > #else
> > m_delegateModel = new QQmlDelegateModel(qmlContext(this), this);
> > connect(m_delegateModel, SIGNAL(createdItem(int,QObject*)), this,
> > SLOT(itemCreated(int,QObject*)));
> > #endif
> >
> >
> > Could we use the QObject::connect version that checks signal-slot
> > compatibility at compile time (as opposed to runtime)? Since we're not
> > checking the connect() results here, which can fail with this runtime-check
> > version, we are making room for sneaky bugs to slip through.
>
> Don't worry, if the creation of items fails that is something that the unit
> test will quickly see.

Still, there's no benefit in having the code that way.

« Back to merge proposal