QtBase  v6.3.1
Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Friends | List of all members
TorrentClient Class Reference

#include <torrentclient.h>

Inheritance diagram for TorrentClient:
Inheritance graph
[legend]
Collaboration diagram for TorrentClient:
Collaboration graph
[legend]

Public Types

enum  State {
  Idle , Paused , Stopping , Preparing ,
  Searching , Connecting , WarmingUp , Downloading ,
  Endgame , Seeding
}
 
enum  Error {
  UnknownError , TorrentParseError , InvalidTrackerError , FileError ,
  ServerError
}
 

Public Slots

void start ()
 
void stop ()
 
void setPaused (bool paused)
 
void setupIncomingConnection (PeerWireClient *client)
 
- Public Slots inherited from QObject
void deleteLater ()
 

Signals

void stateChanged (TorrentClient::State state)
 
void error (TorrentClient::Error error)
 
void downloadCompleted ()
 
void peerInfoUpdated ()
 
void dataSent (int uploadedBytes)
 
void dataReceived (int downloadedBytes)
 
void progressUpdated (int percentProgress)
 
void downloadRateUpdated (int bytesPerSecond)
 
void uploadRateUpdated (int bytesPerSecond)
 
void stopped ()
 
- Signals inherited from QObject
void destroyed (QObject *=nullptr)
 
void objectNameChanged (const QString &objectName, QPrivateSignal)
 

Public Member Functions

 TorrentClient (QObject *parent=nullptr)
 
 ~TorrentClient ()
 
bool setTorrent (const QString &fileName)
 
bool setTorrent (const QByteArray &torrentData)
 
MetaInfo metaInfo () const
 
void setMaxConnections (int connections)
 
int maxConnections () const
 
void setDestinationFolder (const QString &directory)
 
QString destinationFolder () const
 
void setDumpedState (const QByteArray &dumpedState)
 
QByteArray dumpedState () const
 
qint64 progress () const
 
void setDownloadedBytes (qint64 bytes)
 
qint64 downloadedBytes () const
 
void setUploadedBytes (qint64 bytes)
 
qint64 uploadedBytes () const
 
int connectedPeerCount () const
 
int seedCount () const
 
QByteArray peerId () const
 
QByteArray infoHash () const
 
quint16 serverPort () const
 
State state () const
 
QString stateString () const
 
Error error () const
 
QString errorString () const
 
- Public Member Functions inherited from QObject
Q_INVOKABLE QObject (QObject *parent=nullptr)
 
virtual ~QObject ()
 
virtual bool event (QEvent *event)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
QString objectName () const
 
void setObjectName (const QString &name)
 
QBindable< QStringbindableObjectName ()
 
bool isWidgetType () const
 
bool isWindowType () const
 
bool signalsBlocked () const noexcept
 
bool blockSignals (bool b) noexcept
 
QThreadthread () const
 
void moveToThread (QThread *thread)
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 
void killTimer (int id)
 
template<typename T >
T findChild (const QString &aName=QString(), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<typename T >
QList< TfindChildren (const QString &aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<typename T >
QList< TfindChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
const QObjectListchildren () const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const
 
bool disconnect (const QObject *receiver, const char *member=nullptr) const
 
void dumpObjectTree () const
 
void dumpObjectInfo () const
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const
 
QList< QByteArraydynamicPropertyNames () const
 
QBindingStoragebindingStorage ()
 
const QBindingStoragebindingStorage () const
 
QObjectparent () const
 
bool inherits (const char *classname) const
 

Protected Slots

void timerEvent (QTimerEvent *event) override
 

Friends

class TorrentClientPrivate
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
static QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 
static QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
static QMetaObject::Connection ::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 slot)
 
static QMetaObject::Connection ::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *context, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static std::enable_if< QtPrivate::FunctionPointer< Func2 >::ArgumentCount==-1 &&!std::is_convertible_v< Func2, const char * >, QMetaObject::Connection >::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 slot)
 
template<typename Func1 , typename Func2 >
static std::enable_if< QtPrivate::FunctionPointer< Func2 >::ArgumentCount==-1 &&!std::is_convertible_v< Func2, const char * >, QMetaObject::Connection >::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *context, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static bool disconnect (const QMetaObject::Connection &)
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot)
 
template<typename Func1 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero)
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
 QObject (QObjectPrivate &dd, QObject *parent=nullptr)
 
- Protected Attributes inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Properties inherited from QObject
QString objectName
 the name of this object More...
 

Detailed Description

Definition at line 87 of file torrentclient.h.

Member Enumeration Documentation

◆ Error

Enumerator
UnknownError 
TorrentParseError 
InvalidTrackerError 
FileError 
ServerError 

Definition at line 104 of file torrentclient.h.

◆ State

Enumerator
Idle 
Paused 
Stopping 
Preparing 
Searching 
Connecting 
WarmingUp 
Downloading 
Endgame 
Seeding 

Definition at line 92 of file torrentclient.h.

Constructor & Destructor Documentation

◆ TorrentClient()

TorrentClient::TorrentClient ( QObject parent = nullptr)

Definition at line 233 of file torrentclient.cpp.

Here is the call graph for this function:

◆ ~TorrentClient()

TorrentClient::~TorrentClient ( )

Definition at line 255 of file torrentclient.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ connectedPeerCount()

int TorrentClient::connectedPeerCount ( ) const

Definition at line 382 of file torrentclient.cpp.

Here is the call graph for this function:

◆ dataReceived

void TorrentClient::dataReceived ( int  downloadedBytes)
signal

◆ dataSent

void TorrentClient::dataSent ( int  uploadedBytes)
signal

◆ destinationFolder()

QString TorrentClient::destinationFolder ( ) const

Definition at line 296 of file torrentclient.cpp.

◆ downloadCompleted

void TorrentClient::downloadCompleted ( )
signal

◆ downloadedBytes()

qint64 TorrentClient::downloadedBytes ( ) const

Definition at line 367 of file torrentclient.cpp.

◆ downloadRateUpdated

void TorrentClient::downloadRateUpdated ( int  bytesPerSecond)
signal

◆ dumpedState()

QByteArray TorrentClient::dumpedState ( ) const

Definition at line 333 of file torrentclient.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ error() [1/2]

TorrentClient::Error TorrentClient::error ( ) const

Definition at line 412 of file torrentclient.cpp.

◆ error [2/2]

void TorrentClient::error ( TorrentClient::Error  error)
signal

◆ errorString()

QString TorrentClient::errorString ( ) const

Definition at line 417 of file torrentclient.cpp.

◆ infoHash()

QByteArray TorrentClient::infoHash ( ) const

Definition at line 427 of file torrentclient.cpp.

◆ maxConnections()

int TorrentClient::maxConnections ( ) const

◆ metaInfo()

MetaInfo TorrentClient::metaInfo ( ) const

Definition at line 286 of file torrentclient.cpp.

◆ peerId()

QByteArray TorrentClient::peerId ( ) const

Definition at line 422 of file torrentclient.cpp.

◆ peerInfoUpdated

void TorrentClient::peerInfoUpdated ( )
signal
Here is the caller graph for this function:

◆ progress()

qint64 TorrentClient::progress ( ) const

Definition at line 357 of file torrentclient.cpp.

◆ progressUpdated

void TorrentClient::progressUpdated ( int  percentProgress)
signal

◆ seedCount()

int TorrentClient::seedCount ( ) const

Definition at line 392 of file torrentclient.cpp.

Here is the call graph for this function:

◆ serverPort()

quint16 TorrentClient::serverPort ( ) const

◆ setDestinationFolder()

void TorrentClient::setDestinationFolder ( const QString directory)

Definition at line 291 of file torrentclient.cpp.

◆ setDownloadedBytes()

void TorrentClient::setDownloadedBytes ( qint64  bytes)

Definition at line 362 of file torrentclient.cpp.

◆ setDumpedState()

void TorrentClient::setDumpedState ( const QByteArray dumpedState)

Definition at line 301 of file torrentclient.cpp.

Here is the call graph for this function:

◆ setMaxConnections()

void TorrentClient::setMaxConnections ( int  connections)

◆ setPaused

void TorrentClient::setPaused ( bool  paused)
slot

Definition at line 482 of file torrentclient.cpp.

Here is the call graph for this function:

◆ setTorrent() [1/2]

bool TorrentClient::setTorrent ( const QByteArray torrentData)

Definition at line 272 of file torrentclient.cpp.

Here is the call graph for this function:

◆ setTorrent() [2/2]

bool TorrentClient::setTorrent ( const QString fileName)

Definition at line 262 of file torrentclient.cpp.

Here is the call graph for this function:

◆ setupIncomingConnection

void TorrentClient::setupIncomingConnection ( PeerWireClient client)
slot

Definition at line 787 of file torrentclient.cpp.

Here is the call graph for this function:

◆ setUploadedBytes()

void TorrentClient::setUploadedBytes ( qint64  bytes)

Definition at line 372 of file torrentclient.cpp.

◆ start

void TorrentClient::start ( )
slot

Definition at line 432 of file torrentclient.cpp.

Here is the call graph for this function:

◆ state()

TorrentClient::State TorrentClient::state ( ) const

Definition at line 402 of file torrentclient.cpp.

◆ stateChanged

void TorrentClient::stateChanged ( TorrentClient::State  state)
signal

◆ stateString()

QString TorrentClient::stateString ( ) const

Definition at line 407 of file torrentclient.cpp.

◆ stop

void TorrentClient::stop ( )
slot

Definition at line 448 of file torrentclient.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopped

void TorrentClient::stopped ( )
signal
Here is the caller graph for this function:

◆ timerEvent

void TorrentClient::timerEvent ( QTimerEvent event)
overrideprotectedslot

Definition at line 504 of file torrentclient.cpp.

Here is the call graph for this function:

◆ uploadedBytes()

qint64 TorrentClient::uploadedBytes ( ) const

Definition at line 377 of file torrentclient.cpp.

◆ uploadRateUpdated

void TorrentClient::uploadRateUpdated ( int  bytesPerSecond)
signal

Friends And Related Function Documentation

◆ TorrentClientPrivate

friend class TorrentClientPrivate
friend

Definition at line 210 of file torrentclient.h.


The documentation for this class was generated from the following files: