blob: 06114612809d7021b239256679a43b650947c577 [file] [log] [blame]
Yingdi Yu0b0a7362014-08-05 16:31:30 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2013, Regents of the University of California
4 * Yingdi Yu
5 *
6 * BSD license, See the LICENSE file for more information
7 *
8 * Author: Yingdi Yu <yingdi@cs.ucla.edu>
9 */
10
Yingdi Yueb692ac2015-02-10 18:46:18 -080011#ifndef CHRONOCHAT_ENDORSE_COMBOBOX_DELEGATE_HPP
12#define CHRONOCHAT_ENDORSE_COMBOBOX_DELEGATE_HPP
Yingdi Yu0b0a7362014-08-05 16:31:30 -070013
14#include <QItemDelegate>
15#include <string>
16#include <vector>
17
Yingdi Yueb692ac2015-02-10 18:46:18 -080018namespace chronochat {
Yingdi Yu0b0a7362014-08-05 16:31:30 -070019
20class EndorseComboBoxDelegate : public QItemDelegate
21{
22 Q_OBJECT
23public:
24 EndorseComboBoxDelegate(QObject* parent = 0);
25
26 // virtual
27 // ~ComboBoxDelegate() {}
28
29 QWidget*
30 createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const;
31
32 void
33 setEditorData(QWidget* editor, const QModelIndex& index) const;
34
35 void
36 setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const;
37
38 void
39 updateEditorGeometry(QWidget* editor,
40 const QStyleOptionViewItem& option,
41 const QModelIndex& index) const;
42
43 void
44 paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
45
46private:
47 std::vector<std::string> m_items;
48
49};
50
Yingdi Yueb692ac2015-02-10 18:46:18 -080051} // namespace chronochat
Yingdi Yu0b0a7362014-08-05 16:31:30 -070052
Yingdi Yueb692ac2015-02-10 18:46:18 -080053#endif // CHRONOCHAT_ENDORSE_COMBOBOX_DELEGATE_HPP