|
|
void | stateChanged (Torrent::State state) |
| | Emitted when the torrent transitions to a new State.
|
| |
|
void | progressUpdated (double ratio) |
| | Emitted periodically during download with the current progress ratio (0.0–1.0).
|
| |
|
void | fileCompleted (int fileIndex, const QString &filePath) |
| | Emitted when an individual file finishes downloading.
|
| |
|
void | downloadComplete () |
| | Emitted once when the entire torrent download completes.
|
| |
|
void | metadataReceived () |
| | Emitted when metadata is received (magnet links only).
|
| |
|
void | error (const QString &message) |
| | Emitted on torrent errors (tracker failures, I/O errors, etc.).
|
| |
|
void | trackerAnnounced (const QString &url) |
| | Emitted when a tracker announce succeeds.
|
| |
|
void | trackerError (const QString &url, const QString &message) |
| | Emitted when a tracker announce fails.
|
| |
|
void | storageMoved (const QString &newPath) |
| | Emitted when moveStorage() completes successfully.
|
| |
|
void | storageMoveError (const QString &error) |
| | Emitted when moveStorage() fails.
|
| |
|
void | fileRenamed (int fileIndex, const QString &newName) |
| | Emitted when renameFile() completes successfully.
|
| |
|
void | fileRenameError (int fileIndex, const QString &error) |
| | Emitted when renameFile() fails.
|
| |
|
|
| Torrent (QObject *parent=nullptr) |
| |
|
void | start () |
| | Resume downloading/seeding.
|
| |
|
void | stop () |
| | Stop the torrent and reset state to Idle.
|
| |
|
void | pause () |
| | Pause the torrent, keeping its state recoverable via resume().
|
| |
|
void | resume () |
| | Resume a paused torrent.
|
| |
| State | state () const |
| | Current lifecycle state.
|
| |
| QString | name () const |
| | Human-readable torrent name.
|
| |
| QByteArray | infoHash () const |
| | Raw 20-byte SHA-1 info hash.
|
| |
| QString | infoHashHex () const |
| | Info hash as a lowercase hex string (40 characters).
|
| |
|
double | progress () const |
| | Download progress as a ratio from 0.0 to 1.0.
|
| |
|
qint64 | bytesDownloaded () const |
| | Total bytes downloaded so far.
|
| |
|
qint64 | totalSize () const |
| | Total size of all selected files in bytes.
|
| |
|
int | connectedPeers () const |
| | Number of currently connected peers.
|
| |
|
qint64 | downloadRate () const |
| | Current download rate in bytes/sec.
|
| |
|
qint64 | uploadRate () const |
| | Current upload rate in bytes/sec.
|
| |
|
qint64 | totalUploaded () const |
| | Total bytes uploaded over the lifetime of this torrent.
|
| |
| double | ratio () const |
| | Share ratio (uploaded / downloaded).
|
| |
| int | totalPieces () const |
| | Total number of pieces in this torrent.
|
| |
|
int | downloadedPieces () const |
| | Number of pieces that have been downloaded and verified.
|
| |
| int | pieceSize () const |
| | Size of each piece in bytes.
|
| |
| int | eta () const |
| | Estimated seconds remaining until download completes.
|
| |
| bool | hasMetadata () const |
| | Whether torrent metadata has been received.
|
| |
| int | fileCount () const |
| | Number of files in the torrent.
|
| |
| QString | fileName (int index) const |
| | Relative path of a file within the torrent.
|
| |
|
QStringList | fileNames () const |
| | List of all file paths in the torrent.
|
| |
| qint64 | fileSize (int index) const |
| | Size of a file in bytes.
|
| |
| void | setFilePriority (int index, int priority) |
| | Set the download priority for a single file.
|
| |
| void | setAllFilePriorities (int priority) |
| | Set the same download priority for every file.
|
| |
| int | findFileByName (const QString &partialName) const |
| | Find a file by partial name (case-insensitive substring match).
|
| |
| int | filePriority (int index) const |
| | Get the current download priority for a file.
|
| |
| QList< qint64 > | fileProgress () const |
| | Get per-file download progress as a list of byte counts.
|
| |
| void | renameFile (int index, const QString &newName) |
| | Rename a file within the torrent.
|
| |
| QString | downloadDirectory () const |
| | The directory where this torrent's data is being saved.
|
| |
| QString | outputPath () const |
| | Full output path (save_path + torrent name).
|
| |
| void | moveStorage (const QString &newPath) |
| | Move the torrent's data to a new directory.
|
| |
|
bool | isSequentialDownload () const |
| | Whether pieces are requested in sequential order.
|
| |
| void | setSequentialDownload (bool enabled) |
| | Enable or disable sequential piece downloading.
|
| |
|
bool | isAutoManaged () const |
| | Whether libtorrent auto-manages this torrent's queue position.
|
| |
|
void | setAutoManaged (bool enabled) |
| | Enable or disable libtorrent's auto-managed mode.
|
| |
| int | downloadLimit () const |
| | Per-torrent download rate limit in bytes/sec.
|
| |
| void | setDownloadLimit (int bytesPerSecond) |
| | Set the per-torrent download rate limit.
|
| |
| int | uploadLimit () const |
| | Per-torrent upload rate limit in bytes/sec.
|
| |
| void | setUploadLimit (int bytesPerSecond) |
| | Set the per-torrent upload rate limit.
|
| |
|
int | maxConnections () const |
| | Maximum number of peer connections for this torrent.
|
| |
|
void | setMaxConnections (int value) |
| | Set the maximum peer connections for this torrent.
|
| |
|
int | maxUploads () const |
| | Maximum number of upload slots for this torrent.
|
| |
|
void | setMaxUploads (int value) |
| | Set the maximum upload slots for this torrent.
|
| |
| double | seedRatioLimit () const |
| | Target share ratio after which the torrent is auto-paused.
|
| |
| void | setSeedRatioLimit (double ratio) |
| | Set a share-ratio target; the torrent pauses when it is reached.
|
| |
|
QStringList | trackers () const |
| | List of tracker URLs currently attached to this torrent.
|
| |
| void | addTracker (const QString &url) |
| | Append a tracker URL.
|
| |
| void | removeTracker (const QString &url) |
| | Remove a tracker by URL.
|
| |
|
void | forceReannounce () |
| | Force an immediate re-announce to all trackers.
|
| |
| QList< PeerInfo > | peers () const |
| | Snapshot of all currently connected peers.
|
| |
| void | banPeer (const QHostAddress &address) |
| | Ban a peer by IP address.
|
| |
| void | saveResumeData () |
| | Request an asynchronous resume-data save.
|
| |
|
void | setHandle (void *handle) |
| |
| void * | handle () const |
| |
| void | setMagnetLink (const MagnetLink &link) |
| |
| void | setInfoHash (const QByteArray &hash) |
| |
| void | setDownloadDirectory (const QString &dir) |
| |
|
void | updateFromStatus () |
| |
|
void | checkSeedRatio () |
| |
Represents a single torrent within a TorrentClient session.
Torrent objects are created by TorrentClient::addTorrent() and provide a Qt-friendly interface over a libtorrent torrent handle. All state updates are driven by TorrentClient::processAlerts() and delivered as Qt signals.
- Note
- Do not construct Torrent objects directly; use TorrentClient::addTorrent().
Definition at line 20 of file torrent.h.