Skip to content

Create custom themes for qBittorrent

Prince Gupta edited this page May 13, 2020 · 18 revisions

Introduction

This page contains the necessary information to get started developing custom themes for qBittorrent. They are supported since version 4.2.2.

What are .qbttheme files?

These are theme bundles for qBittorrent. They should contain all files required to support theming in qBittorrent and are packed using Qt's Resource Compiler. qBittorrent accesses files inside .qbttheme using Qt's Resource System. Currently, qBittorrent only searches for a stylesheet.qss and config.json inside a .qbttheme file but you can also add your own custom resources (read more here).

How to create your own theme bundles?

You can check out this Python script(here) for the easy creation of .qbttheme files.

At runtime, qBittorrent loads only stylesheet.qss to support theming and config.json which currently only manages GUI colors. You can include custom resources with your bundle files to use it with stylesheet.qss

Managing overall feel of GUI

stylesheet.qss is a Qt stylesheet, which is basically custom CSS for Qt. You can read more about Qt stylesheet syntax here. A reference is also available here.

Changing QBittorrent specific colors

for changing qBittorrent specific GUI colors, you have to use config.json, NOTE: A large part of colors is already changeable from stylesheet but following are QBitTorrent's specific context-sensitive colors,
The following are all keys that are currently supported.

{
    "colors": {
        "Palette.Window": "<color>",
        "Palette.WindowText": "<color>",
        "Palette.Base": "<color>",
        "Palette.AlternateBase": "<color>",
        "Palette.Text": "<color>",
        "Palette.ToolTipBase": "<color>",
        "Palette.ToolTipText": "<color>",
        "Palette.BrightText": "<color>",
        "Palette.Highlight": "<color>",
        "Palette.HighlightedText": "<color>",
        "Palette.Button": "<color>",
        "Palette.ButtonText": "<color>",
        "Palette.Link": "<color>",
        "Palette.LinkVisited": "<color>",
        "Palette.Light": "<color>",
        "Palette.Midlight": "<color>",
        "Palette.Mid": "<color>",
        "Palette.Dark": "<color>",
        "Palette.Shadow": "<color>",
        "Palette.WindowTextDisabled": "<color>",
        "Palette.TextDisabled": "<color>",
        "Palette.ToolTipTextDisabled": "<color>",
        "Palette.BrightTextDisabled": "<color>",
        "Palette.HighlightedTextDisabled": "<color>",
        "Palette.ButtonTextDisabled": "<color>",
        
        "Log.Time": "<color>",
        "Log.Normal": "<color>",
        "Log.Info": "<color>",
        "Log.Warning": "<color>",
        "Log.Critical": "<color>",
        "Log.BannedPeer": "<color>",
        
        "TransferList.Downloading": "<color>",
        "TransferList.StalledDownloading": "<color>",
        "TransferList.DownloadingMetadata": "<color>",
        "TransferList.ForcedDownloading": "<color>",
        "TransferList.Allocating": "<color>",
        "TransferList.Uploading": "<color>",
        "TransferList.StalledUploading": "<color>",
        "TransferList.ForcedUploading": "<color>",
        "TransferList.QueuedDownloading": "<color>",
        "TransferList.QueuedUploading": "<color>",
        "TransferList.CheckingDownloading": "<color>",
        "TransferList.CheckingUploading": "<color>",
        "TransferList.CheckingResumeData": "<color>",
        "TransferList.PausedDownloading": "<color>",
        "TransferList.PausedUploading": "<color>",
        "TransferList.Moving": "<color>",
        "TransferList.MissingFiles": "<color>",
        "TransferList.Error": "<color>"     
    }
}

Here

  1. Palette referes to QPalette, and following string(after .) denotes Color roles
  2. Log refers to log messages and following string (after .) denotes type of messages
  3. Transfer List refers to view containing all of your torrents and following string(after .) denotes torrent state on which based on which row colors would be decided.

<color> value supports normal rgb values(#rrggbb) or svg color names, basically it follows Qt's named color convention convention

Using custom resources with bundles

qBittorrent uses QResources::registerResource to use the bundle file, you can imagine it like QBittorrent extracts bundle file in a special path which is :/uitheme, so every file should be referenced accordingly f.e let's see we have to change the image QRadiaButtons indicator, so to reference a light/radio_button.svg inside our bundle file, we should do something like this

QRadioButton::indicator:unchecked,
QRadioButton::indicator:unchecked:focus
{
    image: url(:/uitheme/light/radio_button.svg);
}

reserved files and their structure in bundle files are - stylesheet.qss and config.json both should occur at the root of your bundle file.

Notes

Following way of changing TransferList row's color is removed after version 4.2.5, please change you bundle files accordingly and For changing Transferlist row's color one should use config.json

TransferListWidget 
{
  qproperty-downloadingStateForeground: limegreen;
  qproperty-forcedDownloadingStateForeground: limegreen;
  qproperty-downloadingMetadataStateForeground: limegreen;
  qproperty-allocatingStateForeground: #cccccc;
  qproperty-stalledDownloadingStateForeground: #cccccc;
  qproperty-stalledUploadingStateForeground: #cccccc;
  qproperty-uploadingStateForeground: #63b8ff;
  qproperty-forcedUploadingStateForeground: #63b8ff;
  qproperty-pausedDownloadingStateForeground: #fa8090;
  qproperty-pausedUploadingStateForeground: #4f94cd;
  qproperty-errorStateForeground: red;
  qproperty-missingFilesStateForeground: red;
  qproperty-queuedDownloadingStateForeground: #00cdcd;
  qproperty-queuedUploadingStateForeground: #00cdcd;
  qproperty-checkingDownloadingStateForeground: #00cdcd;
  qproperty-checkingUploadingStateForeground: #00cdcd;
  qproperty-checkingResumeDataStateForeground: #00cdcd;
  qproperty-movingStateForeground: #00cdcd;
  qproperty-unknownStateForeground: red; 
}

General

Troubleshooting

External programs

Search plugins

Themes

Translation


WebUI

WebUI API

State Version
Current qBittorrent >= 5.0
Previous qBittorrent v4.1.0 - v4.6.x
Previous qBittorrent v3.2.0 - v4.0.x
Obsolete qBittorrent < v3.2.0

Authentication

WebAPI clients

Alternate WebUI

Reverse proxy setup for WebUI access

WebUI HTTPS configuration


Linux


Development

Compilation

Common information for CMake

*BSD, Linux

macOS

Windows

Obsolete compilation guides

Clone this wiki locally