blob: 4298074481d1506c4eb2a2a9f45d373a9eaab83b [file] [log] [blame]
chudy@google.com902ebe52012-06-29 14:21:22 +00001
2/*
3 * Copyright 2012 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9
10#ifndef SKLISTWIDGET_H_
11#define SKLISTWIDGET_H_
12
13#include <QAbstractItemDelegate>
14#include <QPainter>
15
16/** \class SkListWidget
17
18 This widget contains the draw commands.
19 */
20class SkListWidget : public QAbstractItemDelegate {
21public:
22 /**
23 Constructs the list widget with the specified parent for layout purposes.
24 @param parent The parent container of this widget
25 */
halcanary96fcdcc2015-08-27 07:41:13 -070026 SkListWidget(QObject* parent = nullptr) {}
chudy@google.com902ebe52012-06-29 14:21:22 +000027
commit-bot@chromium.org57f74e02014-03-25 23:31:33 +000028 virtual ~SkListWidget() {}
chudy@google.com902ebe52012-06-29 14:21:22 +000029
30 /**
31 Draws the current state of the widget. Overriden from QWidget.
32 */
commit-bot@chromium.org57f74e02014-03-25 23:31:33 +000033 void paint(QPainter* painter, const QStyleOptionViewItem& option,
34 const QModelIndex& index ) const;
chudy@google.com902ebe52012-06-29 14:21:22 +000035
36 /**
37 Returns the default size of the widget. Overriden from QWidget.
38 */
commit-bot@chromium.org57f74e02014-03-25 23:31:33 +000039 QSize sizeHint(const QStyleOptionViewItem& option,
40 const QModelIndex& index) const;
chudy@google.com902ebe52012-06-29 14:21:22 +000041};
42
43#endif