QtBase  v6.3.1
simplelist.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 SIMPLELIST_H_
30 #define SIMPLELIST_H_
31 
32 
33 #include "gvbwidget.h"
34 #include "listitem.h"
35 #include "listwidget.h"
36 
37 class QGraphicsWidget;
38 
39 class SimpleList : public GvbWidget
40 {
41  Q_OBJECT
42 
43 public:
45  virtual ~SimpleList();
46  void addItem(ListItem *item);
47  void insertItem(int index, ListItem *item);
48  ListItem* takeItem(int row);
49  ListItem* itemAt(int row);
50  int itemCount() const;
51  virtual void keyPressEvent(QKeyEvent *event);
52  bool listItemCaching() const;
53  void setListItemCaching(bool enable);
54 
55  void setTwoColumns(const bool twoColumns);
56  bool twoColumns();
57 
58 public slots:
60 
61 private:
63 
64  ListWidget *m_list;
65 };
66 
67 #endif /* LISTTEST_H_ */
QGraphicsObject * parent
the parent of the item
The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene.
The QKeyEvent class describes a key event.
Definition: qevent.h:471
ScrollBar * verticalScrollBar() const
Definition: simplelist.cpp:83
virtual void keyPressEvent(QKeyEvent *event)
Definition: simplelist.cpp:100
bool twoColumns()
Definition: simplelist.cpp:139
void addItem(ListItem *item)
Definition: simplelist.cpp:54
virtual ~SimpleList()
Definition: simplelist.cpp:50
void insertItem(int index, ListItem *item)
Definition: simplelist.cpp:60
void setListItemCaching(bool enable)
Definition: simplelist.cpp:95
ListItem * takeItem(int row)
Definition: simplelist.cpp:66
void setTwoColumns(const bool twoColumns)
Definition: simplelist.cpp:134
SimpleList(QGraphicsWidget *parent=0)
Definition: simplelist.cpp:37
bool listItemCaching() const
Definition: simplelist.cpp:90
ListItem * itemAt(int row)
Definition: simplelist.cpp:71
int itemCount() const
Definition: simplelist.cpp:76
#define Q_DISABLE_COPY(Class)
Definition: qglobal.h:515
GLuint index
[2]
GLboolean enable
struct _cl_event * event
Definition: qopenglext.h:2998
GLenum GLenum GLsizei void * row
Definition: qopenglext.h:2747
#define Q_OBJECT
Definition: qtmetamacros.h:158
#define slots
Definition: qtmetamacros.h:76
QGraphicsItem * item