本文整理汇总了C++中Course::foreignId方法的典型用法代码示例。如果您正苦于以下问题:C++ Course::foreignId方法的具体用法?C++ Course::foreignId怎么用?C++ Course::foreignId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Course
的用法示例。
在下文中一共展示了Course::foreignId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setSkeleton
void EditorSession::setSkeleton(Skeleton *skeleton)
{
if (m_skeleton == skeleton) {
return;
}
m_skeleton = skeleton;
Language *language = m_language;
if (!m_language) {
language = m_resourceManager->languageResources().first()->language();
}
if (m_skeleton) {
bool found = false;
int resources = m_resourceManager->courseResources(language).count();
for (int i=0; i < resources; ++i) {
Course * course = m_resourceManager->course(language, i);
if (course->foreignId() == m_skeleton->id()) {
setCourse(course);
found = true;
break;
}
}
if (!found) {
setCourse(nullptr);
}
}
emit skeletonChanged();
}
示例2: setLanguage
void EditorSession::setLanguage(Language *language)
{
if (m_language == language) {
return;
}
m_language = language;
if (m_skeletonMode) {
bool found = false;
if (m_skeleton) {
int resources = m_resourceManager->courseResources(m_language).count();
for (int i=0; i < resources; ++i) {
Course * course = m_resourceManager->course(m_language, i);
if (course->foreignId() == m_skeleton->id()) {
setCourse(course);
found = true;
break;
}
}
}
if (!found) {
setCourse(nullptr);
}
}
else { // not skeleton mode
if (m_resourceManager->courseResources(m_language).count() > 0) {
setCourse(m_resourceManager->course(m_language, 0));
}
}
emit languageChanged();
}