QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskScrollArea.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_SCROLL_AREA_H
7#define QSK_SCROLL_AREA_H
8
9#include "QskScrollView.h"
10
11class QSK_EXPORT QskScrollArea : public QskScrollView
12{
13 Q_OBJECT
14
15 Q_PROPERTY( QQuickItem* scrolledItem READ scrolledItem
16 WRITE setScrolledItem NOTIFY scrolledItemChanged FINAL)
17
18 Q_PROPERTY( bool itemResizable READ isItemResizable
19 WRITE setItemResizable NOTIFY itemResizableChanged FINAL )
20
21 Q_PROPERTY( bool itemFocusClipping READ hasItemFocusClipping
22 WRITE setItemFocusClipping FINAL )
23
25
26 public:
27 QskScrollArea( QQuickItem* parent = nullptr );
28 ~QskScrollArea() override;
29
30 void setScrolledItem( QQuickItem* );
31 QQuickItem* scrolledItem() const;
32
33 void setItemResizable( bool on );
34 bool isItemResizable() const;
35
36 void setItemFocusClipping( bool on );
37 bool hasItemFocusClipping() const;
38
39 Q_SIGNALS:
40 void scrolledItemChanged();
41 void itemResizableChanged( bool );
42
43 protected:
44 void updateLayout() override;
45 QSizeF layoutSizeHint( Qt::SizeHint, const QSizeF& ) const override;
46
47#ifndef QT_NO_WHEELEVENT
48 QPointF scrollOffset( const QWheelEvent* ) const override;
49#endif
50
51 private:
52 void translateItem();
53 void adjustItem();
54
55 class PrivateData;
56 std::unique_ptr< PrivateData > m_data;
57};
58
59#endif