QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskIndexedLayoutBox.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_INDEXED_LAYOUT_BOX_H
7#define QSK_INDEXED_LAYOUT_BOX_H
8
9#include "QskBox.h"
10
11class QSK_EXPORT QskIndexedLayoutBox : public QskBox
12{
13 Q_OBJECT
14
15 Q_PROPERTY( bool autoAddChildren READ autoAddChildren
16 WRITE setAutoAddChildren NOTIFY autoAddChildrenChanged )
17
18 using Inherited = QskBox;
19
20 public:
21 explicit QskIndexedLayoutBox( QQuickItem* parent = nullptr );
22 ~QskIndexedLayoutBox() override;
23
24 void setAutoAddChildren( bool on = true );
25 bool autoAddChildren() const;
26
27 Q_SIGNALS:
29
30 protected:
31 void itemChange( ItemChange, const ItemChangeData& ) override;
32
33 void reparentItem( QQuickItem* );
34 void unparentItem( QQuickItem* );
35
36 private:
37 virtual void autoAddItem( QQuickItem* ) = 0;
38 virtual void autoRemoveItem( QQuickItem* ) = 0;
39
40 class PrivateData;
41 std::unique_ptr< PrivateData > m_data;
42};
43
44#endif
void itemChange(ItemChange, const ItemChangeData &) override
Base class of layouts with index ordered elements.
void autoAddChildrenChanged()