#include #include #include #include #include int main(int argc, char *argv[]) { QApplication a(argc, argv); QObject::connect(QApplication::clipboard(), &QClipboard::changed, [] () { qDebug() << "clipboard changed!"; }); QLocalServer* server = new QLocalServer(); QObject::connect(server, &QLocalServer::newConnection, [server] () { qDebug() << "New Connection"; QObject::connect(server->nextPendingConnection(), &QLocalSocket::disconnected, [] () { qDebug() << "Client disconnected"; }); }); server->listen("strange_behaviour"); return a.exec(); }