https://github.com/DistinctVision/QScrollEngine
http://www.gamedev.ru/code/forum/?id=217870
Лицензия.
Надо её понять.
http://doc.qt.io/qt-5/lgpl.html
Добавление своего типа в QVariant
http://qtcoder.blogspot.ru/2011/06/qvariant.html
Код: Выделить всё
class SomeClass
{
//всё что нужно
};
Q_DECLARE_METATYPE(SomeClass)
Итак, достаточно после определения класса вызвать макрос Q_DECLARE_METATYPE()
Что это дает?
Помещаем экземпляр класса в QVariant.
Код: Выделить всё
SomeClass scl;
QVariant vclass = QVariant::fromValue(scl);
Всё, теперь экземпляр класса SomeClass, хранится как QVariant и с ним можно делать всё, что и с объектами типа QVariant.
Обратное преобразование.
Код: Выделить всё
scl = qvariant_cast(vclass);
Передача объектов пользовательских классов через QVariant / Qt
http://www.cyberforum.ru/qt/thread544896.html
Код: Выделить всё
qVariantFromValue(УказательНаОбъект);
Хитрый патч
Код: Выделить всё
#define Q_DECLARE_METATYPE_COMMA(...) \
QT_BEGIN_NAMESPACE \
template <> \
struct QMetaTypeId< __VA_ARGS__ > \
{ \
enum { Defined = 1 }; \
static int qt_metatype_id() \
{ \
static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0); \
if (!metatype_id) \
metatype_id = qRegisterMetaType< __VA_ARGS__ >( #__VA_ARGS__, \
reinterpret_cast< __VA_ARGS__ *>(quintptr(0))); \
return metatype_id; \
} \
}; \
QT_END_NAMESPACE \
Добавлено спустя 7 часов 5 минут:
Синхронная и асинхронная загрузка файлов из инета.
http://www.pvsm.ru/qt-2/2875