TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicsimilarquerywidget.cpp
Go to the documentation of this file.
3 
6 {
7 
8 }
9 
11 {
12  removeItems();
13 }
14 
16 {
17  if(rowCount() >= (SONG_PAGE_SIZE / 2))
18  {
19  return;
20  }
21 
23 }
24 
25 
26 
29 {
31  m_queryTableWidget->hide();
32 }
33 
34 void MusicSimilarQueryWidget::setCurrentValue(const QString &value)
35 {
37  m_queryTableWidget->setQueryInput(G_DOWNLOAD_QUERY_PTR->makeQueryRequest(this));
39  createLabels();
40 }
41 
43 {
45 }
46 
48 {
49  delete m_statusLabel;
50  m_statusLabel = nullptr;
51 
53  m_container->show();
54 
55  layout()->removeWidget(m_mainWindow);
56  QScrollArea *scrollArea = new QScrollArea(this);
58  layout()->addWidget(scrollArea);
59 
60  QWidget *function = new QWidget(m_mainWindow);
61  function->setStyleSheet(TTK::UI::CheckBoxStyle01 + TTK::UI::PushButtonStyle03);
62  QVBoxLayout *grid = new QVBoxLayout(function);
63 
64  QLabel *firstLabel = new QLabel(function);
65  firstLabel->setText(tr("Like \"<font color=#158FE1> %1 </font>\" also like this").arg(m_value));
66  grid->addWidget(firstLabel);
67  //
68  grid->addWidget(m_container);
69 
70  m_mainWindow->layout()->addWidget(function);
71 }
virtual void setQueryInput(MusicAbstractQueryRequest *query)
virtual void createResultItem(const MusicResultInfoItem &songItem) overridefinal
virtual void setCurrentValue(const QString &value) overridefinal
MusicItemQueryTableWidget * m_queryTableWidget
MusicSimilarQueryWidget(QWidget *parent=nullptr)
static const QString CheckBoxStyle01
CheckBox.
The class of the similar music query table widget.
TTK_MODULE_EXPORT QString generateSongTitle(const QString &name, const QString &key=TTK_DEFAULT_STR)
Definition: musicsong.cpp:117
virtual void setCurrentValue(const QString &value)
The class of the query item table widget.
static const QString PushButtonStyle03
virtual void removeItems() overridefinal
virtual void resizeWidget() overridefinal
The class of the item query widget base.
#define SONG_PAGE_SIZE
TTK_MODULE_EXPORT void generateVScrollAreaFormat(QWidget *widget, QWidget *parent, bool background=true)
The class of the search result info item.
virtual void startToSearchByText(const QString &text) overridefinal
virtual void createResultItem(const MusicResultInfoItem &songItem) override
#define G_DOWNLOAD_QUERY_PTR
MusicSimilarQueryTableWidget(QWidget *parent=nullptr)