A Qt6 wrapper library for libtorrent-rasterbar providing a clean, signal/slot-based API for BitTorrent operations.
Core Classes
| Class | Description |
| TorrentClient | Session manager: add/remove torrents, bandwidth and connection limits, proxy, encryption, DHT/LSD, IP filtering, resume data persistence |
| Torrent | Single torrent handle: control, progress, file management, peer info, tracker management, per-torrent options |
| TorrentCreator | Create .torrent metainfo files from local content |
| TorrentSearcher | Asynchronous torrent search against public APIs |
| MagnetLink | Parse and construct magnet URIs (hex and Base32 info hashes) |
Value Classes
| Class | Description |
| SessionStats | Aggregate session statistics snapshot (transfer totals, rates, DHT nodes) |
| PeerInfo | Connected peer snapshot (address, client, rates, progress, flags) |
| TorrentSearchResult | Search result metadata (name, size, seeders, leechers) |
Quick Start
#include <Kanoop/torrent/torrentclient.h>
#include <Kanoop/torrent/magnetlink.h>
client->setDefaultDownloadDirectory("/tmp/downloads");
client->setResumeDataDirectory("/tmp/resume");
client->setDownloadRateLimit(5 * 1024 * 1024);
client->loadResumeData();
Torrent* t = client->addTorrent(link);
qDebug() << "Progress:" << int(ratio * 100) << "%";
});
qDebug() << "Done!";
});
Parses and constructs BitTorrent magnet URIs.
Qt wrapper around a libtorrent session.
Represents a single torrent within a TorrentClient session.
void downloadComplete()
Emitted once when the entire torrent download completes.
void progressUpdated(double ratio)
Emitted periodically during download with the current progress ratio (0.0–1.0).
void setSequentialDownload(bool enabled)
Enable or disable sequential piece downloading.
Creating Torrents
#include <Kanoop/torrent/torrentcreator.h>
creator.
setTrackers({
"udp://tracker.example.com:6969/announce"});
if (creator.
create(
"/path/to/content",
"/tmp/output.torrent")) {
}
Creates .torrent metainfo files from local content.
int pieceCount() const
Number of pieces in the torrent.
void setPrivate(bool enabled)
Mark the torrent as private (BEP 27).
bool create(const QString &sourcePath, const QString &outputPath)
Create a .torrent file from local content.
void setComment(const QString &value)
Set the comment embedded in the torrent metainfo.
int fileCount() const
Number of files in the torrent.
void setTrackers(const QStringList &urls)
Set tracker announce URLs.
Links