本文整理汇总了C++中Video::setWebpage方法的典型用法代码示例。如果您正苦于以下问题:C++ Video::setWebpage方法的具体用法?C++ Video::setWebpage怎么用?C++ Video::setWebpage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Video
的用法示例。
在下文中一共展示了Video::setWebpage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: retriveRealUrl
void VideoDetailsModel::retriveRealUrl()
{
Video *video = new Video;
QUrl videoUrl(m_videoUrl);
video->setWebpage(videoUrl);
video->loadStreamUrl();
connect(video, SIGNAL(gotStreamUrl(QUrl)), this, SLOT(streamUrl(QUrl)));
}
示例2: readEntry
void YTFeedReader::readEntry() {
Video* video = new Video();
while (!atEnd()) {
readNext();
/*
qDebug() << name();
QXmlStreamAttribute attribute;
foreach (attribute, attributes())
qDebug() << attribute.name() << ":" << attribute.value();
*/
if (isEndElement() && name() == QLatin1String("entry")) break;
if (isStartElement()) {
if (name() == QLatin1String("link")
&& attributes().value("rel").toString() == QLatin1String("alternate")
&& attributes().value("type").toString() == QLatin1String("text/html")
) {
QString webpage = attributes().value("href").toString();
webpage.remove("&feature=youtube_gdata");
video->setWebpage(webpage);
} else if (name() == QLatin1String("author")) {
while(readNextStartElement())
if (name() == QLatin1String("name")) {
QString author = readElementText();
video->setChannelTitle(author);
} else if (name() == QLatin1String("userId")) {
QString userId = readElementText();
video->setChannelId(userId);
} else skipCurrentElement();
} else if (name() == QLatin1String("published")) {
video->setPublished(QDateTime::fromString(readElementText(), Qt::ISODate));
} else if (namespaceUri() == QLatin1String("http://gdata.youtube.com/schemas/2007")
&& name() == QLatin1String("statistics")) {
QString viewCount = attributes().value("viewCount").toString();
video->setViewCount(viewCount.toInt());
}
else if (namespaceUri() == QLatin1String("http://search.yahoo.com/mrss/")
&& name() == QLatin1String("group")) {
// read media group
while (!atEnd()) {
readNext();
if (isEndElement() && name() == QLatin1String("group")) break;
if (isStartElement()) {
if (name() == QLatin1String("thumbnail")) {
// qDebug() << "Thumb: " << attributes().value("url").toString();
QStringRef name = attributes().value("yt:name");
if (name == QLatin1String("mqdefault"))
video->setThumbnailUrl(
attributes().value("url").toString());
else if (name == QLatin1String("hqdefault"))
video->setMediumThumbnailUrl(
attributes().value("url").toString());
}
else if (name() == QLatin1String("title")) {
QString title = readElementText();
// qDebug() << "Title: " << title;
video->setTitle(title);
}
else if (name() == QLatin1String("description")) {
QString desc = readElementText();
// qDebug() << "Description: " << desc;
video->setDescription(desc);
}
else if (name() == QLatin1String("duration")) {
QString duration = attributes().value("seconds").toString();
// qDebug() << "Duration: " << duration;
video->setDuration(duration.toInt());
}
else if (name() == QLatin1String("license")) {
QString license = readElementText();
// qDebug() << "License: " << license;
if (license == QLatin1String("cc"))
video->setLicense(Video::LicenseCC);
}
}
}
}
}
}
videos.append(video);
}
示例3: readEntry
void YouTubeStreamReader::readEntry() {
Video* video = new Video();
// qDebug(" *** ENTRY ***");
while (!atEnd()) {
readNext();
/*
qDebug() << name();
QXmlStreamAttribute attribute;
foreach (attribute, attributes())
qDebug() << attribute.name() << ":" << attribute.value();
*/
if (isEndElement() && name() == "entry") break;
if (isStartElement()) {
if (name() == "link"
&& attributes().value("rel").toString() == "alternate"
&& attributes().value("type").toString() == "text/html"
) {
QString webpage = attributes().value("href").toString();
webpage.remove("&feature=youtube_gdata");
// qDebug() << "Webpage: " << webpage;
video->setWebpage(QUrl(webpage));
} else if (name() == "author") {
readNext();
if (name() == "name") {
QString author = readElementText();
// qDebug() << "Author: " << author;
video->setAuthor(author);
}
} else if (name() == "published") {
video->setPublished(QDateTime::fromString(readElementText(), Qt::ISODate));
} else if (namespaceUri() == "http://gdata.youtube.com/schemas/2007" && name() == "statistics") {
QString viewCount = attributes().value("viewCount").toString();
// qDebug() << "viewCount: " << viewCount;
video->setViewCount(viewCount.toInt());
}
else if (namespaceUri() == "http://search.yahoo.com/mrss/" && name() == "group") {
// read media group
while (!atEnd()) {
readNext();
if (isEndElement() && name() == "group") break;
if (isStartElement()) {
if (name() == "thumbnail") {
// qDebug() << "Thumb: " << attributes().value("url").toString();
// video->thumbnailUrls() << QUrl(attributes().value("url").toString());
video->addThumbnailUrl(QUrl(attributes().value("url").toString()));
}
else if (name() == "title") {
QString title = readElementText();
// qDebug() << "Title: " << title;
video->setTitle(title);
}
else if (name() == "description") {
QString desc = readElementText();
// qDebug() << "Description: " << desc;
video->setDescription(desc);
}
else if (name() == "duration") {
QString duration = attributes().value("seconds").toString();
// qDebug() << "Duration: " << duration;
video->setDuration(duration.toInt());
}
}
}
}
}
}
videos.append(video);
}