11 #define QUERY_WIDGET_WIDTH (G_SETTING_PTR->value(MusicSettingManager::WidgetSize).toSize().width() - LEFT_SIDE_WIDTH_MIN)
17 setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
22 setItemDelegateForColumn(0,
nullptr);
24 QHeaderView *headerView = horizontalHeader();
25 headerView->resizeSection(0, 230);
26 headerView->resizeSection(1, 20);
27 headerView->resizeSection(2, 20);
28 headerView->resizeSection(3, 40);
29 headerView->resizeSection(4, 5);
63 QHeaderView *headerView = horizontalHeader();
66 for(
int i = 0; i < rowCount(); ++i)
68 QTableWidgetItem *it = item(i, 0);
75 if(column < 0 || row < 0 || row >= rowCount() - 1)
100 it->setIcon(QIcon());
104 if(it = item(row, 1))
106 it->setIcon(QIcon(
":/contextMenu/btn_play"));
109 if(it = item(row, 2))
111 it->setIcon(QIcon(
":/contextMenu/btn_add"));
114 if(it = item(row, 3))
117 it->setIcon(QIcon(
":/contextMenu/btn_download"));
122 if(column == 1 || column == 2 || column == 3)
124 setCursor(QCursor(Qt::PointingHandCursor));
153 const int count = rowCount();
154 setRowCount(count + 1);
156 QHeaderView *headerView = horizontalHeader();
157 QTableWidgetItem *item =
new QTableWidgetItem;
162 setItem(count, 0, item);
164 item =
new QTableWidgetItem;
165 setItem(count, 1, item);
167 item =
new QTableWidgetItem;
168 setItem(count, 2, item);
170 item =
new QTableWidgetItem(result.
m_duration);
173 setItem(count, 3, item);
175 item =
new QTableWidgetItem;
176 setItem(count, 4, item);
187 if(row >= songInfos.count())
235 m_networkRequest(nullptr)
274 int row = 0, col = 0;
283 int rowNumber = lineNumber;
296 m_gridLayout->addWidget(label, row, col, Qt::AlignLeft | Qt::AlignTop);
328 int row = 0, col = 0, rowNumber = 0;
334 rowNumber = lineNumber;
338 rowNumber = lineNumber / 2;
346 rowNumber = 2 * rowNumber;
362 m_categoryChanged(false),
364 m_pageQueryWidget(nullptr),
365 m_networkRequest(nullptr)
369 QHBoxLayout *layout =
new QHBoxLayout(
this);
370 layout->setSpacing(0);
371 layout->setContentsMargins(12, 0, 12, 0);
376 QVBoxLayout *mainWidgetLayout =
new QVBoxLayout(
m_mainWidget);
377 mainWidgetLayout->setSpacing(0);
378 mainWidgetLayout->setContentsMargins(0, 0, 0, 0);
381 QScrollArea *scrollArea =
new QScrollArea(
this);
383 layout->addWidget(scrollArea);
433 case 0: key =
"ALL";
break;
434 case 1: key =
"ZH";
break;
435 case 2: key =
"EA";
break;
436 case 3: key =
"KR";
break;
437 case 4: key =
"JP";
break;
471 mainLayout->addStretch(1);
508 topWidget->setFixedHeight(65);
511 QHBoxLayout *topWidgetLayout =
new QHBoxLayout(topWidget);
512 topWidgetLayout->setContentsMargins(0, 20, 12, 10);
513 topWidget->setLayout(topWidgetLayout);
515 QWidget *frame =
new QWidget(topWidget);
516 frame->setFixedSize(3, 36);
518 topWidgetLayout->addWidget(frame);
520 QLabel *label =
new QLabel(topWidget);
522 topWidgetLayout->addWidget(label);
523 topWidgetLayout->addStretch(1);
526 backButton->setAlignment(Qt::AlignBottom);
528 topWidgetLayout->addWidget(backButton, 0, Qt::AlignBottom);
529 connect(backButton, SIGNAL(clicked()), parent(), SLOT(moreItemChangedToArea()));
546 label->setText(tr(
"New Albums"));
548 QWidget *spacing =
new QWidget(topWidget);
549 spacing->setFixedWidth(10);
550 topWidgetLayout->insertWidget(2, spacing);
553 allButton->setAlignment(Qt::AlignBottom);
555 topWidgetLayout->insertWidget(3, allButton);
557 QWidget *frame1 =
new QWidget(topWidget);
558 frame1->setFixedSize(2, topWidget->height() / 4);
560 topWidgetLayout->insertWidget(4, frame1, 0, Qt::AlignBottom);
563 zhButton->setAlignment(Qt::AlignBottom);
565 topWidgetLayout->insertWidget(5, zhButton);
567 QWidget *frame2 =
new QWidget(topWidget);
568 frame2->setFixedSize(2, topWidget->height() / 4);
570 topWidgetLayout->insertWidget(6, frame2, 0, Qt::AlignBottom);
573 eaButton->setAlignment(Qt::AlignBottom);
575 topWidgetLayout->insertWidget(7, eaButton);
577 QWidget *frame3 =
new QWidget(topWidget);
578 frame3->setFixedSize(2, topWidget->height() / 4);
580 topWidgetLayout->insertWidget(8, frame3, 0, Qt::AlignBottom);
583 krButton->setAlignment(Qt::AlignBottom);
585 topWidgetLayout->insertWidget(9, krButton);
587 QWidget *frame4 =
new QWidget(topWidget);
588 frame4->setFixedSize(2, topWidget->height() / 4);
590 topWidgetLayout->insertWidget(10, frame4, 0, Qt::AlignBottom);
593 jpButton->setAlignment(Qt::AlignBottom);
595 topWidgetLayout->insertWidget(11, jpButton);
604 label->setText(tr(
"Popular Artists"));
613 label->setText(tr(
"Recommended Playlist"));
622 label->setText(tr(
"Premium Playlist"));
624 QWidget *spacing =
new QWidget(topWidget);
625 spacing->setFixedWidth(10);
626 topWidgetLayout->insertWidget(2, spacing);
629 allButton->setAlignment(Qt::AlignBottom);
631 topWidgetLayout->insertWidget(3, allButton);
633 QWidget *frame1 =
new QWidget(topWidget);
634 frame1->setFixedSize(2, topWidget->height() / 4);
636 topWidgetLayout->insertWidget(4, frame1, 0, Qt::AlignBottom);
639 zhButton->setAlignment(Qt::AlignBottom);
641 topWidgetLayout->insertWidget(5, zhButton);
643 QWidget *frame2 =
new QWidget(topWidget);
644 frame2->setFixedSize(2, topWidget->height() / 4);
646 topWidgetLayout->insertWidget(6, frame2, 0, Qt::AlignBottom);
649 eaButton->setAlignment(Qt::AlignBottom);
651 topWidgetLayout->insertWidget(7, eaButton);
653 QWidget *frame3 =
new QWidget(topWidget);
654 frame3->setFixedSize(2, topWidget->height() / 4);
656 topWidgetLayout->insertWidget(8, frame3, 0, Qt::AlignBottom);
659 krButton->setAlignment(Qt::AlignBottom);
661 topWidgetLayout->insertWidget(9, krButton);
663 QWidget *frame4 =
new QWidget(topWidget);
664 frame4->setFixedSize(2, topWidget->height() / 4);
666 topWidgetLayout->insertWidget(10, frame4, 0, Qt::AlignBottom);
669 jpButton->setAlignment(Qt::AlignBottom);
671 topWidgetLayout->insertWidget(11, jpButton);
689 layout->removeWidget(w);
698 m_itemMoreWidget(nullptr)
700 QVBoxLayout *layout =
new QVBoxLayout(
this);
701 layout->setSpacing(0);
702 layout->setContentsMargins(0, 0, 0, 0);
765 layout->setContentsMargins(12, 0, 12, 0);
766 layout->setSpacing(6);
779 widget->setFixedHeight(40);
783 QHBoxLayout *topLayout =
new QHBoxLayout(widget);
784 topLayout->setContentsMargins(0, 0, 0, 0);
785 topLayout->setSpacing(25);
786 topLayout->addStretch(1);
792 topLayout->addWidget(discovery);
797 topLayout->addWidget(recommend);
802 topLayout->addWidget(toplist);
807 topLayout->addWidget(artists);
812 topLayout->addWidget(category);
814 topLayout->addStretch(1);
823 layout->setContentsMargins(0, 0, 0, 0);
824 layout->setSpacing(0);
827 QScrollArea *scrollArea =
new QScrollArea(
m_homeWidget);
836 layout->addStretch(1);
842 widget->setFixedHeight(430);
845 QHBoxLayout *layout =
new QHBoxLayout(widget);
846 layout->setContentsMargins(0, 0, 0, 0);
847 layout->setSpacing(10);
848 widget->setLayout(layout);
850 QWidget *leftWidget =
new QWidget(widget);
851 layout->addWidget(leftWidget, 1);
853 QVBoxLayout *leftLayout =
new QVBoxLayout(leftWidget);
854 leftLayout->setContentsMargins(0, 0, 0, 0);
855 leftWidget->setLayout(leftLayout);
857 QWidget *leftTopWidget =
new QWidget(leftWidget);
858 leftTopWidget->setFixedHeight(30);
859 leftLayout->addWidget(leftTopWidget);
861 QHBoxLayout *leftTopLayout =
new QHBoxLayout(leftTopWidget);
862 leftTopLayout->setContentsMargins(0, 0, 0, 0);
863 leftTopWidget->setLayout(leftTopLayout);
865 QWidget *leftTopFrame =
new QWidget(leftTopWidget);
866 leftTopFrame->setFixedWidth(3);
868 leftTopLayout->addWidget(leftTopFrame);
870 QLabel *leftTopLabel =
new QLabel(tr(
"New Songs"), leftTopWidget);
872 leftTopLayout->addWidget(leftTopLabel);
873 leftTopLayout->addStretch(1);
875 QWidget *leftMiddle =
new QWidget(leftWidget);
876 leftMiddle->setFixedHeight(1);
878 leftLayout->addWidget(leftMiddle);
885 QWidget *rightWidget =
new QWidget(widget);
886 layout->addWidget(rightWidget, 1);
888 QVBoxLayout *rightLayout =
new QVBoxLayout(rightWidget);
889 rightLayout->setContentsMargins(0, 0, 0, 0);
890 rightWidget->setLayout(rightLayout);
892 QWidget *rightTopWidget =
new QWidget(rightWidget);
893 rightTopWidget->setFixedHeight(30);
894 rightLayout->addWidget(rightTopWidget);
896 QHBoxLayout *rightTopLayout =
new QHBoxLayout(rightTopWidget);
897 rightTopLayout->setContentsMargins(0, 0, 0, 0);
898 rightTopWidget->setLayout(rightTopLayout);
900 QWidget *rightTopFrame =
new QWidget(rightTopWidget);
901 rightTopFrame->setFixedWidth(3);
903 rightTopLayout->addWidget(rightTopFrame);
907 rightTopLayout->addWidget(rightTopLabel);
908 rightTopLayout->addStretch(1);
923 widget->setFixedHeight(260);
926 QVBoxLayout *layout =
new QVBoxLayout(widget);
927 layout->setContentsMargins(0, 0, 0, 0);
928 widget->setLayout(layout);
930 QWidget *topWidget =
new QWidget(widget);
931 topWidget->setFixedHeight(30);
932 layout->addWidget(topWidget);
934 QHBoxLayout *topLayout =
new QHBoxLayout(topWidget);
935 topLayout->setContentsMargins(0, 0, 0, 0);
936 topWidget->setLayout(topLayout);
938 QWidget *topFrame =
new QWidget(topWidget);
939 topFrame->setFixedSize(3, 30);
941 topLayout->addWidget(topFrame, 0, Qt::AlignVCenter);
945 topLayout->addWidget(topLabel);
946 topLayout->addStretch(1);
961 widget->setFixedHeight(260);
964 QVBoxLayout *layout =
new QVBoxLayout(widget);
965 layout->setContentsMargins(0, 0, 0, 0);
966 widget->setLayout(layout);
968 QWidget *topWidget =
new QWidget(widget);
969 topWidget->setFixedHeight(30);
970 layout->addWidget(topWidget);
972 QHBoxLayout *topLayout =
new QHBoxLayout(topWidget);
973 topLayout->setContentsMargins(0, 0, 0, 0);
974 topWidget->setLayout(topLayout);
976 QWidget *topFrame =
new QWidget(topWidget);
977 topFrame->setFixedSize(3, 30);
979 topLayout->addWidget(topFrame, 0, Qt::AlignVCenter);
983 topLayout->addWidget(topLabel);
984 topLayout->addStretch(1);
999 widget->setFixedHeight(260);
1002 QVBoxLayout *layout =
new QVBoxLayout(widget);
1003 layout->setContentsMargins(0, 0, 0, 0);
1004 widget->setLayout(layout);
1006 QWidget *topWidget =
new QWidget(widget);
1007 topWidget->setFixedHeight(30);
1008 layout->addWidget(topWidget);
1010 QHBoxLayout *topLayout =
new QHBoxLayout(topWidget);
1011 topLayout->setContentsMargins(0, 0, 0, 0);
1012 topWidget->setLayout(topLayout);
1014 QWidget *topFrame =
new QWidget(topWidget);
1015 topFrame->setFixedSize(3, 30);
1017 topLayout->addWidget(topFrame, 0, Qt::AlignVCenter);
1021 topLayout->addWidget(topLabel);
1022 topLayout->addStretch(1);
QWidget * m_homeContainer
const TTK::MusicSongInformationList & items() const noexcept
#define TTKStaticCast(x, y)
MusicNewSongRecommendQueryTableWidget * m_newSongsWidget
The class of the search result data item.
~MusicMainRecommendWidget()
MusicItemMoreRecommendQueryWidget * m_itemMoreWidget
static const QString FontStyle03
The class of the music song property.
int pageTotalSize() const noexcept
static const QString PushButtonStyle01
PushButton.
void createContainerMiddleTopWidget()
void createContainerWidget()
static const QString ColorStyle04
#define QtItemSetTextAlignment(p, a)
Item text alignment.
static constexpr unsigned int Color02
The class of the label widget that can click.
TTKClickedGroup * m_areasGroup
static const QString FontStyle01
Font.
QStackedWidget * m_mainWidget
MusicItemRecommendQueryWidget * m_hqPlaylistWidget
static void popup(const QString &text)
virtual void resizeGeometry() overridefinal
void addWidget(QWidget *widget, int id=-1)
virtual void startToQueryResult(TTK::MusicSongInformation *info, int bitrate)
MusicItemRecommendQueryWidget * m_artistsWidget
static const QString FontStyle06
void setPageSize(int page) noexcept
The class of the cover source data download request.
MusicMainRecommendWidget(QWidget *parent=nullptr)
static constexpr wchar_t key[]
static const QString BackgroundStyle01
Background.
The class of the page query widget.
virtual void startToPage(int offset)
void page(int index, int total)
static const QString BackgroundStyle13
static const QString PushButtonStyle13
static const QString BackgroundStyle10
void createContainerMiddleWidget()
MusicItemRecommendQueryWidget * m_newAlbumsWidget
static const QString FontStyle04
The class of the search result info item.
#define QUERY_WIDGET_WIDTH
QWidget * createPageWidget(QWidget *parent, int total)
void createContainerTopWidget()
void moreItemChangedToArea()
static const QString LabelStyle03
int pageSize() const noexcept
#define G_DOWNLOAD_QUERY_PTR
static const QString BackgroundStyle03
virtual void startToSearch(const QString &value)=0
The class of the abstract query data from net.
MusicItemRecommendQueryWidget * m_playlistWidget
TTK_MODULE_EXPORT QString generateSongName(const QString &title, const QString &artist) noexcept
void areaItemChangedToMore(int id)
The class of the label widget click group mapper.
void createContainerMiddleBottomWidget()
#define TTKObjectCast(x, y)
QString queryServer() const noexcept