36 lines
638 B
C++
Executable File
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
|