diff --git a/src/songitem.cpp b/src/songitem.cpp index 5fc6030..9e27777 100644 --- a/src/songitem.cpp +++ b/src/songitem.cpp @@ -5,12 +5,14 @@ #include #include -SongItem::SongItem(QWidget *parent) : +SongItem::SongItem(QWidget *parent, QNetworkAccessManager *manager) : QWidget(parent), ui(new Ui::SongItem) { ui->setupUi(this); + this->networkManager_ = manager; + animate(); } @@ -39,7 +41,7 @@ void SongItem::init(QString artist,QString title,QString album,QString release_d this->artist = artist; this->spotify_url = spotify_url; - ui->cover->setRemotePixmap(iconUrl,"qrc:///icons/app/icon-256.png"); + ui->cover->init(this->networkManager_,iconUrl,"qrc:///icons/app/icon-256.png"); ui->titleLabel->setText(title); ui->artistLabel->setText("by: "+artist); ui->albumLabel->setText("from: "+album+" ("+release_date+")"); diff --git a/src/songitem.h b/src/songitem.h index 9273d8d..c5305f7 100644 --- a/src/songitem.h +++ b/src/songitem.h @@ -3,6 +3,7 @@ #include #include +#include namespace Ui { class SongItem; @@ -13,7 +14,7 @@ class SongItem : public QWidget Q_OBJECT public: - explicit SongItem(QWidget *parent = nullptr); + explicit SongItem(QWidget *parent = nullptr, QNetworkAccessManager *manager = nullptr); ~SongItem(); signals: @@ -39,6 +40,7 @@ private slots: Ui::SongItem *ui; QString preview_url, title, artist, spotify_url; QMediaPlayer *player = nullptr; + QNetworkAccessManager *networkManager_ = nullptr; }; #endif // SONGITEM_H diff --git a/src/songitem.ui b/src/songitem.ui index a972b3d..7cce3fb 100644 --- a/src/songitem.ui +++ b/src/songitem.ui @@ -15,7 +15,7 @@ - + 0 @@ -191,9 +191,9 @@
elidedlabel.h
- RemotePixmapLabel + RemotePixmapLabel2 QLabel -
remotepixmaplabel.h
+
remotepixmaplabel2.h