blob: cbd23ca19a771c2c2724f65287391ea75a2b07aa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef LISTWIDGET_H
#define LISTWIDGET_H
#include <QGraphicsWidget>
#include "simplelistview.h"
#include "scroller.h"
#include "gvbwidget.h"
class AbstractViewItem;
class QGraphicsSceneResizeEvent;
class QGraphicsGridLayout;
class QGraphicsLinearLayout;
class ListWidget : public GvbWidget
{
Q_OBJECT
public:
ListWidget(QGraphicsWidget * parent = nullptr);
virtual ~ListWidget();
void addItem(QGraphicsWidget *item);
void insertItem(int index, QGraphicsWidget *item);
QGraphicsWidget* takeItem(int row);
QGraphicsWidget* itemAt(int row);
int itemCount() const;
bool listItemCaching() const;
void setListItemCaching(bool enable);
ScrollBar* verticalScrollBar() const;
void setTwoColumns(const bool twoColumns);
bool twoColumns();
protected:
virtual void resizeEvent( QGraphicsSceneResizeEvent * event );
private:
Q_DISABLE_COPY(ListWidget)
QGraphicsLinearLayout *m_layout;
SimpleListView *m_listView;
Scroller m_scroller;
};
#endif
|