30 if(!
isValid(row) || row >= songInfos.count())
51 const int row = currentRow();
53 if(!
isValid(row) || row >= songInfos.count())
58 switch(action->data().toInt())
68 MusicQueryTableWidget::contextMenuEvent(event);
73 const int row = currentRow();
75 if(!
isValid(row) || row >= songInfos.count())
80 menu.addAction(QIcon(
":/contextMenu/btn_play"), tr(
"Play"))->setData(0);
81 menu.addAction(tr(
"Download More..."))->setData(1);
82 connect(&menu, SIGNAL(triggered(QAction*)), SLOT(
actionChanged(QAction*)));
84 menu.exec(QCursor::pos());
101 connect(req, SIGNAL(downloadDataChanged(QString)), SLOT(
queryAllFinished()));
148 connect(req, SIGNAL(downloadRawDataChanged(QByteArray)), SLOT(
downloadFinished(QByteArray)));
174 QScrollArea *scrollArea =
new QScrollArea(
this);
176 layout()->addWidget(scrollArea);
180 QVBoxLayout *grid =
new QVBoxLayout(
function);
182 QWidget *firstTopFuncWidget =
new QWidget(
function);
183 QHBoxLayout *firstTopFuncLayout =
new QHBoxLayout(firstTopFuncWidget);
184 firstTopFuncLayout->setContentsMargins(9, 9, 0, 9);
186 QLabel *firstLabel =
new QLabel(
function);
189 QPushButton *backButton =
new QPushButton(tr(
"Back"));
190 backButton->setFixedSize(90, 30);
192 backButton->setCursor(QCursor(Qt::PointingHandCursor));
193 connect(backButton, SIGNAL(clicked()),
this, SIGNAL(
backToMainMenu()));
195 firstTopFuncLayout->addWidget(firstLabel);
196 firstTopFuncLayout->addWidget(backButton);
197 grid->addWidget(firstTopFuncWidget);
199 QWidget *topFuncWidget =
new QWidget(
function);
200 QHBoxLayout *topFuncLayout =
new QHBoxLayout(topFuncWidget);
203 m_iconLabel->setPixmap(QPixmap(
":/image/lb_warning").scaled(180, 180));
206 QWidget *topLineWidget =
new QWidget(topFuncWidget);
207 QVBoxLayout *topLineLayout =
new QVBoxLayout(topLineWidget);
208 topLineLayout->setContentsMargins(10, 5, 5, 0);
210 QLabel *nameLabel =
new QLabel(topLineWidget);
211 QFont nameFont = nameLabel->font();
212 nameFont.setPixelSize(20);
213 nameLabel->setFont(nameFont);
217 QLabel *typeLabel =
new QLabel(topLineWidget);
221 topLineLayout->addWidget(nameLabel);
222 topLineLayout->addStretch(1);
223 topLineLayout->addWidget(typeLabel);
224 topLineLayout->addStretch(5);
225 topLineWidget->setLayout(topLineLayout);
228 topFuncLayout->addWidget(topLineWidget);
229 topFuncWidget->setLayout(topFuncLayout);
230 grid->addWidget(topFuncWidget);
232 QWidget *functionWidget =
new QWidget(
this);
234 QHBoxLayout *hLayout =
new QHBoxLayout(functionWidget);
239 m_songButton->setCursor(QCursor(Qt::PointingHandCursor));
242 hLayout->addStretch(1);
243 functionWidget->setLayout(hLayout);
245 QButtonGroup *buttonGroup =
new QButtonGroup(
this);
250 backButton->setFocusPolicy(Qt::NoFocus);
253 grid->addWidget(functionWidget);
257 function->setLayout(grid);
266 QWidget *songWidget =
new QWidget(
this);
267 QVBoxLayout *vLayout =
new QVBoxLayout(songWidget);
268 vLayout->setSpacing(0);
269 vLayout->setContentsMargins(0, 0, 0, 0);
271 QWidget *middleFuncWidget =
new QWidget(songWidget);
273 QHBoxLayout *middleFuncLayout =
new QHBoxLayout(middleFuncWidget);
274 middleFuncLayout->setContentsMargins(0, 5, 0, 5);
276 QLabel *marginLabel =
new QLabel(middleFuncWidget);
277 marginLabel->setFixedWidth(1);
278 QCheckBox *allCheckBox =
new QCheckBox(
TTK_SPACE + tr(
"All"), middleFuncWidget);
279 QPushButton *downloadButton =
new QPushButton(tr(
"Download"), middleFuncWidget);
280 downloadButton->setFixedSize(55, 25);
281 downloadButton->setCursor(QCursor(Qt::PointingHandCursor));
284 allCheckBox->setFocusPolicy(Qt::NoFocus);
285 downloadButton->setFocusPolicy(Qt::NoFocus);
288 middleFuncLayout->addWidget(marginLabel);
289 middleFuncLayout->addWidget(allCheckBox);
290 middleFuncLayout->addStretch(1);
291 middleFuncLayout->addWidget(downloadButton);
292 connect(allCheckBox, SIGNAL(clicked(
bool)),
m_tableWidget, SLOT(checkedItemsState(
bool)));
295 vLayout->addWidget(middleFuncWidget);
297 vLayout->addStretch(1);
298 songWidget->setLayout(vLayout);
const TTK::MusicSongInformationList & items() const noexcept
The class of the search result data item.
static const QString FontStyle03
static bool isCoverValid(const QString &url) noexcept
virtual void startToRequest(const QString &url)=0
static const QString CheckBoxStyle01
CheckBox.
The class of the mv radio program request.
static const QString ColorStyle04
static const QString FontStyle01
Font.
The class of the cover source data download request.
static const QString PushButtonStyle03
#define QtButtonGroupConnect(p, q, f, s)
Button group connect.
static const QString MenuStyle02
The class of the cover data download request.
The class of the abstract query data from net.