62 connect(d, SIGNAL(downLoadRawDataChanged(QByteArray)), SLOT(
downLoadFinished(QByteArray)));
97 m_pageQueryWidget(nullptr)
190 m_initialized(false),
191 m_pageQueryWidget(nullptr)
296 if(parent()->metaObject()->indexOfSlot(
"queryArtistFinished()") != -1)
298 connect(
m_networkRequest, SIGNAL(downLoadDataChanged(QString)), parent(), SLOT(queryArtistFinished()));
306 m_artistAlbums(nullptr),
409 m_container->setCurrentIndex(index > 2 ? 2 : index);
415 if(songInfos.isEmpty())
417 m_statusLabel->setPixmap(QPixmap(
":/image/lb_no_artist_found"));
421 bool hasItem =
false;
424 if(
m_value.contains(info.m_artistName))
434 m_statusLabel->setPixmap(QPixmap(
":/image/lb_no_artist_found"));
447 const TTK::MusicSongInformationList songInfos(d->
items());
448 if(songInfos.isEmpty())
450 m_statusLabel->setPixmap(QPixmap(
":/image/lb_no_artist_found"));
469 connect(d, SIGNAL(downLoadRawDataChanged(QByteArray)), SLOT(
downLoadFinished(QByteArray)));
476 data->
m_label->setText(tr(
"<font color=#158FE1> Artist > %1 </font>").arg(item.
m_name));
504 QScrollArea *scrollArea =
new QScrollArea(
this);
506 layout()->addWidget(scrollArea);
510 QVBoxLayout *grid =
new QVBoxLayout(
function);
512 QLabel *firstLabel =
new QLabel(
function);
513 grid->addWidget(firstLabel);
515 QWidget *topFuncWidget =
new QWidget(
function);
516 QHBoxLayout *topFuncLayout =
new QHBoxLayout(topFuncWidget);
519 m_iconLabel->setPixmap(QPixmap(
":/image/lb_warning").scaled(180, 180));
522 QWidget *topLineWidget =
new QWidget(topFuncWidget);
523 QVBoxLayout *topLineLayout =
new QVBoxLayout(topLineWidget);
524 topLineLayout->setContentsMargins(10, 5, 5, 0);
526 QLabel *artistLabel =
new QLabel(topLineWidget);
527 QFont artistFont = artistLabel->font();
528 artistFont.setPixelSize(20);
529 artistLabel->setFont(artistFont);
533 QLabel *nickNameLabel =
new QLabel(topLineWidget);
537 QLabel *birthLabel =
new QLabel(topLineWidget);
541 topLineLayout->addWidget(artistLabel);
542 topLineLayout->addWidget(nickNameLabel);
543 topLineLayout->addWidget(birthLabel);
544 topLineWidget->setLayout(topLineLayout);
546 QWidget *topButtonWidget =
new QWidget(topFuncWidget);
548 QHBoxLayout *topButtonLayout =
new QHBoxLayout(topButtonWidget);
549 topButtonLayout->setContentsMargins(0, 0, 0, 0);
551 QPushButton *playAllButton =
new QPushButton(tr(
"Play All"), topButtonWidget);
552 QPushButton *shareButton =
new QPushButton(tr(
"Share"), topButtonWidget);
554 playAllButton->setIcon(QIcon(
":/contextMenu/btn_play_white"));
555 playAllButton->setIconSize(QSize(14, 14));
556 playAllButton->setCursor(QCursor(Qt::PointingHandCursor));
557 shareButton->setCursor(QCursor(Qt::PointingHandCursor));
558 playAllButton->setFixedSize(90, 30);
559 shareButton->setFixedSize(55, 30);
561 topButtonLayout->addWidget(playAllButton);
562 topButtonLayout->addWidget(shareButton);
563 topButtonLayout->addStretch(1);
564 topButtonWidget->setLayout(topButtonLayout);
565 topLineLayout->addWidget(topButtonWidget);
570 QWidget *topRightWidget =
new QWidget(topFuncWidget);
571 QGridLayout *topRightLayout =
new QGridLayout(topRightWidget);
572 topRightLayout->setContentsMargins(0, 0, 0, 0);
573 topRightLayout->setSpacing(0);
575 QLabel *numberLabel =
new QLabel(topRightWidget);
576 numberLabel->setAlignment(Qt::AlignCenter);
580 numberLabel->setText(QString(
"%1.%2").arg(number).arg(
TTK::random(10)));
581 topRightLayout->addWidget(numberLabel, 0, 0);
582 topRightLayout->addWidget(
new MusicRatingLabel(ceil(number / 2.0), topRightWidget), 0, 1, 1, 6);
584 QLabel *numberTextLabel =
new QLabel(tr(
"Score:"), topRightWidget);
585 topRightLayout->addWidget(numberTextLabel, 1, 0);
586 topRightLayout->addWidget(
new MusicRatingLabel(topRightWidget), 1, 1, 1, 6);
588 QLabel *marginBottmLabel =
new QLabel(topRightWidget);
589 marginBottmLabel->setFixedHeight(40);
590 topRightLayout->addWidget(marginBottmLabel, 2, 0);
591 topRightWidget->setLayout(topRightLayout);
595 code->
setIcon(
":/image/lb_app_logo", 0.23);
596 topRightLayout->addWidget(code, 3, 2, 1, 6);
599 topFuncLayout->addWidget(topLineWidget);
600 topFuncLayout->addWidget(topRightWidget);
601 topFuncWidget->setLayout(topFuncLayout);
602 grid->addWidget(topFuncWidget);
604 QWidget *functionWidget =
new QWidget(
this);
606 QHBoxLayout *hLayout =
new QHBoxLayout(functionWidget);
611 m_songButton->setCursor(QCursor(Qt::PointingHandCursor));
614 QPushButton *infoButton =
new QPushButton(functionWidget);
615 infoButton->setText(tr(
"Info"));
616 infoButton->setFixedSize(100, 25);
617 infoButton->setCursor(QCursor(Qt::PointingHandCursor));
618 hLayout->addWidget(infoButton);
620 QPushButton *albumsButton =
new QPushButton(functionWidget);
621 albumsButton->setText(tr(
"Albums"));
622 albumsButton->setFixedSize(100, 25);
623 albumsButton->setCursor(QCursor(Qt::PointingHandCursor));
624 hLayout->addWidget(albumsButton);
626 QPushButton *mvsButton =
new QPushButton(functionWidget);
627 mvsButton->setText(tr(
"Movies"));
628 mvsButton->setFixedSize(100, 25);
629 mvsButton->setCursor(QCursor(Qt::PointingHandCursor));
631 hLayout->addWidget(mvsButton);
632 hLayout->addStretch(1);
633 functionWidget->setLayout(hLayout);
635 QButtonGroup *buttonGroup =
new QButtonGroup(
this);
637 buttonGroup->addButton(infoButton, 1);
638 buttonGroup->addButton(albumsButton, 2);
639 buttonGroup->addButton(mvsButton, 3);
643 playAllButton->setFocusPolicy(Qt::NoFocus);
644 shareButton->setFocusPolicy(Qt::NoFocus);
646 infoButton->setFocusPolicy(Qt::NoFocus);
647 albumsButton->setFocusPolicy(Qt::NoFocus);
648 mvsButton->setFocusPolicy(Qt::NoFocus);
650 grid->addWidget(functionWidget);
654 function->setLayout(grid);
TTK_MODULE_EXPORT QString generateSongArtist(const QString &name, const QString &key=TTK_DEFAULT_STR)
The class of the search result data item.
static constexpr const char * TinyBtnPlaylist
static const QString FontStyle03
int pageTotalSize() const noexcept
virtual void startToRequest(const QString &url)=0
static const QString CheckBoxStyle01
CheckBox.
static const QString PushButtonStyle01
PushButton.
static const QString ColorStyle04
static const QString FontStyle01
Font.
TTK_MODULE_EXPORT int random(int value=RAND_MAX)
static const QString FontStyle05
void setQueryType(QueryType type)
static const QString PushButtonStyle03
void setInputData(const QByteArray &data, const QSize &size)
The class of the page query widget.
virtual void startToPage(int offset)
void page(int index, int total)
#define QtButtonGroupConnect(p, q, f, s)
Button group connect.
static bool isCoverValid(const QString &url)
The class of the image render thread.
The class of the rating label.
void setQueryMode(QueryMode mode)
QWidget * createPageWidget(QWidget *parent, int total)
static const QString ColorStyle11
#define G_DOWNLOAD_QUERY_PTR
The class of the cover data download request.
virtual void startToSearch(const QString &value)=0
The class of the abstract query download data from net.
const TTK::MusicSongInformationList & items() const
#define TTK_ERROR_STREAM(msg)