Sayonara Player
Delegate.h
1 /* PlaylistItemDelegate.h */
2 
3 /* Copyright (C) 2011-2017 Lucio Carreras
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef PLAYLISTITEMDELEGATE_H_
22 #define PLAYLISTITEMDELEGATE_H_
23 
24 #include "Utils/Settings/SayonaraClass.h"
25 #include "GUI/Utils/Delegates/StyledItemDelegate.h"
26 #include "Utils/Pimpl.h"
27 
28 class QTableView;
31  public SayonaraClass
32 {
33  Q_OBJECT
35 
36 public:
37  explicit PlaylistItemDelegate(QTableView* parent);
38  virtual ~PlaylistItemDelegate();
39 
40  void paint( QPainter *painter, const QStyleOptionViewItem &option,
41  const QModelIndex &index) const override;
42 
43  QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
44  void setEditorData(QWidget* editor, const QModelIndex& index) const override;
45  void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override;
46 
47  int rating_height() const;
48 
49 private slots:
50  void sl_look_changed();
51  void sl_show_rating_changed();
52  void destroy_editor(bool save=false);
53 };
54 
55 
56 
57 #endif /* PLAYLISTITEMDELEGATEINTERFACE_H_ */
Definition: StyledItemDelegate.h:30
The SayonaraClass class provides access to Settings and notifications.
Definition: SayonaraClass.h:29
Definition: Delegate.h:29