/* This file is part of KDBindings. SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com> Author: Sean Harmer <sean.harmer@kdab.com> SPDX-License-Identifier: MIT Contact KDAB at <info@kdab.com> for commercial licensing options.*/#include<kdbindings/signal.h>#include<iostream>#include<string>usingnamespaceKDBindings;classPerson{public:Person(std::stringconst&name):m_name(name){}Signal<std::stringconst&>speak;voidlisten(std::stringconst&message){std::cout<<m_name<<" received: "<<message<<std::endl;}private:std::stringm_name;};intmain(){Personalice("Alice");Personbob("Bob");alice.speak.connect(&Person::listen,&bob);bob.speak.connect(&Person::listen,&alice);alice.speak.emit("Have a nice day!");bob.speak.emit("Thank you!");return0;}