本文整理汇总了C++中MythUIButtonListItem::SetImage方法的典型用法代码示例。如果您正苦于以下问题:C++ MythUIButtonListItem::SetImage方法的具体用法?C++ MythUIButtonListItem::SetImage怎么用?C++ MythUIButtonListItem::SetImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythUIButtonListItem
的用法示例。
在下文中一共展示了MythUIButtonListItem::SetImage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateThumbnail
/** \fn GalleryView::UpdateThumbnail(ImageMetadata *, int)
* \brief Updates the thumbnail image of an image or
* folder which contains the given image metadata
* \param item The item that shall be updated
* \param id The thumbnail id that shall be used,
* there are 4 ids when the item is a folder
* \return void
*/
void GalleryView::UpdateThumbnail(ImageMetadata *thumbImageMetadata, int id)
{
// get through the entire list of image items and find
// the filename that matches the created thumbnail filename
for (int i = 0; i < m_imageList->GetCount(); i++)
{
MythUIButtonListItem *item = m_imageList->GetItemAt(i);
if (!item)
continue;
ImageMetadata *im = GetImageMetadataFromButton(item);
if (!im)
continue;
// Set the thumbnail image if the thumbnail
// image names at the given index are the same
if (thumbImageMetadata->m_thumbFileNameList->at(id).compare(
im->m_thumbFileNameList->at(id)) == 0)
{
// Set the images for the four thumbnail image widgets in case
// the node is a folder. Otherwise set the buttonimage widget.
if (im->m_type == kUpDirectory ||
im->m_type == kSubDirectory)
{
item->SetImage(thumbImageMetadata->m_thumbFileNameList->at(id),
QString("thumbimage%1").arg(id+1), true);
}
else
{
item->SetImage(thumbImageMetadata->m_thumbFileNameList->at(0), "", true);
}
break;
}
}
}
示例2: updateList
void ChannelRecPriority::updateList()
{
m_channelList->Reset();
QMap<QString, ChannelInfo*>::Iterator it;
MythUIButtonListItem *item;
for (it = m_sortedChannel.begin(); it != m_sortedChannel.end(); ++it)
{
ChannelInfo *chanInfo = *it;
item = new MythUIButtonListItem(m_channelList, "",
qVariantFromValue(chanInfo));
QString fontState = "default";
if (!m_visMap[chanInfo->chanid])
fontState = "disabled";
QString stringFormat = item->GetText();
if (stringFormat.isEmpty())
stringFormat = "<num> <sign> \"<name>\"";
item->SetText(chanInfo->GetFormatted(stringFormat), fontState);
item->SetText(chanInfo->chanstr, "channum", fontState);
item->SetText(chanInfo->callsign, "callsign", fontState);
item->SetText(chanInfo->channame, "name", fontState);
item->SetText(QString().setNum(chanInfo->sourceid), "sourceid",
fontState);
item->SetText(chanInfo->sourcename, "sourcename", fontState);
if (m_visMap[chanInfo->chanid])
item->DisplayState("normal", "status");
else
item->DisplayState("disabled", "status");
item->SetImage(chanInfo->iconpath, "icon");
item->SetImage(chanInfo->iconpath);
item->SetText(chanInfo->recpriority, "priority", fontState);
if (m_currentItem == chanInfo)
m_channelList->SetItemCurrent(item);
}
MythUIText *norecordingText = dynamic_cast<MythUIText*>
(GetChild("norecordings_info"));
if (norecordingText)
norecordingText->SetVisible(m_channelData.isEmpty());
}
示例3: fillGrabberButtonList
void SearchEditor::fillGrabberButtonList()
{
for (GrabberScript::scriptList::iterator i = m_grabberList.begin();
i != m_grabberList.end(); ++i)
{
MythUIButtonListItem *item =
new MythUIButtonListItem(m_grabbers, (*i)->GetTitle());
if (item)
{
item->SetText((*i)->GetTitle(), "title");
item->SetData(qVariantFromValue(*i));
QString img = (*i)->GetImage();
QString thumb;
if (!img.startsWith("/") && !img.isEmpty())
thumb = QString("%1mythnetvision/icons/%2").arg(GetShareDir())
.arg((*i)->GetImage());
else
thumb = img;
item->SetImage(thumb);
item->setCheckable(true);
item->setChecked(MythUIButtonListItem::NotChecked);
QFileInfo fi((*i)->GetCommandline());
if (findSearchGrabberInDB(fi.fileName(), VIDEO))
item->setChecked(MythUIButtonListItem::FullChecked);
}
else
delete item;
}
}
示例4: customEvent
void NetSearch::customEvent(QEvent *event)
{
if (event->type() == ThumbnailDLEvent::kEventType)
{
ThumbnailDLEvent *tde = (ThumbnailDLEvent *)event;
ThumbnailData *data = tde->thumb;
if (!data)
return;
QString title = data->title;
QString file = data->url;
uint pos = qVariantValue<uint>(data->data);
if (file.isEmpty() || !((uint)m_searchResultList->GetCount() >= pos))
return;
MythUIButtonListItem *item = m_searchResultList->GetItemAt(pos);
if (!item)
return;
if (item->GetText() == title)
item->SetImage(file);
if (m_searchResultList->GetItemCurrent() == item)
SetThumbnail(item);
}
else
NetBase::customEvent(event);
}
示例5: PopulateResultList
void NetSearch::PopulateResultList(ResultItem::resultList list)
{
for (ResultItem::resultList::iterator i = list.begin();
i != list.end(); ++i)
{
QString title = (*i)->GetTitle();
MythUIButtonListItem *item =
new MythUIButtonListItem(m_searchResultList, title,
qVariantFromValue(*i));
InfoMap metadataMap;
(*i)->toMap(metadataMap);
item->SetTextFromMap(metadataMap);
if (!(*i)->GetThumbnail().isEmpty())
{
QString dlfile = (*i)->GetThumbnail();
if (dlfile.contains("%SHAREDIR%"))
{
dlfile.replace("%SHAREDIR%", GetShareDir());
item->SetImage(dlfile);
}
else
{
uint pos = m_searchResultList->GetItemPos(item);
m_imageDownload->addThumb((*i)->GetTitle(),
(*i)->GetThumbnail(),
qVariantFromValue<uint>(pos));
}
}
}
}
示例6: updateThumb
void ThumbFinder::updateThumb(void)
{
int itemNo = m_imageGrid->GetCurrentPos();
MythUIButtonListItem *item = m_imageGrid->GetItemCurrent();
ThumbImage *thumb = m_thumbList.at(itemNo);
if (!thumb)
return;
// copy current frame image to the selected thumb image
QString imageFile = thumb->filename;
QFile dst(imageFile);
QFile src(m_frameFile);
copy(dst, src);
item->SetImage(imageFile, "", true);
// update the image grid item
int64_t pos = (int) ((m_currentPTS - m_startPTS) / m_frameTime);
thumb->frame = pos - m_offset;
if (itemNo != 0)
{
thumb->caption = frameToTime(thumb->frame);
item->SetText(thumb->caption);
}
m_imageGrid->SetRedraw();
}
示例7: customEvent
void MetadataResultsDialog::customEvent(QEvent *event)
{
if (event->type() == ThumbnailDLEvent::kEventType)
{
ThumbnailDLEvent *tde = (ThumbnailDLEvent *)event;
ThumbnailData *data = tde->thumb;
QString file = data->url;
uint pos = data->data.value<uint>();
if (file.isEmpty())
return;
if (!((uint)m_resultsList->GetCount() >= pos))
return;
MythUIButtonListItem *item =
m_resultsList->GetItemAt(pos);
if (item)
{
item->SetImage(file);
}
}
}
示例8: updateList
void ChannelRecPriority::updateList()
{
m_channelList->Reset();
QMap<QString, ChannelInfo*>::Iterator it;
for (it = m_sortedChannel.begin(); it != m_sortedChannel.end(); ++it)
{
ChannelInfo *chanInfo = *it;
MythUIButtonListItem *item =
new MythUIButtonListItem(m_channelList, "",
qVariantFromValue(chanInfo));
QString fontState = "default";
item->SetText(chanInfo->GetFormatted(ChannelInfo::kChannelLong),
fontState);
InfoMap infomap;
chanInfo->ToMap(infomap);
item->SetTextFromMap(infomap, fontState);
item->DisplayState("normal", "status");
if (!chanInfo->icon.isEmpty())
{
QString iconUrl = gCoreContext->GetMasterHostPrefix("ChannelIcons",
chanInfo->icon);
item->SetImage(iconUrl, "icon");
item->SetImage(iconUrl);
}
item->SetText(QString::number(chanInfo->recpriority), "priority", fontState);
if (m_currentItem == chanInfo)
m_channelList->SetItemCurrent(item);
}
// this textarea name is depreciated use 'nochannels_warning' instead
MythUIText *noChannelsText = dynamic_cast<MythUIText*>(GetChild("norecordings_info"));
if (!noChannelsText)
noChannelsText = dynamic_cast<MythUIText*>(GetChild("nochannels_warning"));
if (noChannelsText)
noChannelsText->SetVisible(m_channelData.isEmpty());
}
示例9: updateList
void ChannelRecPriority::updateList()
{
m_channelList->Reset();
QMap<QString, ChannelInfo*>::Iterator it;
MythUIButtonListItem *item;
for (it = m_sortedChannel.begin(); it != m_sortedChannel.end(); ++it)
{
ChannelInfo *chanInfo = *it;
item = new MythUIButtonListItem(m_channelList, "",
qVariantFromValue(chanInfo));
QString fontState = "default";
if (!m_visMap[chanInfo->chanid])
fontState = "disabled";
item->SetText(chanInfo->GetFormatted(ChannelInfo::kChannelLong),
fontState);
InfoMap infomap;
chanInfo->ToMap(infomap);
item->SetTextFromMap(infomap, fontState);
if (m_visMap[chanInfo->chanid])
item->DisplayState("normal", "status");
else
item->DisplayState("disabled", "status");
item->SetImage(chanInfo->iconpath, "icon");
item->SetImage(chanInfo->iconpath);
item->SetText(chanInfo->recpriority, "priority", fontState);
if (m_currentItem == chanInfo)
m_channelList->SetItemCurrent(item);
}
MythUIText *norecordingText = dynamic_cast<MythUIText*>
(GetChild("norecordings_info"));
if (norecordingText)
norecordingText->SetVisible(m_channelData.isEmpty());
}
示例10: customEvent
void NetSearch::customEvent(QEvent *event)
{
if (event->type() == MythEvent::MythEventMessage)
{
MythEvent *me = (MythEvent *)event;
if (me->Message().left(17) == "DOWNLOAD_COMPLETE")
{
QStringList tokens = me->Message()
.split(" ", QString::SkipEmptyParts);
if (tokens.size() != 2)
{
VERBOSE(VB_IMPORTANT, "Bad DOWNLOAD_COMPLETE message");
return;
}
GetMythMainWindow()->HandleMedia("Internal", tokens.takeAt(1));
}
}
else if (event->type() == ThumbnailDLEvent::kEventType)
{
ThumbnailDLEvent *tde = (ThumbnailDLEvent *)event;
if (!tde)
return;
ThumbnailData *data = tde->thumb;
if (!data)
return;
QString title = data->title;
QString file = data->url;
uint pos = qVariantValue<uint>(data->data);
if (file.isEmpty() || !((uint)m_searchResultList->GetCount() >= pos))
{
delete data;
return;
}
MythUIButtonListItem *item =
m_searchResultList->GetItemAt(pos);
if (item && item->GetText() == title)
{
item->SetImage(file);
}
delete data;
}
}
示例11: FillGrabberButtonList
void NetSearch::FillGrabberButtonList()
{
m_siteList->Reset();
for (GrabberScript::scriptList::iterator i = m_grabberList.begin();
i != m_grabberList.end(); ++i)
{
MythUIButtonListItem *item =
new MythUIButtonListItem(m_siteList, (*i)->GetTitle());
item->SetText((*i)->GetTitle(), "title");
item->SetData((*i)->GetCommandline());
QString thumb = QString("%1mythnetvision/icons/%2").arg(GetShareDir())
.arg((*i)->GetImage());
item->SetImage(thumb);
}
}
示例12: updateImageGrid
void EditAlbumartDialog::updateImageGrid(void)
{
AlbumArtList *albumArtList = m_albumArt->getImageList();
m_coverartList->Reset();
for (int x = 0; x < albumArtList->size(); x++)
{
MythUIButtonListItem *item =
new MythUIButtonListItem(m_coverartList,
AlbumArtImages::getTypeName(albumArtList->at(x)->imageType),
qVariantFromValue(albumArtList->at(x)));
item->SetImage(albumArtList->at(x)->filename);
QString state = albumArtList->at(x)->embedded ? "tag" : "file";
item->DisplayState(state, "locationstate");
}
}
示例13: eventChanged
void ZMEvents::eventChanged(MythUIButtonListItem *item)
{
(void) item;
if (m_eventNoText)
{
if (m_eventGrid->GetCount() > 0)
m_eventNoText->SetText(QString("%1/%2")
.arg(m_eventGrid->GetCurrentPos() + 1).arg(m_eventGrid->GetCount()));
else
m_eventNoText->SetText("0/0");
}
// update the images for all the visible items
for (int x = m_eventGrid->GetCurrentPos() - m_eventGrid->GetVisibleCount();
x < m_eventGrid->GetCurrentPos() + (int)m_eventGrid->GetVisibleCount(); x++)
{
if (x < 0 || x > (int)m_eventGrid->GetCount() - 1)
continue;
MythUIButtonListItem *gridItem = m_eventGrid->GetItemAt(x);
if (gridItem && !gridItem->HasImage())
{
if (x < 0 || x > (int)m_eventList->size() - 1)
continue;
Event *event = m_eventList->at(x);
if (event)
{
QImage image;
if (class ZMClient *zm = ZMClient::get())
{
zm->getAnalyseFrame(event, 0, image);
if (!image.isNull())
{
MythImage *mimage = GetMythPainter()->GetFormatImage();
mimage->Assign(image);
gridItem->SetImage(mimage);
mimage->SetChanged();
mimage->DecrRef();
}
}
}
}
}
}
示例14: fillRSSButtonList
void RSSEditor::fillRSSButtonList()
{
QMutexLocker locker(&m_lock);
m_sites->Reset();
for (RSSSite::rssList::iterator i = m_siteList.begin();
i != m_siteList.end(); ++i)
{
MythUIButtonListItem *item =
new MythUIButtonListItem(m_sites, (*i)->GetTitle());
item->SetText((*i)->GetTitle(), "title");
item->SetText((*i)->GetDescription(), "description");
item->SetText((*i)->GetURL(), "url");
item->SetText((*i)->GetAuthor(), "author");
item->SetData(qVariantFromValue(*i));
item->SetImage((*i)->GetImage());
}
}
示例15: Create
bool MetadataResultsDialog::Create()
{
if (!LoadWindowFromXML("base.xml", "MythMetadataResults", this))
return false;
bool err = false;
UIUtilE::Assign(this, m_resultsList, "results", &err);
if (err)
{
LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'MythMetadataResults'");
return false;
}
for (int i = 0;
i != m_results.count(); ++i)
{
MythUIButtonListItem *button =
new MythUIButtonListItem(m_resultsList,
m_results[i]->GetTitle());
InfoMap metadataMap;
m_results[i]->toMap(metadataMap);
QString coverartfile;
ArtworkList art = m_results[i]->GetArtwork(kArtworkCoverart);
if (art.count() > 0)
coverartfile = art.takeFirst().thumbnail;
if (coverartfile.isEmpty())
{
art = m_results[i]->GetArtwork(kArtworkBanner);
if (art.count() > 0)
coverartfile = art.takeFirst().thumbnail;
}
if (coverartfile.isEmpty())
{
art = m_results[i]->GetArtwork(kArtworkScreenshot);
if (art.count() > 0)
coverartfile = art.takeFirst().thumbnail;
}
QString dlfile = getDownloadFilename(m_results[i]->GetTitle(),
coverartfile);
if (!coverartfile.isEmpty())
{
int pos = m_resultsList->GetItemPos(button);
if (QFile::exists(dlfile))
button->SetImage(dlfile);
else
m_imageDownload->addThumb(m_results[i]->GetTitle(),
coverartfile,
qVariantFromValue<uint>(pos));
}
button->SetTextFromMap(metadataMap);
button->SetData(qVariantFromValue<uint>(i));
}
connect(m_resultsList, SIGNAL(itemClicked(MythUIButtonListItem *)),
SLOT(sendResult(MythUIButtonListItem *)));
BuildFocusList();
return true;
}