Skip to content

Instantly share code, notes, and snippets.

@Temptationx
Last active March 14, 2019 19:20
Show Gist options
  • Save Temptationx/3225ac352c719bf9d314 to your computer and use it in GitHub Desktop.
Save Temptationx/3225ac352c719bf9d314 to your computer and use it in GitHub Desktop.
C++ lambda Qt disconnect
auto conn = std::make_shared<QMetaObject::Connection>();
*conn = QObject::connect(obj, &Object::signal, this, [this, conn]() {
disconnect(*conn);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment