summaryrefslogtreecommitdiffstats
path: root/delegates.h
blob: 86ee94edb41fbb3cf6db0477608e0981deb44dae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version
  2 of the License, or (at your option) any later version.
*/

#ifndef DELEGATES_H
#define DELEGATES_H

#include <QString>
#include <QWidget>
#include <QStyleOptionViewItem>
#include <QStyledItemDelegate>

class FileNoDelegate : public QStyledItemDelegate {
    Q_OBJECT
    public:
        explicit FileNoDelegate(QObject *parent = 0) : QStyledItemDelegate(parent) {}
        virtual QString displayText(const QVariant &value, const QLocale &locale) const;
        virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
};

class DvdNoDelegate : public QStyledItemDelegate {
    Q_OBJECT
    public:
        explicit DvdNoDelegate(QObject *parent = 0) : QStyledItemDelegate(parent) {}
        virtual QString displayText(const QVariant &value, const QLocale &locale) const;
};

class SizeDelegate : public QStyledItemDelegate {
    Q_OBJECT
    public:
        explicit SizeDelegate(QObject *parent = 0) : QStyledItemDelegate(parent) {}
        virtual QString displayText(const QVariant &value, const QLocale &locale) const;
};

class DurationDelegate : public QStyledItemDelegate {
    Q_OBJECT
    public:
        explicit DurationDelegate(QObject *parent = 0) : QStyledItemDelegate(parent) {}
        virtual QString displayText(const QVariant &value, const QLocale &locale) const;
};

class BitrateDelegate : public QStyledItemDelegate {
    Q_OBJECT
    public:
        explicit BitrateDelegate(QObject *parent = 0) : QStyledItemDelegate(parent) {}
        virtual QString displayText(const QVariant &value, const QLocale &locale) const;
};

class EmptyDelegate : public QStyledItemDelegate {
    Q_OBJECT
    public:
        explicit EmptyDelegate(QObject *parent = 0) : QStyledItemDelegate(parent) {}
        virtual QString displayText(const QVariant &value, const QLocale &locale) const;
};

#endif // DELEGATES_H