TTKMusicPlayer  4.1.3.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicsongslistplaytablewidget.cpp
Go to the documentation of this file.
4 #include "musictransformwidget.h"
6 #include "musicitemdelegate.h"
7 #include "musicmessagebox.h"
8 #include "musicprogresswidget.h"
9 #include "musicrightareawidget.h"
10 #include "musicopenfilewidget.h"
12 #include "musicapplication.h"
13 
14 #include <qmath.h>
15 #include <QAction>
16 
18  : MusicAbstractSongsListTableWidget(index, parent),
19  m_parent(parent),
20  m_dragStartIndex(-1),
21  m_mouseMoved(false),
22  m_openFileWidget(nullptr),
23  m_songsInfoWidget(nullptr),
24  m_songsPlayWidget(nullptr),
25  m_mouseLeftPressed(false),
26  m_renameActived(false),
27  m_deleteItemWithFile(false),
28  m_renameItem(nullptr),
29  m_renameEditDelegate(nullptr),
30  m_songSort(nullptr)
31 {
32  setSelectionMode(QAbstractItemView::ExtendedSelection);
33  setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
34  setColumnCount(6);
35 
36  QHeaderView *headerView = horizontalHeader();
37  headerView->resizeSection(0, 20);
38  headerView->resizeSection(1, 187);
39  headerView->resizeSection(2, 20);
40  headerView->resizeSection(3, 20);
41  headerView->resizeSection(4, 20);
42  headerView->resizeSection(5, 45);
43 
45 
46  connect(&m_timerShow, SIGNAL(timeout()), SLOT(showTimeOut()));
47  connect(&m_timerStay, SIGNAL(timeout()), SLOT(stayTimeOut()));
48  connect(this, SIGNAL(cellDoubleClicked(int,int)), MusicApplication::instance(), SLOT(playIndexClicked(int,int)));
49 }
50 
52 {
53  removeItems();
54  delete m_openFileWidget;
55  delete m_songsInfoWidget;
56  delete m_songsPlayWidget;
57  delete m_renameEditDelegate;
58 }
59 
60 void MusicSongsListPlayTableWidget::updateSongsList(const MusicSongList &songs)
61 {
63  {
64  return;
65  }
66 
67  const int count = rowCount();
68  setRowCount(songs.count());
69  QHeaderView *headerView = horizontalHeader();
70 
71  for(int i = count; i < songs.count(); ++i)
72  {
73  const MusicSong &v = songs[i];
74 
75  QTableWidgetItem *item = new QTableWidgetItem;
76  setItem(i, 0, item);
77 
78  item = new QTableWidgetItem;
79  item->setText(TTK::Widget::elidedText(font(), v.name(), Qt::ElideRight, headerView->sectionSize(1) - 10));
80  item->setForeground(QColor(TTK::UI::Color01));
81  QtItemSetTextAlignment(item, Qt::AlignLeft | Qt::AlignVCenter);
82  setItem(i, 1, item);
83 
84  item = new QTableWidgetItem;
85  setItem(i, 2, item);
86 
87  item = new QTableWidgetItem;
88  setItem(i, 3, item);
89 
90  item = new QTableWidgetItem;
91  setItem(i, 4, item);
92 
93  item = new QTableWidgetItem(v.duration());
94  item->setForeground(QColor(TTK::UI::Color01));
95  QtItemSetTextAlignment(item, Qt::AlignLeft | Qt::AlignVCenter);
96  setItem(i, 5, item);
97  }
98 
99  setFixedHeight(totalHeight());
100 }
101 
103 {
104  if(index < 0)
105  {
106  return;
107  }
108 
110 
112  for(int i = 0; i < columnCount(); ++i)
113  {
114  delete takeItem(index, i);
115  }
116 
117  QString durationLabel;
118  const QString &name = !m_songs->isEmpty() ? m_songs->at(index).name() : QString();
119  const QString &path = !m_songs->isEmpty() ? m_songs->at(index).path() : QString();
120 
121  m_songsPlayWidget = new MusicSongsListPlayWidget(index, this);
122  m_songsPlayWidget->initialize(name, path, durationLabel);
123 
124  if(!m_songs->isEmpty())
125  {
126  MusicSong *song = &(*m_songs)[index];
127  if(song->duration().isEmpty() || song->duration() == TTK_TIME_INIT)
128  {
129  song->setDuration(durationLabel);
130  }
131  }
132 
133  setSpan(index, 0, 1, 6);
134  setCellWidget(index, 0, m_songsPlayWidget);
135  setRowHeight(index, TTK_ITEM_SIZE_2XL);
136  m_playRowIndex = index;
137 
138  setFixedHeight(totalHeight());
139 }
140 
141 void MusicSongsListPlayTableWidget::updateSearchFileName(MusicSongList *songs, const TTKIntList &result)
142 {
143  m_searchedSongs.clear();
144  if(songs->count() == result.count())
145  {
146  m_songs = songs;
147  }
148  else
149  {
151  for(int index : qAsConst(result))
152  {
153  m_songs->append(songs->at(index));
154  }
155  }
156 
157  removeItems();
158  if(!m_songs->isEmpty())
159  {
161  }
162  else
163  {
164  setFixedHeight(totalHeight());
165  }
166 }
167 
168 void MusicSongsListPlayTableWidget::updateDurationLabel(const QString &current, const QString &total) const
169 {
171  {
172  m_songsPlayWidget->updateDurationLabel(current, total);
173  }
174 }
175 
177 {
179  {
181  }
182 }
183 
185 {
186  if(m_playRowIndex >= rowCount() || m_playRowIndex < 0)
187  {
188  return;
189  }
190 
191  const QString &name = !m_songs->isEmpty() ? m_songs->at(m_playRowIndex).name() : QString();
192 
193  setRowHeight(m_playRowIndex, TTK_ITEM_SIZE_M);
194 
195  removeCellWidget(m_playRowIndex, 0);
196  delete takeItem(m_playRowIndex, 0);
197  clearSpans();
198 
199  QHeaderView *headerView = horizontalHeader();
200  QTableWidgetItem *item = new QTableWidgetItem;
201  setItem(m_playRowIndex, 0, item);
202 
203  item = new QTableWidgetItem(TTK::Widget::elidedText(font(), name, Qt::ElideRight, headerView->sectionSize(1) - 10));
204  item->setForeground(QColor(TTK::UI::Color01));
205  QtItemSetTextAlignment(item, Qt::AlignLeft | Qt::AlignVCenter);
206 
207  setItem(m_playRowIndex, 1, item);
208  setItem(m_playRowIndex, 2, new QTableWidgetItem);
209  setItem(m_playRowIndex, 3, new QTableWidgetItem);
210  setItem(m_playRowIndex, 4, new QTableWidgetItem);
211 
212  item = new QTableWidgetItem((*m_songs)[m_playRowIndex].duration());
213  item->setForeground(QColor(TTK::UI::Color01));
214  QtItemSetTextAlignment(item, Qt::AlignLeft | Qt::AlignVCenter);
215  setItem(m_playRowIndex, 5, item);
216 
217  delete m_songsPlayWidget;
218  m_songsPlayWidget = nullptr;
219 
220  m_playRowIndex = -1;
221  setFixedHeight(totalHeight());
222 }
223 
225 {
226  if(m_songs->isEmpty() && TTK::playlistRowValid(m_playlistRow))
227  {
228  setFixedSize(LEFT_SIDE_WIDTH_MIN, 100);
229  if(m_openFileWidget == nullptr && m_parent)
230  {
232  connect(m_openFileWidget, SIGNAL(uploadFileClicked()), m_parent, SLOT(importSongsByFiles()));
233  connect(m_openFileWidget, SIGNAL(uploadDirClicked()), m_parent, SLOT(importSongsByDir()));
234  m_openFileWidget->adjustWidgetRect(width(), height());
235  }
236 
237  if(m_openFileWidget)
238  {
239  m_openFileWidget->raise();
240  m_openFileWidget->show();
241  }
242  return true;
243  }
244  else
245  {
246  delete m_openFileWidget;
247  m_openFileWidget = nullptr;
248  }
249  return false;
250 }
251 
253 {
254  QTableWidgetItem *it = item(m_previousColorRow, 0);
255  if(it)
256  {
257  it->setIcon(QIcon());
258  }
259 
260  it = item(m_previousColorRow, 2);
261  if(it)
262  {
263  it->setIcon(QIcon());
264  }
265 
266  it = item(m_previousColorRow, 3);
267  if(it)
268  {
269  it->setIcon(QIcon());
270  }
271 
272  it = item(m_previousColorRow, 4);
273  if(it)
274  {
275  it->setIcon(QIcon());
276  }
277 
278  it = item(m_previousColorRow, 5);
279  if(it)
280  {
281  it->setIcon(QIcon());
282  it->setText((*m_songs)[m_previousColorRow].duration());
283  }
284 
286  if(it = item(row, 0))
287  {
288  it->setIcon(QIcon(":/tiny/btn_play_later_normal"));
289  }
290 
291  if(it = item(row, 2))
292  {
293  it->setIcon(QIcon(":/tiny/btn_mv_normal"));
294  }
295 
296  if(it = item(row, 3))
297  {
298  const bool contains = MusicApplication::instance()->containsLovestItem(row);
299  it->setIcon(QIcon(contains ? ":/tiny/btn_loved_normal" : ":/tiny/btn_unloved_normal"));
300  }
301 
302  if(it = item(row, 4))
303  {
304  it->setIcon(QIcon(":/tiny/btn_delete_normal"));
305  }
306 
307  if(it = item(row, 5))
308  {
309  it->setText({});
310  it->setIcon(QIcon(":/tiny/btn_more_normal"));
311  }
312 
313  if(column != 1)
314  {
315  setCursor(QCursor(Qt::PointingHandCursor));
316  }
317  else
318  {
319  unsetCursor();
320  }
321 
323 
324  //To show music Songs Item information
325  if(m_songsInfoWidget == nullptr)
326  {
328  m_songsInfoWidget->hide();
329  }
330 
331  m_timerShow.stop();
332  m_timerShow.start(0.5 * TTK_DN_S2MS);
333 
334  m_timerStay.stop();
335  m_timerStay.start(3 * TTK_DN_S2MS);
336 }
337 
339 {
340  if(row == m_playRowIndex)
341  {
342  return;
343  }
344 
345  switch(column)
346  {
347  case 0:
348  {
349  addToPlayLater();
350  break;
351  }
352  case 2:
353  {
355  break;
356  }
357  case 3:
358  {
359  bool empty;
360  Q_EMIT isSearchedResultEmpty(empty);
361 
362  if(empty)
363  {
364  const bool contains = !MusicApplication::instance()->containsLovestItem(row);
365  QTableWidgetItem *it = item(row, 3);
366  if(it)
367  {
368  it->setIcon(QIcon(contains ? ":/tiny/btn_loved_normal" : ":/tiny/btn_unloved_normal"));
369  }
370  Q_EMIT addSongToLovestList(contains, row);
371  }
372  break;
373  }
374  case 4:
375  {
376  bool empty;
377  Q_EMIT isSearchedResultEmpty(empty);
378 
379  if(empty)
380  {
381  removeItemAt();
382  }
383  break;
384  }
385  case 5:
386  {
387  QMenu menu(this);
388  createMoreMenu(&menu);
389  menu.exec(QCursor::pos());
390  break;
391  }
392  default: break;
393  }
394 }
395 
397 {
398 // if(m_playRowIndex < 0)
399 // {
400 // return;
401 // }
402 
403  //Remove play widget
404  setRowHeight(m_playRowIndex, TTK_ITEM_SIZE_M);
405  removeCellWidget(m_playRowIndex, 0);
406 
407  delete m_songsPlayWidget;
408  m_songsPlayWidget = nullptr;
409 
410  m_playRowIndex = -1;
411  //Remove all the original item
413  setColumnCount(6);
414 }
415 
417 {
418  MusicMessageBox message;
419  message.setText(tr("Are you sure to delete?"));
420  if(!message.exec() || !isValid())
421  {
422  clearSelection();
423  return;
424  }
425 
426  const TTKIntList deletedList(selectedIndexList());
427  if(deletedList.isEmpty())
428  {
429  return;
430  }
431 
432  MusicProgressWidget progress;
433  progress.show();
434  progress.setTitle(tr("Delete file mode"));
435  progress.setRange(0, deletedList.count() / 3 * 2);
436 
437  for(int i = 0; i < deletedList.count(); ++i)
438  {
439  if(i % 3 == 0)
440  {
441  progress.setValue(i / 3);
442  }
443  }
444 
445  if(deletedList.contains(m_playRowIndex) || deletedList[0] < m_playRowIndex)
446  {
448  }
449 
450  for(int i = deletedList.count() - 1; i >= 0; --i)
451  {
452  const int index = deletedList[i];
453  removeRow(index);
454  progress.setValue(deletedList.count() * 2 - i);
455  }
456 
457  setFixedHeight(totalHeight());
458  Q_EMIT deleteItemAt(deletedList, m_deleteItemWithFile);
459 }
460 
462 {
463  m_deleteItemWithFile = true;
464  removeItemAt();
465  m_deleteItemWithFile = false;
466 }
467 
469 {
470  if(!isValid())
471  {
472  return;
473  }
474 
475  //the playing widget allow renaming
476  if((currentRow() == m_playRowIndex) && m_songsPlayWidget)
477  {
479  return;
480  }
481 
482  //others
483  delete m_renameEditDelegate;
485  setItemDelegateForRow(currentRow(), m_renameEditDelegate);
486 
487  m_renameActived = true;
488  m_renameItem = item(currentRow(), 1);
489  m_renameItem->setText((*m_songs)[m_renameItem->row()].name());
490  openPersistentEditor(m_renameItem);
491  editItem(m_renameItem);
492 }
493 
495 {
496  if(!isValid())
497  {
498  return;
499  }
500 
502 }
503 
505 {
506  if(!isValid())
507  {
508  return;
509  }
510 
511  MusicTransformWidget(this).exec();
512 }
513 
515 {
516  if(action->data().isNull())
517  {
518  return;
519  }
520 
521  MusicRightAreaWidget::instance()->showSongSearchedFound(action->data().toString());
522 }
523 
525 {
526  const int row = TTKObjectCast(QPushButton*, sender()) ? m_playRowIndex : currentRow();
527  if(rowCount() == 0 || row < 0)
528  {
529  return;
530  }
531 
533 }
534 
536 {
537  const int row = currentRow();
538  if(rowCount() == 0 || row < 0)
539  {
540  return;
541  }
542 
544 }
545 
547 {
548  if(m_playRowIndex >= rowCount() || m_playRowIndex < 0)
549  {
550  return;
551  }
552 
553  (*m_songs)[m_playRowIndex].setName(name);
554 }
555 
557 {
558  const int newType = action->data().toInt();
559  if(newType < 0 || newType > 5)
560  {
561  return;
562  }
563 
564  if(m_songSort)
565  {
566  const int type = m_songSort->m_type;
567  m_songSort->m_type = newType;
568 
569  if(type == newType)
570  {
571  const bool asc = m_songSort->m_order == Qt::AscendingOrder;
572  m_songSort->m_order = asc ? Qt::DescendingOrder : Qt::AscendingOrder;
573  }
574  else
575  {
576  m_songSort->m_order = Qt::AscendingOrder;
577  }
579  }
580 }
581 
583 {
584  m_timerShow.stop();
585  if(!m_songsInfoWidget || m_previousColorRow < 0 || m_previousColorRow >= m_songs->count())
586  {
587  return;
588  }
589 
590  const MusicSong &song = (*m_songs)[m_previousColorRow];
592  m_songsInfoWidget->move(mapToGlobal(QPoint(width(), 0)).x() + 8, QCursor::pos().y());
593 
594  bool state;
595  Q_EMIT isCurrentPlaylistRow(state);
596  m_songsInfoWidget->setVisible(state ? (m_songsPlayWidget && !m_songsPlayWidget->isRenameMode()) : true);
597 }
598 
600 {
601  m_timerStay.stop();
602  delete m_songsInfoWidget;
603  m_songsInfoWidget = nullptr;
604 }
605 
607 {
608  MusicAbstractSongsListTableWidget::mousePressEvent(event);
609  closeRenameItem();
610 
611  if(event->button() == Qt::LeftButton)
612  {
613  m_mouseLeftPressed = true;
614  m_dragStartIndex = currentRow();
615  m_dragStartPoint = event->pos();
616  }
617 }
618 
620 {
621  MusicAbstractSongsListTableWidget::mouseMoveEvent(event);
622  if(m_mouseLeftPressed && abs(m_dragStartPoint.y() - event->pos().y()) > 15)
623  {
624  m_mouseMoved = true;
625  setCursor(QCursor(QPixmap(":/functions/lb_drag_cursor")));
626  }
627 }
628 
630 {
631  MusicAbstractSongsListTableWidget::mouseReleaseEvent(event);
632  startToDrag();
633 
634  m_mouseMoved = false;
635  m_mouseLeftPressed = false;
636  setCursor(QCursor(Qt::ArrowCursor));
637 }
638 
640 {
642 
643  delete m_songsInfoWidget;
644  m_songsInfoWidget = nullptr;
645  closeRenameItem();
646 }
647 
649 {
651  closeRenameItem();
652  Q_EMIT showFloatWidget();
653 }
654 
656 {
657  Q_UNUSED(event);
658  QMenu menu(this);
659  menu.setStyleSheet(TTK::UI::MenuStyle02);
660  menu.addAction(QIcon(":/contextMenu/btn_play"), tr("Play"), this, SLOT(playClicked()));
661  menu.addAction(tr("Play Later"), this, SLOT(addToPlayLater()));
662  menu.addAction(tr("Add To Playlist"), this, SLOT(addToPlayedList()));
663  menu.addAction(tr("Download More..."), this, SLOT(showDownloadWidget()));
664  menu.addSeparator();
665 
666  QMenu sortFiles(tr("Sort"), &menu);
667  sortFiles.addAction(tr("Sort By FileName"))->setData(0);
668  sortFiles.addAction(tr("Sort By Singer"))->setData(1);
669  sortFiles.addAction(tr("Sort By FileSize"))->setData(2);
670  sortFiles.addAction(tr("Sort By AddTime"))->setData(3);
671  sortFiles.addAction(tr("Sort By Duration"))->setData(4);
672  sortFiles.addAction(tr("Sort By PlayCount"))->setData(5);
674  connect(&sortFiles, SIGNAL(triggered(QAction*)), SLOT(songListSortBy(QAction*)));
675 
676  if(m_songSort)
677  {
678  const QList<QAction*> actions(sortFiles.actions());
679  if(-1 < m_songSort->m_type && m_songSort->m_type < actions.count())
680  {
681  const bool asc = m_songSort->m_order == Qt::AscendingOrder;
682  actions[m_songSort->m_type]->setIcon(QIcon(asc ? ":/tiny/lb_sort_asc" : ":/tiny/lb_sort_desc"));
683  }
684  }
685  menu.addMenu(&sortFiles);
686 
687  menu.addAction(tr("Found Movie"), this, SLOT(showMovieQueryWidget()));
688  menu.addSeparator();
689 
690  createMoreMenu(&menu);
691 
692  QMenu toolMenu(tr("Tools"), &menu);
693  toolMenu.addAction(tr("Make Bell"), this, SLOT(showMakeRingWidget()));
694  toolMenu.addAction(tr("Make Transform"), this, SLOT(showTransformWidget()));
695  menu.addMenu(&toolMenu);
697 
698  bool status = !(m_songs->isEmpty() || TTK::String::isNetworkUrl(currentSongPath()));
699  menu.addAction(tr("Song Info..."), this, SLOT(showFileInformation()))->setEnabled(status);
700  menu.addAction(QIcon(":/contextMenu/btn_local_file"), tr("Open File Dir"), this, SLOT(openFileDir()))->setEnabled(status);
701  menu.addAction(QIcon(":/contextMenu/btn_ablum"), tr("Ablum"), this, SLOT(showAlbumQueryWidget()));
702  menu.addSeparator();
703 
704  status = false;
705  Q_EMIT isSearchedResultEmpty(status);
706  menu.addAction(tr("Rename"), this, SLOT(setChangSongName()))->setEnabled(status);
707  menu.addAction(QIcon(":/contextMenu/btn_delete"), tr("Delete"), this, SLOT(removeItemAt()))->setEnabled(status);
708  menu.addAction(tr("Delete With File"), this, SLOT(removeItemWithFile()))->setEnabled(status);
709  menu.addAction(tr("Delete All"), this, SLOT(clearItems()))->setEnabled(status);
710  menu.addSeparator();
711 
712  const QString &songName = currentSongName();
713  QString name = TTK::generateSongTitle(songName);
714  menu.addAction(tr("Search '%1'").arg(name))->setData(name);
715 
716  const QStringList artists(TTK::String::split(TTK::generateSongArtist(songName), ";"));
717  for(int i = 0; i < artists.count(); ++i)
718  {
719  name = artists[i].trimmed();
720  menu.addAction(tr("Search '%1'").arg(name))->setData(name);
721  }
722  menu.addAction(tr("Search '%1'").arg(songName))->setData(songName);
723 
724  connect(&menu, SIGNAL(triggered(QAction*)), SLOT(searchQueryByName(QAction*)));
725  menu.exec(QCursor::pos());
726 }
727 
729 {
730  if(!m_renameItem)
731  {
732  return;
733  }
734 
735  //just close the rename editor;
736  if(m_renameActived)
737  {
738  closePersistentEditor(m_renameItem);
739  }
740  //it may be a bug in closePersistentEditor,so we select
741  //the two if function to deal with
742  if(m_renameActived)
743  {
744  QHeaderView *headerView = horizontalHeader();
745  (*m_songs)[m_renameItem->row()].setName(m_renameItem->text());
746  m_renameItem->setText(TTK::Widget::elidedText(font(), m_renameItem->text(), Qt::ElideRight, headerView->sectionSize(1) - 10));
747 
748  m_renameActived = false;
749  setItemDelegateForRow(m_renameItem->row(), nullptr);
750  m_renameItem = nullptr;
751 
752  delete m_renameEditDelegate;
753  m_renameEditDelegate = nullptr;
754  }
755 }
756 
758 {
759  bool empty;
760  Q_EMIT isSearchedResultEmpty(empty);
761 
762  if(empty && m_dragStartIndex > -1 && m_mouseLeftPressed && m_mouseMoved)
763  {
764  MusicSongList songs;
765  const int start = m_dragStartIndex;
766  const int end = currentRow();
767  int index = m_playRowIndex;
768 
769  if(m_playRowIndex == start)
770  {
771  index = end;
772  }
773  else if(m_playRowIndex == end)
774  {
775  index = (start > end) ? (end + 1) : (end - 1);
776  }
777  else
778  {
779  if(start > m_playRowIndex && end < m_playRowIndex)
780  {
781  ++index;
782  }
783  else if(start < m_playRowIndex && end > m_playRowIndex)
784  {
785  --index;
786  }
787  }
788 
789  Q_EMIT itemIndexSwaped(start, end, index, songs);
790  for(int i = qMin(start, end); i <= qMax(start, end); ++i)
791  {
792  if(i == index)
793  {
794  continue; //skip the current play item index, because the play widget just has one item
795  }
796 
797  QHeaderView *headerView = horizontalHeader();
798  item(i, 1)->setText(TTK::Widget::elidedText(font(), songs[i].name(), Qt::ElideRight, headerView->sectionSize(1) - 10));
799  item(i, 5)->setText(songs[i].duration());
800  }
801 
802  bool state;
803  Q_EMIT isCurrentPlaylistRow(state);
804 
805  if(state)
806  {
807  selectRow(index);
808  }
809  }
810 }
bool containsLovestItem() const
static MusicRightAreaWidget * instance()
The class of the song list play widget.
TTK_MODULE_EXPORT QString generateSongArtist(const QString &name, const QString &key=TTK_DEFAULT_STR)
Definition: musicsong.cpp:121
static MusicApplication * instance()
void setText(const QString &text) const
TTK_MODULE_EXPORT bool playlistRowValid(int index)
Definition: musicsong.cpp:95
virtual void leaveEvent(QEvent *event) override
void initialize(int index, const MusicSong &song)
The class of the show progress widget.
void adjustWidgetRect(int w, int h)
MusicSongsListItemInfoWidget * m_songsInfoWidget
virtual void itemCellEntered(int row, int column) overridefinal
void songListSortBy(int index)
The class of the messagebox widget.
virtual void contextMenuEvent(QContextMenuEvent *event) overridefinal
virtual void mouseReleaseEvent(QMouseEvent *event) overridefinal
TTK_MODULE_EXPORT QString generateSongTitle(const QString &name, const QString &key=TTK_DEFAULT_STR)
Definition: musicsong.cpp:110
#define QtItemSetTextAlignment(p, a)
Item text alignment.
Definition: ttkqtcompat.h:45
The class of the song ringtone maker widget.
static MusicPlayedListPopWidget * instance()
virtual void selectRow(int index) overridefinal
void addSongToLovestList(bool state, int row)
void showSongSearchedFound(const QString &text)
MusicSongsListPlayTableWidget(int index, QWidget *parent=nullptr)
void setTitle(const QString &name)
void updateSearchFileName(MusicSongList *songs, const TTKIntList &result)
#define TTK_TIME_INIT
Definition: ttkglobal.h:225
#define TTK_ITEM_SIZE_2XL
Definition: ttkglobal.h:250
virtual void updateSongsList(const MusicSongList &songs) overridefinal
QList< int > TTKIntList
Definition: ttkqtglobal.h:204
#define qAsConst
Definition: ttkqtglobal.h:51
const char * name
Definition: http_parser.c:458
virtual void mousePressEvent(QMouseEvent *event) overridefinal
TTK_MODULE_EXPORT void setTransparent(QWidget *widget, int alpha)
The class of the song list item info widget.
MusicLineEditItemDelegate * m_renameEditDelegate
TTK_MODULE_EXPORT QString elidedText(const QFont &font, const QString &text, Qt::TextElideMode mode, int width)
virtual void itemCellEntered(int row, int column)
MusicSongsListPlayWidget * m_songsPlayWidget
The class of the lineedit item delegate.
TTK_MODULE_EXPORT QStringList split(const QString &value, const QString &key=TTK_DEFAULT_STR)
void initialize(const QString &name, const QString &path, QString &time)
void itemIndexSwaped(int start, int end, int play, MusicSongList &songs)
void isCurrentPlaylistRow(bool &state)
QString duration() const noexcept
Definition: musicsong.h:106
QString name() const noexcept
Definition: musicsong.h:82
static const QString MenuStyle02
void append(const MusicSongList &songs)
#define TTK_DN_S2MS
Definition: ttkglobal.h:281
void setDuration(const QString &t) noexcept
Definition: musicsong.h:102
virtual void leaveEvent(QEvent *event) overridefinal
void updateDurationLabel(const QString &current, const QString &total)
virtual void itemCellClicked(int row, int column) overridefinal
virtual void mouseMoveEvent(QMouseEvent *event) overridefinal
virtual void wheelEvent(QWheelEvent *event) override
void isSearchedResultEmpty(bool &empty)
void insert(int playlistRow, const MusicSong &song)
virtual void wheelEvent(QWheelEvent *event) overridefinal
TTKIntList selectedIndexList() const
static constexpr unsigned int Color01
Color QRgb.
Definition: musicuiobject.h:32
The class of the music song info.
Definition: musicsong.h:28
Qt::SortOrder m_order
Definition: musicsong.h:145
void updateDurationLabel(const QString &current, const QString &total) const
TTK_MODULE_EXPORT void adjustMenuPosition(QMenu *menu)
The class of the transform widget.
The class of the open file widget.
#define TTK_ITEM_SIZE_M
Definition: ttkglobal.h:247
void deleteItemAt(const TTKIntList &index, bool fileRemove)
The class of the songs list abstract table widget.
state
Definition: http_parser.c:279
TTK_MODULE_EXPORT bool isNetworkUrl(const QString &path)
#define TTKObjectCast(x, y)
Definition: ttkqtglobal.h:76
#define LEFT_SIDE_WIDTH_MIN
Definition: musicobject.h:157