TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musiccloudtoolboxwidget.cpp
Go to the documentation of this file.
3 
6 {
9  createWidgetItem(uploadTable, tr("Failed"), 0);
10 
12  m_songItems << MusicSongItem();
13  createWidgetItem(downloadTable, tr("Download"), 1);
14 
15  connect(uploadTable, SIGNAL(updateItemTitle(int)), SLOT(updateItemTitle(int)));
16  connect(downloadTable, SIGNAL(updateItemTitle(int)), SLOT(updateItemTitle(int)));
17 }
18 
20 {
21  while(!m_songItems.isEmpty())
22  {
23  delete m_songItems.back().m_itemWidget;
24  m_songItems.pop_back();
25  }
26 }
27 
29 {
30  if(index < 0 || index >= m_songItems.count())
31  {
32  return;
33  }
34 
35  const MusicSongItem *item = &m_songItems[index];
36  setTitle(item->m_itemWidget, QString("%1[%2]").arg(item->m_itemName).arg(item->m_songs.count()));
37 }
38 
40 {
41  MusicSongItem *item = &m_songItems.back();
42  item->m_itemName = text;
43  item->m_itemIndex = index;
44  item->m_itemWidget = widget;
45  addCellItem(widget, item->m_itemName);
46 
47  widget->setPlaylistRow(item->m_itemIndex);
48  widget->setSongsList(&item->m_songs);
49 
50  setTitle(widget, QString("%1[%2]").arg(item->m_itemName).arg(item->m_songs.count()));
51 }
52 
54 {
56  it->addCellItem(item);
57  it->setExpand(true);
58  return it;
59 }
void setTitle(QWidget *item, const QString &text)
The class of the function tool box widget.
The class of the cloud shared song download table widget.
The class of the normal tool box widget item.
MusicCloudToolBoxWidget(QWidget *parent=nullptr)
The class of the function tool box widget item.
virtual void setSongsList(MusicSongList *songs)
MusicAbstractSongsListTableWidget * m_itemWidget
Definition: musicsong.h:167
void addCellItem(QWidget *item, const QString &text)
void createWidgetItem(MusicAbstractDownloadTableWidget *widget, const QString &text, int index)
The class of the download abstract table widget.
The class of the cloud shared song upload table widget.
The class of the music song item.
Definition: musicsong.h:161
MusicSongList m_songs
Definition: musicsong.h:166
QString m_itemName
Definition: musicsong.h:164
virtual MusicFunctionToolBoxWidgetItem * initialItem(QWidget *item, const QString &text) overridefinal