blob: 32ed0af9377c91a3e0b303a3dcf04db887d67422 (
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
48
49
50
51
52
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef SIMPLELISTVIEW_H
#define SIMPLELISTVIEW_H
#include "scrollbar.h"
#include "abstractscrollarea.h"
class SimpleListViewPrivate;
class SimpleListView : public AbstractScrollArea
{
Q_OBJECT
Q_DECLARE_PRIVATE(SimpleListView)
public:
SimpleListView(QGraphicsWidget *parent = nullptr);
virtual ~SimpleListView();
public:
void addItem(QGraphicsWidget *item);
void insertItem(int index, QGraphicsWidget *item);
QGraphicsWidget* takeItem(int row);
QGraphicsWidget* itemAt(int row);
int itemCount();
void updateListContents();
void setTwoColumns(const bool twoColumns);
bool twoColumns();
public slots:
void themeChange();
bool listItemCaching() const;
void setListItemCaching(bool enabled);
protected:
virtual void scrollContentsBy(qreal dx, qreal dy);
void resizeEvent(QGraphicsSceneResizeEvent *event);
QSizeF sizeHint(Qt::SizeHint which,
const QSizeF & constraint) const;
private:
SimpleListViewPrivate *d_ptr;
};
#endif
|