Skip to content

qt: let users use external QML files for player tool bar controls

Fatih Uzunoğlu requested to merge fuzun/vlc:qt/externalwidgets into master

If we are paying the price of using the QML engine, we might as well provide ability to use external QML files.

This allows having external controls for the player without manually adding the control and building the application.

Once the tool bar editor dialog opens, the following directory and file is created if the directory does not exist:

  • AppConfigLocation + /qt-external-controls.
  • AppConfigLocation + /qt-external-controls/README.txt.

The contents of the readme file is:

You may place external controls in this directory. The control file name must be <id>-<name>.qml, where <id> is an arbitrary integer between 0 and 800, and <name> is the name of the control. An example control is available below:

import QtQuick

import VLC.Widgets as Widgets
import VLC.Style
import VLC.Player
import VLC.Playlist

Widgets.IconToolButton {
   id: stopBtn
   enabled: Player.isStarted
   text: VLCIcons.stop
   onClicked: MainPlaylistController.stop()
   description: qsTr("Stop") 
}

Request review @chub.

Merge request reports

Loading