Просмотр исходного кода

frontend: Fix metatype declaration for scenes' SignalContainer

To be used as a QVariant, stream operators need to be provided
as the meta type will otherwise be considered "incomplete". These were
implemented before the frontend reorganization but not migrated as part
of it.
PatTheMav 4 месяцев назад
Родитель
Сommit
8b7331642f
1 измененных файлов с 13 добавлено и 0 удалено
  1. 13 0
      frontend/widgets/OBSBasic_Scenes.cpp

+ 13 - 0
frontend/widgets/OBSBasic_Scenes.cpp

@@ -37,6 +37,19 @@ template<typename OBSRef> struct SignalContainer {
 	OBSRef ref;
 	vector<shared_ptr<OBSSignal>> handlers;
 };
+
+QDataStream &operator<<(QDataStream &out, const SignalContainer<OBSScene> &v)
+{
+	out << v.ref;
+	return out;
+}
+
+QDataStream &operator>>(QDataStream &in, SignalContainer<OBSScene> &v)
+{
+	in >> v.ref;
+	return in;
+}
+
 } // namespace
 
 Q_DECLARE_METATYPE(obs_order_movement);