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