本文整理汇总了C++中OBSBasic::OpenSavedProjectors方法的典型用法代码示例。如果您正苦于以下问题:C++ OBSBasic::OpenSavedProjectors方法的具体用法?C++ OBSBasic::OpenSavedProjectors怎么用?C++ OBSBasic::OpenSavedProjectors使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OBSBasic
的用法示例。
在下文中一共展示了OBSBasic::OpenSavedProjectors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RefreshSceneCollections
void OBSBasic::RefreshSceneCollections()
{
QList<QAction*> menuActions = ui->sceneCollectionMenu->actions();
int count = 0;
for (int i = 0; i < menuActions.count(); i++) {
QVariant v = menuActions[i]->property("file_name");
if (v.typeName() != nullptr)
delete menuActions[i];
}
const char *cur_name = config_get_string(App()->GlobalConfig(),
"Basic", "SceneCollection");
auto addCollection = [&](const char *name, const char *path)
{
std::string file = strrchr(path, '/') + 1;
file.erase(file.size() - 5, 5);
QAction *action = new QAction(QT_UTF8(name), this);
action->setProperty("file_name", QT_UTF8(path));
connect(action, &QAction::triggered,
this, &OBSBasic::ChangeSceneCollection);
action->setCheckable(true);
action->setChecked(strcmp(name, cur_name) == 0);
ui->sceneCollectionMenu->addAction(action);
count++;
return true;
};
EnumSceneCollections(addCollection);
/* force saving of first scene collection on first run, otherwise
* no scene collections will show up */
if (!count) {
long prevDisableVal = disableSaving;
disableSaving = 0;
SaveProjectNow();
disableSaving = prevDisableVal;
EnumSceneCollections(addCollection);
}
ui->actionRemoveSceneCollection->setEnabled(count > 1);
OBSBasic *main = reinterpret_cast<OBSBasic*>(App()->GetMainWindow());
main->OpenSavedProjectors();
main->ui->actionPasteFilters->setEnabled(false);
main->ui->actionPasteRef->setEnabled(false);
main->ui->actionPasteDup->setEnabled(false);
}