KDEGames

kchatbaseitemdelegate.h
1 /*
2  This file is part of the KDE games library
3  Copyright (C) 2007 Gael de Chalendar (aka Kleag) <[email protected]>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 #ifndef __KCHATBASEITEMDELEGATE_H__
20 #define __KCHATBASEITEMDELEGATE_H__
21 
22 #include <QAbstractItemDelegate>
23 
24 #include "libkdegamesprivate_export.h"
25 
37 class KDEGAMESPRIVATE_EXPORT KChatBaseItemDelegate : public QAbstractItemDelegate
38 {
39  Q_OBJECT
40 
41  public:
45  explicit KChatBaseItemDelegate(QObject *parent = nullptr);
46 
50  virtual ~KChatBaseItemDelegate();
51 
58  void paint(QPainter *painter, const QStyleOptionViewItem &option,
59  const QModelIndex &index) const override;
60 
61  void paint(QPainter *painter,
62  const QStyleOptionViewItem &option,
63  const QModelIndex &index,
64  const QString& sender,
65  const QString& message) const;
72  QSize sizeHint(const QStyleOptionViewItem &option,
73  const QModelIndex &index ) const override;
74 
75  virtual QSize sizeHint(const QStyleOptionViewItem &option,
76  const QModelIndex &index, const QString& sender,
77  const QString& message) const;
78 };
79 
80 #endif
A delegate (see the Qt Model/View module for details) to paint the lines of the KChatBase list model ...
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const const =0
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const const =0
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Nov 30 2020 22:37:54 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.