mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-31 05:35:36 -05:00
Set "select <xyz>" to disabled and sort selection alphabetically
This commit is contained in:
@@ -1,9 +1,20 @@
|
||||
#include "headers/macro-selection.hpp"
|
||||
#include "headers/advanced-scene-switcher.hpp"
|
||||
|
||||
#include <QStandardItemModel>
|
||||
|
||||
MacroSelection::MacroSelection(QWidget *parent) : QComboBox(parent)
|
||||
{
|
||||
addItem(obs_module_text("AdvSceneSwitcher.selectMacro"));
|
||||
|
||||
QStandardItemModel *model =
|
||||
qobject_cast<QStandardItemModel *>(this->model());
|
||||
QModelIndex firstIndex =
|
||||
model->index(0, modelColumn(), rootModelIndex());
|
||||
QStandardItem *firstItem = model->itemFromIndex(firstIndex);
|
||||
firstItem->setSelectable(false);
|
||||
firstItem->setEnabled(false);
|
||||
|
||||
for (auto &m : switcher->macros) {
|
||||
addItem(QString::fromStdString(m.Name()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user