Last active
March 14, 2019 19:20
-
-
Save Temptationx/3225ac352c719bf9d314 to your computer and use it in GitHub Desktop.
C++ lambda Qt disconnect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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