qml: dynamically populate the toolbar editor
commit53e11113ae6020a6fb78f84dabcfe2815ac6b196
authorFatih Uzunoglu <fuzun54@outlook.com>
Thu, 1 Apr 2021 22:22:36 +0000 (2 01:22 +0300)
committerPierre Lamot <pierre@videolabs.io>
Tue, 6 Apr 2021 09:54:15 +0000 (6 11:54 +0200)
tree88f66c91f94319afb465b8bcef2868af8c6af677
parent20725496ae914d9a11372020dc58b1d2e0f9a367
qml: dynamically populate the toolbar editor

Thanks to MOC, the PlayerIdentifier enum is iteratively
converted to a JavaScript object and passed to the QML-side
through the singleton type "PlayerlistModel" which is
registered with qmlRegisterSingletonType in mainui.cpp.
The new toolbar editor handles the returned object as
 a model and dynamically populates itself per player.

If there is a need to add a new player, just
add a new entry to the PlayerIdentifier enum and
set its identifier accordingly. With the new
approach the new player will automatically
appear in the toolbar editor.

Signed-off-by: Pierre Lamot <pierre@videolabs.io>
modules/gui/qt/dialogs/toolbar/qml/EditorTabButton.qml
modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml