67 if(songInfos.isEmpty())
69 m_statusLabel->setPixmap(QPixmap(
":/image/lb_no_album_found"));
76 if(
m_value.contains(info.m_songName))
86 m_statusLabel->setPixmap(QPixmap(
":/image/lb_no_album_found"));
99 const TTK::MusicSongInformationList &songInfos = req->
items();
100 if(songInfos.isEmpty())
102 m_statusLabel->setPixmap(QPixmap(
":/image/lb_no_album_found"));
124 connect(req, SIGNAL(downloadRawDataChanged(QByteArray)), SLOT(
downloadFinished(QByteArray)));
129 for(
int i = 0; i < list.count(); ++i)
131 if(list[i].isEmpty())
140 data->
m_label->setText(tr(
"<font color=#158FE1> Alubm > %1 </font>").arg(list[0]));
143 data->
m_label->setToolTip(list[0]);
147 data->
m_label->setToolTip(tr(
"Singer: %1").arg(item.
m_name));
151 data->
m_label->setToolTip(tr(
"Language: %1").arg(list[1]));
155 data->
m_label->setToolTip(tr(
"Company: %1").arg(list[2]));
159 data->
m_label->setToolTip(tr(
"Year: %1").arg(list[3]));
172 QScrollArea *scrollArea =
new QScrollArea(
this);
174 layout()->addWidget(scrollArea);
178 QVBoxLayout *grid =
new QVBoxLayout(
function);
180 QLabel *firstLabel =
new QLabel(
function);
181 grid->addWidget(firstLabel);
183 QWidget *topFuncWidget =
new QWidget(
function);
184 QHBoxLayout *topFuncLayout =
new QHBoxLayout(topFuncWidget);
187 m_iconLabel->setPixmap(QPixmap(
":/image/lb_warning").scaled(180, 180));
190 QWidget *topLineWidget =
new QWidget(topFuncWidget);
191 QVBoxLayout *topLineLayout =
new QVBoxLayout(topLineWidget);
192 topLineLayout->setContentsMargins(10, 5, 5, 0);
194 QLabel *albumLabel =
new QLabel(topLineWidget);
195 QFont albumFont = albumLabel->font();
196 albumFont.setPixelSize(20);
197 albumLabel->setFont(albumFont);
201 QLabel *singerLabel =
new QLabel(topLineWidget);
205 QLabel *languageLabel =
new QLabel(topLineWidget);
209 QLabel *companyLabel =
new QLabel(topLineWidget);
213 QLabel *yearLabel =
new QLabel(topLineWidget);
217 topLineLayout->addWidget(albumLabel);
218 topLineLayout->addWidget(singerLabel);
219 topLineLayout->addWidget(languageLabel);
220 topLineLayout->addWidget(companyLabel);
221 topLineLayout->addWidget(yearLabel);
222 topLineWidget->setLayout(topLineLayout);
224 QWidget *topButtonWidget =
new QWidget(topFuncWidget);
225 QHBoxLayout *topButtonLayout =
new QHBoxLayout(topButtonWidget);
226 topButtonLayout->setContentsMargins(0, 0, 0, 0);
228 QPushButton *playAllButton =
new QPushButton(tr(
"Play All"), topButtonWidget);
229 QPushButton *shareButton =
new QPushButton(tr(
"Share"), topButtonWidget);
231 playAllButton->setIcon(QIcon(
":/contextMenu/btn_play_white"));
232 playAllButton->setIconSize(QSize(14, 14));
233 playAllButton->setCursor(QCursor(Qt::PointingHandCursor));
234 shareButton->setCursor(QCursor(Qt::PointingHandCursor));
235 playAllButton->setFixedSize(90, 30);
236 shareButton->setFixedSize(55, 30);
238 topButtonLayout->addWidget(playAllButton);
239 topButtonLayout->addWidget(shareButton);
240 topButtonLayout->addStretch(1);
241 topButtonWidget->setLayout(topButtonLayout);
242 topLineLayout->addWidget(topButtonWidget);
247 QWidget *topRightWidget =
new QWidget(topFuncWidget);
248 QGridLayout *topRightLayout =
new QGridLayout(topRightWidget);
249 topRightLayout->setContentsMargins(0, 0, 0, 0);
250 topRightLayout->setSpacing(0);
252 QLabel *numberLabel =
new QLabel(topRightWidget);
253 numberLabel->setAlignment(Qt::AlignCenter);
257 numberLabel->setText(QString(
"%1.%2").arg(number).arg(
TTK::random(10)));
258 topRightLayout->addWidget(numberLabel, 0, 0);
259 topRightLayout->addWidget(
new MusicRatingLabel(std::ceil(number / 2.0), topRightWidget), 0, 1, 1, 6);
261 QLabel *numberTextLabel =
new QLabel(tr(
"Score:"), topRightWidget);
262 topRightLayout->addWidget(numberTextLabel, 1, 0);
263 topRightLayout->addWidget(
new MusicRatingLabel(topRightWidget), 1, 1, 1, 6);
265 QLabel *marginBottmLabel =
new QLabel(topRightWidget);
266 marginBottmLabel->setFixedHeight(40);
267 topRightLayout->addWidget(marginBottmLabel, 2, 0);
268 topRightWidget->setLayout(topRightLayout);
272 code->
setIcon(
":/image/lb_app_logo", 0.23);
273 topRightLayout->addWidget(code, 3, 2, 1, 6);
276 topFuncLayout->addWidget(topLineWidget);
277 topFuncLayout->addWidget(topRightWidget);
278 topFuncWidget->setLayout(topFuncLayout);
279 grid->addWidget(topFuncWidget);
281 QWidget *functionWidget =
new QWidget(
this);
283 QHBoxLayout *hLayout =
new QHBoxLayout(functionWidget);
288 m_songButton->setCursor(QCursor(Qt::PointingHandCursor));
290 hLayout->addStretch(1);
291 functionWidget->setLayout(hLayout);
293 QButtonGroup *buttonGroup =
new QButtonGroup(
this);
298 playAllButton->setFocusPolicy(Qt::NoFocus);
299 shareButton->setFocusPolicy(Qt::NoFocus);
302 grid->addWidget(functionWidget);
306 function->setLayout(grid);
const TTK::MusicSongInformationList & items() const noexcept
The class of the search result data item.
void setQueryMode(QueryMode mode) noexcept
static const QString FontStyle03
static bool isCoverValid(const QString &url) 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
#define QtButtonGroupConnect(p, q, f, s)
Button group connect.
The class of the rating label.
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.