2012-06-29 14:21:22 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 2012 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef SKLISTWIDGET_H_
|
|
|
|
#define SKLISTWIDGET_H_
|
|
|
|
|
|
|
|
#include <QAbstractItemDelegate>
|
|
|
|
#include <QPainter>
|
|
|
|
|
|
|
|
/** \class SkListWidget
|
|
|
|
|
|
|
|
This widget contains the draw commands.
|
|
|
|
*/
|
|
|
|
class SkListWidget : public QAbstractItemDelegate {
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructs the list widget with the specified parent for layout purposes.
|
|
|
|
@param parent The parent container of this widget
|
|
|
|
*/
|
2015-08-27 14:41:13 +00:00
|
|
|
SkListWidget(QObject* parent = nullptr) {}
|
2012-06-29 14:21:22 +00:00
|
|
|
|
2014-03-25 23:31:33 +00:00
|
|
|
virtual ~SkListWidget() {}
|
2012-06-29 14:21:22 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Draws the current state of the widget. Overriden from QWidget.
|
|
|
|
*/
|
2014-03-25 23:31:33 +00:00
|
|
|
void paint(QPainter* painter, const QStyleOptionViewItem& option,
|
|
|
|
const QModelIndex& index ) const;
|
2012-06-29 14:21:22 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the default size of the widget. Overriden from QWidget.
|
|
|
|
*/
|
2014-03-25 23:31:33 +00:00
|
|
|
QSize sizeHint(const QStyleOptionViewItem& option,
|
|
|
|
const QModelIndex& index) const;
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|