Communi  3.7.0
A cross-platform IRC framework written with Qt
Signals | Public Member Functions | List of all members
IrcLagTimer Class Reference

Provides a timer for measuring lag. More...

Inherits QObject.

Signals

void lagChanged (qint64 lag)
 

Public Member Functions

 IrcLagTimer (QObject *parent=nullptr)
 
 ~IrcLagTimer () override
 
IrcConnectionconnection () const
 
int interval () const
 
qint64 lag () const
 

Detailed Description

Note
IrcLagTimer relies on functionality introduced in Qt 4.7.0, and is therefore not functional when built against earlier versions of Qt.

Constructor & Destructor Documentation

◆ IrcLagTimer()

IrcLagTimer::IrcLagTimer ( QObject *  parent = nullptr)
explicit

Constructs a new lag timer with parent.

Note
If parent is an instance of IrcConnection, it will be automatically assigned to connection.

◆ ~IrcLagTimer()

IrcLagTimer::~IrcLagTimer ( )
override

Destructs the lag timer.

Member Function Documentation

◆ connection()

IrcConnection * IrcLagTimer::connection ( ) const

This property holds the associated connection.

Access functions:
  • IrcConnection* connection() const
  • void setConnection(IrcConnection* connection)

◆ interval()

int IrcLagTimer::interval ( ) const

This property holds the lag measurement interval in seconds.

The default value is 60 seconds. A value equal to or less than 0 seconds disables the lag measurement.

Access functions:
  • int interval() const
  • void setInterval(int seconds)

◆ lag()

qint64 IrcLagTimer::lag ( ) const

This property holds the current lag in milliseconds.

The value is -1 when

  • the connection is not connected,
  • the lag has not yet been measured,
  • the lag timer is disabled (interval <= 0s), or
  • the Qt version is too old (4.7.0 or later is required).
Access function:
  • qint64 lag() const
Notifier signal:
  • void lagChanged(qint64 lag)

◆ lagChanged

void IrcLagTimer::lagChanged ( qint64  lag)
signal

This signal is emitted when the lag has changed.