Ярлыки

четверг, 16 августа 2018 г.

Qt - check QObject derived class type

Example of using DelegateModel for hierarchical tree of data.

Tag* tag = new Tag();
Tag* tag_cast = qobject_cast<QObject*>(tag);
if(tag_cast) qDebug() << "Cool!";
else qDebug() << "oh..";

Additional info here and here.

Комментариев нет:

Отправить комментарий