本文整理汇总了C++中Album::format方法的典型用法代码示例。如果您正苦于以下问题:C++ Album::format方法的具体用法?C++ Album::format怎么用?C++ Album::format使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Album
的用法示例。
在下文中一共展示了Album::format方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showAlbumInfo
void SearchDialog::showAlbumInfo( const Album &a ){
albumInfo->showAlbumInfo(a);
artistLineEdit->setText(a.artists().join(", "));
albumLineEdit->setText(a.title());
genreLineEdit->setText(a.genre());
qDebug()<<"a.year()"<<a.year();
yearLineEdit->setText(QString::number(a.year()));
formatLineEdit->setText( a.format() );
countryLineEdit->setText( a.country() );
labelLineEdit->setText( a.label() );
//if( databaseComboBox->itemData(databaseComboBox->currentIndex()).toInt() == SearchDialog::DISCOGS ){
if( database_->type()==MusicDatabase::DISCOGS ){
rolesTextEdit->setText( a.roles().join(". ") );
notesTextEdit->setText( a.notes() );
}
}
示例2: handleRelease
void Discogs::handleRelease( QNetworkReply* reply ){
Album album;
QNetworkRequest request = reply->request();
QString key = request.attribute(QNetworkRequest::User).toString();
if( albums_.contains(key) ){
album = albums_[key];
//album.setArtists( QStringList() );
//album.setSongs( QList<Song>() );
}
//cover->setText("");
QString err;
QByteArray response(reply->readAll());
QXmlStreamReader xml(response);
QList<Artist> Artists;
QList<QUrl> images;
QStringList artists,roles;
QList<Song> songs;
while (!xml.atEnd()) {
xml.readNext();
//qDebug()<<xml.name();
if( xml.name() == "release" && xml.attributes().hasAttribute("id") ){
QString id = xml.attributes().value("id").toString();
album.setRelease(id);
}
if(xml.tokenType() == QXmlStreamReader::StartElement){
if( xml.attributes().hasAttribute("stat") ){
QString stat = xml.attributes().value("stat").toString();
if(stat=="fail"){
while(xml.readNextStartElement()){
if( xml.name() == "error" ){
err.append(xml.readElementText()+"\n");
}else{
xml.skipCurrentElement();
}
}
}
}
if( xml.attributes().hasAttribute("requests") ){
//&nSearches = xml.attributes().value("requests").toString().toInt();
//info->setText(QString::number(nSearches)+" searches performed within the last 24 hours");
}
if(xml.name() == "images"){
xml.readNext();
while(xml.name()=="image"){
if( xml.attributes().hasAttribute("uri") ){
images.append( QUrl( xml.attributes().value("uri").toString() ) );
//qDebug()<<"found image "<<xml.attributes().value("uri").toString();
}
xml.readNext();
}
}
if(xml.name() == "artists"){
while(xml.readNextStartElement()){
if(xml.name() == "artist"){
while(xml.readNextStartElement()){
if(xml.name() == "name"){
artists.append( xml.readElementText() );
}else{
xml.skipCurrentElement();
}
}
}else{
xml.skipCurrentElement();
}
}
}
if(xml.name() == "extraartists"){
while(xml.readNextStartElement()){
if(xml.name() == "artist"){
//QString name;QString role;
Artist a;
while(xml.readNextStartElement()){
if(xml.name() == "name"){
a.setName( xml.readElementText() );
}else if(xml.name() == "role"){
a.setRole( xml.readElementText() );
}else{
xml.skipCurrentElement();
}
Artists.append(a);
}
//qDebug()<<role+": "+name;
//album.roles.append( role+": "+name );
}else{
xml.skipCurrentElement();
}
}
}
if(xml.name() == "formats"){
while(xml.readNextStartElement()){
if( xml.name()=="format" && xml.attributes().hasAttribute("name") ){
QString sep=", ";
if(album.format().isEmpty()){
//.........这里部分代码省略.........