On Thursday 17 Jul 2014 13:28:10 Jędrzej Nowacki wrote:
> On Thursday 17 of July 2014 10:51:03 you wrote:
> > QVariant::operator== is not symmetric
> > 
> >      QDateTime dateTime = QDateTime::currentDateTime();
> >     
> >     QTime time = dateTime.time();
> >     
> >     qDebug() << (QVariant(dateTime) == QVariant(time));
> >     qDebug() << (QVariant(time) == QVariant(dateTime));
> > 
> > -->
> > false
> > true
> 
> We could make it symmetric, if you want. 
A equals operator that is not symetric is broken. Such a class cannot be 
reliably used in std nor qt containers. Or do you know which way around, 
QList::contains uses the equals operation?

daniel
_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to