14 m_pageQueryWidget(nullptr)
107 m_initialized(false),
108 m_pageQueryWidget(nullptr)
201 m_artistAlbums(nullptr),
307 m_container->setCurrentIndex(index > 2 ? 2 : index);
313 if(songInfos.isEmpty())
315 m_statusLabel->setPixmap(QPixmap(
":/image/lb_no_artist_found"));
319 bool hasItem =
false;
322 if(
m_value.contains(info.m_artistName))
332 m_statusLabel->setPixmap(QPixmap(
":/image/lb_no_artist_found"));
345 const TTK::MusicSongInformationList &songInfos = req->
items();
346 if(songInfos.isEmpty())
348 m_statusLabel->setPixmap(QPixmap(
":/image/lb_no_artist_found"));
370 connect(req, SIGNAL(downloadRawDataChanged(QByteArray)), SLOT(
downloadFinished(QByteArray)));
377 data->
m_label->setText(tr(
"<font color=#158FE1> Artist > %1 </font>").arg(item.
m_name));
404 QScrollArea *scrollArea =
new QScrollArea(
this);
406 layout()->addWidget(scrollArea);
410 QVBoxLayout *grid =
new QVBoxLayout(
function);
412 QLabel *firstLabel =
new QLabel(
function);
413 grid->addWidget(firstLabel);
415 QWidget *topFuncWidget =
new QWidget(
function);
416 QHBoxLayout *topFuncLayout =
new QHBoxLayout(topFuncWidget);
419 m_iconLabel->setPixmap(QPixmap(
":/image/lb_warning").scaled(180, 180));
422 QWidget *topLineWidget =
new QWidget(topFuncWidget);
423 QVBoxLayout *topLineLayout =
new QVBoxLayout(topLineWidget);
424 topLineLayout->setContentsMargins(10, 5, 5, 0);
426 QLabel *artistLabel =
new QLabel(topLineWidget);
427 QFont artistFont = artistLabel->font();
428 artistFont.setPixelSize(20);
429 artistLabel->setFont(artistFont);
433 QLabel *nickNameLabel =
new QLabel(topLineWidget);
437 QLabel *birthLabel =
new QLabel(topLineWidget);
441 topLineLayout->addWidget(artistLabel);
442 topLineLayout->addWidget(nickNameLabel);
443 topLineLayout->addWidget(birthLabel);
444 topLineWidget->setLayout(topLineLayout);
446 QWidget *topButtonWidget =
new QWidget(topFuncWidget);
448 QHBoxLayout *topButtonLayout =
new QHBoxLayout(topButtonWidget);
449 topButtonLayout->setContentsMargins(0, 0, 0, 0);
451 QPushButton *playAllButton =
new QPushButton(tr(
"Play All"), topButtonWidget);
452 QPushButton *shareButton =
new QPushButton(tr(
"Share"), topButtonWidget);
454 playAllButton->setIcon(QIcon(
":/contextMenu/btn_play_white"));
455 playAllButton->setIconSize(QSize(14, 14));
456 playAllButton->setCursor(QCursor(Qt::PointingHandCursor));
457 shareButton->setCursor(QCursor(Qt::PointingHandCursor));
458 playAllButton->setFixedSize(90, 30);
459 shareButton->setFixedSize(55, 30);
461 topButtonLayout->addWidget(playAllButton);
462 topButtonLayout->addWidget(shareButton);
463 topButtonLayout->addStretch(1);
464 topButtonWidget->setLayout(topButtonLayout);
465 topLineLayout->addWidget(topButtonWidget);
470 QWidget *topRightWidget =
new QWidget(topFuncWidget);
471 QGridLayout *topRightLayout =
new QGridLayout(topRightWidget);
472 topRightLayout->setContentsMargins(0, 0, 0, 0);
473 topRightLayout->setSpacing(0);
475 QLabel *numberLabel =
new QLabel(topRightWidget);
476 numberLabel->setAlignment(Qt::AlignCenter);
480 numberLabel->setText(QString(
"%1.%2").arg(number).arg(
TTK::random(10)));
481 topRightLayout->addWidget(numberLabel, 0, 0);
482 topRightLayout->addWidget(
new MusicRatingLabel(std::ceil(number / 2.0), topRightWidget), 0, 1, 1, 6);
484 QLabel *numberTextLabel =
new QLabel(tr(
"Score:"), topRightWidget);
485 topRightLayout->addWidget(numberTextLabel, 1, 0);
486 topRightLayout->addWidget(
new MusicRatingLabel(topRightWidget), 1, 1, 1, 6);
488 QLabel *marginBottmLabel =
new QLabel(topRightWidget);
489 marginBottmLabel->setFixedHeight(40);
490 topRightLayout->addWidget(marginBottmLabel, 2, 0);
491 topRightWidget->setLayout(topRightLayout);
495 code->
setIcon(
":/image/lb_app_logo", 0.23);
496 topRightLayout->addWidget(code, 3, 2, 1, 6);
499 topFuncLayout->addWidget(topLineWidget);
500 topFuncLayout->addWidget(topRightWidget);
501 topFuncWidget->setLayout(topFuncLayout);
502 grid->addWidget(topFuncWidget);
504 QWidget *functionWidget =
new QWidget(
this);
506 QHBoxLayout *hLayout =
new QHBoxLayout(functionWidget);
511 m_songButton->setCursor(QCursor(Qt::PointingHandCursor));
514 QPushButton *infoButton =
new QPushButton(functionWidget);
515 infoButton->setText(tr(
"Info"));
516 infoButton->setFixedSize(100, 25);
517 infoButton->setCursor(QCursor(Qt::PointingHandCursor));
518 hLayout->addWidget(infoButton);
520 QPushButton *albumsButton =
new QPushButton(functionWidget);
521 albumsButton->setText(tr(
"Albums"));
522 albumsButton->setFixedSize(100, 25);
523 albumsButton->setCursor(QCursor(Qt::PointingHandCursor));
524 hLayout->addWidget(albumsButton);
526 QPushButton *mvsButton =
new QPushButton(functionWidget);
527 mvsButton->setText(tr(
"Movies"));
528 mvsButton->setFixedSize(100, 25);
529 mvsButton->setCursor(QCursor(Qt::PointingHandCursor));
531 hLayout->addWidget(mvsButton);
532 hLayout->addStretch(1);
533 functionWidget->setLayout(hLayout);
535 QButtonGroup *buttonGroup =
new QButtonGroup(
this);
537 buttonGroup->addButton(infoButton, 1);
538 buttonGroup->addButton(albumsButton, 2);
539 buttonGroup->addButton(mvsButton, 3);
543 playAllButton->setFocusPolicy(Qt::NoFocus);
544 shareButton->setFocusPolicy(Qt::NoFocus);
546 infoButton->setFocusPolicy(Qt::NoFocus);
547 albumsButton->setFocusPolicy(Qt::NoFocus);
548 mvsButton->setFocusPolicy(Qt::NoFocus);
550 grid->addWidget(functionWidget);
554 function->setLayout(grid);
const TTK::MusicSongInformationList & items() const noexcept
TTK_MODULE_EXPORT QString generateSongArtist(const QString &name, const QString &key=TTK_DEFAULT_STR)
The class of the search result data item.
void setQueryMode(QueryMode mode) noexcept
static const QString FontStyle03
static bool isCoverValid(const QString &url) noexcept
int pageTotalSize() const noexcept
virtual void startToRequest(const QString &url)=0
static const QString CheckBoxStyle01
CheckBox.
static const QString ColorStyle04
static const QString FontStyle01
Font.
TTK_MODULE_EXPORT int random(int value=RAND_MAX)
static const QString FontStyle06
static const QString PushButtonStyle03
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.
The class of the rating label.
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 data from net.