aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui/radioitemdelegate_p.h
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2012-08-29 20:39:30 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2012-08-29 20:39:30 +0000
commit471b1754f75e462cb6e5dc52d66bdec5745c92e0 (patch)
tree9dbc1541bb9221077cc953991e3b485def9717c6 /src/qmmpui/radioitemdelegate_p.h
parent1abba773217ac19dbcc7f413bfaf8376caf8ba42 (diff)
downloadqmmp-471b1754f75e462cb6e5dc52d66bdec5745c92e0.tar.gz
qmmp-471b1754f75e462cb6e5dc52d66bdec5745c92e0.tar.bz2
qmmp-471b1754f75e462cb6e5dc52d66bdec5745c92e0.zip
changed configuration dialog
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2908 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/radioitemdelegate_p.h')
-rw-r--r--src/qmmpui/radioitemdelegate_p.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/qmmpui/radioitemdelegate_p.h b/src/qmmpui/radioitemdelegate_p.h
new file mode 100644
index 000000000..b429401ab
--- /dev/null
+++ b/src/qmmpui/radioitemdelegate_p.h
@@ -0,0 +1,45 @@
+/***************************************************************************
+ * Copyright (C) 2012 by Ilya Kotov *
+ * forkotov02@hotmail.ru *
+ * *
+ * 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. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+#ifndef RADIOITEMDELEGATE_P_H
+#define RADIOITEMDELEGATE_P_H
+
+#include <QStyledItemDelegate>
+#include <QSize>
+
+#define RadioButtonRole (Qt::UserRole + 1)
+
+/*! @internal
+ * @author Ilya Kotov <forkotov02@hotmail.ru>
+ */
+class RadioItemDelegate : public QStyledItemDelegate
+{
+ Q_OBJECT
+public:
+ explicit RadioItemDelegate(QObject *parent = 0);
+
+ void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
+ QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
+ bool editorEvent(QEvent *event, QAbstractItemModel *model,
+ const QStyleOptionViewItem &option, const QModelIndex &index);
+ bool hasRadioButton(const QModelIndex &index) const;
+};
+
+#endif // RADIOITEMDELEGATE_P_H