QtBase  v6.3.1
recycledlistitem.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2016 The Qt Company Ltd.
4 ** Contact: https://www.qt.io/licensing/
5 **
6 ** This file is part of the examples of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:GPL-EXCEPT$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see https://www.qt.io/terms-conditions. For further
15 ** information use the contact form at https://www.qt.io/contact-us.
16 **
17 ** GNU General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU
19 ** General Public License version 3 as published by the Free Software
20 ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
21 ** included in the packaging of this file. Please review the following
22 ** information to ensure the GNU General Public License requirements will
23 ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24 **
25 ** $QT_END_LICENSE$
26 **
27 ****************************************************************************/
28 
29 #ifndef RECYCLEDLISTITEM_H
30 #define RECYCLEDLISTITEM_H
31 
32 #include "abstractviewitem.h"
33 
34 class ListItem;
35 class QGraphicsWidget;
37 
39 {
40  Q_OBJECT
41 public:
43  virtual ~RecycledListItem();
44 
45  virtual void setModel(QAbstractItemModel *model);
46 
48  virtual void updateItemContents();
49 
50  virtual QVariant data(int role) const;
51  virtual void setData(const QVariant &value, int role = Qt::DisplayRole);
52 
53  ListItem *item() { return m_item; }
54 
55  void setTwoColumns(const bool enabled);
56 
57 protected:
58  virtual QSizeF effectiveSizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
60 
61 private:
63 
64  ListItem *m_item;
65  ListItem *m_item2;
66  QAbstractItemModel *m_model;
67  QGraphicsGridLayout *m_layout;
68 };
69 
70 #endif // RECYCLEDLISTITEM_H
The QAbstractItemModel class provides the abstract interface for item model classes.
The QGraphicsGridLayout class provides a grid layout for managing widgets in Graphics View.
QGraphicsObject * parent
the parent of the item
The QGraphicsSceneResizeEvent class provides events for widget resizing in the graphics view framewor...
The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene.
The QSizeF class defines the size of a two-dimensional object using floating point precision.
Definition: qsize.h:235
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:95
virtual void setData(const QVariant &value, int role=Qt::DisplayRole)
virtual void resizeEvent(QGraphicsSceneResizeEvent *event)
ListItem * item()
virtual QSizeF effectiveSizeHint(Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const
virtual QVariant data(int role) const
virtual AbstractViewItem * newItemInstance()
virtual ~RecycledListItem()
void setTwoColumns(const bool enabled)
virtual void setModel(QAbstractItemModel *model)
virtual void updateItemContents()
RecycledListItem(QGraphicsWidget *parent=0)
@ DisplayRole
Definition: qnamespace.h:1502
SizeHint
Definition: qnamespace.h:1589
EGLOutputLayerEXT EGLint EGLAttrib value
#define Q_DISABLE_COPY(Class)
Definition: qglobal.h:515
GLenum GLenum GLsizei const GLuint GLboolean enabled
struct _cl_event * event
Definition: qopenglext.h:2998
#define Q_OBJECT
Definition: qtmetamacros.h:158
QSqlQueryModel * model
[16]