qskinny/playground/anchors/AnchorBox.h

44 lines
1.3 KiB
C
Raw Normal View History

/******************************************************************************
2024-01-17 13:31:45 +00:00
* QSkinny - Copyright (C) The authors
2023-04-06 07:23:37 +00:00
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
2021-08-04 08:11:12 +00:00
#pragma once
#include "QskControl.h"
class AnchorBox : public QskControl
{
Q_OBJECT
using Inherited = QskControl;
public:
AnchorBox( QQuickItem* parent = nullptr );
~AnchorBox() override;
// anchoring to the box
void addAnchor( QQuickItem*, Qt::AnchorPoint, Qt::AnchorPoint );
void addAnchors( QQuickItem*, Qt::Corner );
void addAnchors( QQuickItem*, Qt::Orientations = Qt::Horizontal | Qt::Vertical );
// anchoring between 2 children
void addAnchor( QQuickItem*, Qt::AnchorPoint, QQuickItem*, Qt::AnchorPoint );
void addAnchors( QQuickItem*, Qt::Corner, QQuickItem*, Qt::Corner );
void addAnchors( QQuickItem*, QQuickItem*,
Qt::Orientations = Qt::Horizontal | Qt::Vertical );
protected:
void geometryChangeEvent( QskGeometryChangeEvent* ) override;
void updateLayout() override;
2020-04-04 16:47:44 +00:00
QSizeF layoutSizeHint( Qt::SizeHint, const QSizeF& ) const override;
2020-04-04 16:47:44 +00:00
private:
2020-04-17 14:05:57 +00:00
void updateHints();
2020-04-19 12:40:58 +00:00
void updateGeometries( const QRectF& );
2020-04-13 14:00:01 +00:00
class PrivateData;
std::unique_ptr< PrivateData > m_data;
};