Files
qt5-legatus-legacy/Lts/Common/LtsUtils/LtsUtilsCore/scoped_connection.h
T
2026-08-13 18:33:10 +02:00

36 lines
638 B
C++
Executable File

/**
* @RDE_HEADER@
* ScopedConnection
* $Id$
* $HeadURL$
* $Author$
* Created by Christian Fröbel, SLSE, 2017-07-24
*/
#pragma once
#include <LtsUtilsCore/ltsutilscore_export.h>
#include <Qt>
namespace LtsUtils
{
class IConnection;
/**
* A small janitor that connects the given IConnection in the constructor
* and disconnects it in the destructor.
* @author Christian Fröbel
*/
class LTSUTILSCORE_EXPORT ScopedConnection
{
public:
explicit ScopedConnection(IConnection *connection, Qt::ConnectionType = Qt::AutoConnection);
~ScopedConnection();
private:
IConnection *m_conn;
};
} // namespace LtsUtils