TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicitemdelegate.cpp
Go to the documentation of this file.
1 #include "musicitemdelegate.h"
2 #include "musicitemrenameedit.h"
3 
5  : QItemDelegate(parent)
6 {
7 
8 }
9 
10 QWidget *MusicLineEditItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
11 {
12  Q_UNUSED(option);
13 
14  QString text;
15  const QAbstractItemModel *model = index.model();
16  if(model)
17  {
18  text = model->data(index, Qt::DisplayRole).toString();
19  }
20 
21  return new MusicItemRenameEidt(text, parent);
22 }
The class of the item rename edit.
MusicLineEditItemDelegate(QObject *parent=nullptr)
virtual QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const overridefinal