Skip to content

Instantly share code, notes, and snippets.

View TheDoubleB's full-sized avatar

Blaz TheDoubleB

View GitHub Profile
@TheDoubleB
TheDoubleB / qobjectweakpointer.h
Created December 11, 2022 16:31
Implementation of a "weak pointer" class to a QObject that resets itself when QObject is destroyed
#ifndef QOBJECTWEAKPOINTER_H
#define QOBJECTWEAKPOINTER_H
#include <type_traits>
#include <QObject>
template <class T = QObject>
class QObjectWeakPointer
{