本文整理汇总了C++中ThemeInfo::ToMap方法的典型用法代码示例。如果您正苦于以下问题:C++ ThemeInfo::ToMap方法的具体用法?C++ ThemeInfo::ToMap怎么用?C++ ThemeInfo::ToMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThemeInfo
的用法示例。
在下文中一共展示了ThemeInfo::ToMap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: itemChanged
void ThemeChooser::itemChanged(MythUIButtonListItem *item)
{
ThemeInfo *info = qVariantValue<ThemeInfo*>(item->GetData());
if (!info)
return;
QFileInfo preview(info->GetPreviewPath());
QHash<QString, QString> infomap;
info->ToMap(infomap);
SetTextFromMap(infomap);
if (m_preview)
{
if (preview.exists())
{
m_preview->SetFilename(info->GetPreviewPath());
m_preview->Load();
}
else
m_preview->Reset();
}
if (m_fullPreviewShowing && m_fullPreviewStateType)
{
if (m_fullScreenPreview)
{
if (preview.exists())
{
m_fullScreenPreview->SetFilename(info->GetPreviewPath());
m_fullScreenPreview->Load();
}
else
m_fullScreenPreview->Reset();
}
if (m_fullScreenName)
m_fullScreenName->SetText(info->GetName());
}
MythUIStateType *themeLocation =
dynamic_cast<MythUIStateType*>(GetChild("themelocation"));
if (themeLocation)
{
if (info->GetDownloadURL().isEmpty())
themeLocation->DisplayState("local");
else
themeLocation->DisplayState("remote");
}
MythUIStateType *aspectState =
dynamic_cast<MythUIStateType*>(GetChild("aspectstate"));
if (aspectState)
aspectState->DisplayState(info->GetAspect());
}
示例2: Init
void ThemeChooser::Init(void)
{
QString curTheme = gCoreContext->GetSetting("Theme");
ThemeInfo *themeinfo = NULL;
ThemeInfo *curThemeInfo = NULL;
MythUIButtonListItem *item = NULL;
m_themes->Reset();
for( QFileInfoList::iterator it = m_infoList.begin();
it != m_infoList.end();
++it )
{
QFileInfo &theme = *it;
if (!m_themeFileNameInfos.contains(theme.filePath()))
continue;
themeinfo = m_themeFileNameInfos[theme.filePath()];
if (!themeinfo)
continue;
QString buttonText = QString("%1 %2.%3")
.arg(themeinfo->GetName())
.arg(themeinfo->GetMajorVersion())
.arg(themeinfo->GetMinorVersion());
item = new MythUIButtonListItem(m_themes, buttonText);
if (item)
{
if (themeinfo->GetDownloadURL().isEmpty())
item->DisplayState("local", "themelocation");
else
item->DisplayState("remote", "themelocation");
item->DisplayState(themeinfo->GetAspect(), "aspectstate");
item->DisplayState(m_themeStatuses[themeinfo->GetName()],
"themestatus");
QHash<QString, QString> infomap;
themeinfo->ToMap(infomap);
item->SetTextFromMap(infomap);
item->SetData(qVariantFromValue(themeinfo));
QString thumbnail = themeinfo->GetPreviewPath();
QFileInfo fInfo(thumbnail);
// Downloadable themeinfos have thumbnail copies of their preview images
if (!themeinfo->GetDownloadURL().isEmpty())
thumbnail = thumbnail.append(".thumb.jpg");
item->SetImage(thumbnail);
if (curTheme == themeinfo->GetDirectoryName())
curThemeInfo = themeinfo;
}
else
delete item;
}
SetFocusWidget(m_themes);
if (curThemeInfo)
m_themes->SetValueByData(qVariantFromValue(curThemeInfo));
MythUIButtonListItem *current = m_themes->GetItemCurrent();
if (current)
itemChanged(current);
}