QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgsoverlaywidgetlayout.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsoverlaywidgetlayout.h
3 ---------------------
4 begin : March 2024
5 copyright : (C) 2024 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSOVERLAYWIDGETLAYOUT_H
17#define QGSOVERLAYWIDGETLAYOUT_H
18
19#include "qgis_gui.h"
20#include "qgis_sip.h"
21
22#include <QLayout>
23
30class GUI_EXPORT QgsOverlayWidgetLayout : public QLayout
31{
32 Q_OBJECT
33
34 public:
38 QgsOverlayWidgetLayout( QWidget *parent SIP_TRANSFERTHIS = nullptr );
39 ~QgsOverlayWidgetLayout() override;
40
41 int count() const final;
42 void addItem( QLayoutItem *item ) final;
43 QLayoutItem *itemAt( int index ) const final;
44 QLayoutItem *takeAt( int index ) final;
45 QSize sizeHint() const final;
46 QSize minimumSize() const final;
47 void setGeometry( const QRect &rect ) final;
48
55 void addWidget( QWidget *widget SIP_TRANSFER, Qt::Edge edge );
56
62 void setHorizontalSpacing( int spacing );
63
69 int horizontalSpacing() const { return mHorizontalSpacing; }
70
76 void setVerticalSpacing( int spacing );
77
83 int verticalSpacing() const { return mVerticalSpacing; }
84
85 private:
86 QList<QLayoutItem *> mLeftItems;
87 QList<QLayoutItem *> mRightItems;
88 QList<QLayoutItem *> mTopItems;
89 QList<QLayoutItem *> mBottomItems;
90 int mHorizontalSpacing = 0;
91 int mVerticalSpacing = 0;
92};
93
94#endif // QGSOVERLAYWIDGETLAYOUT_H
A custom layout which can be used to overlay child widgets over a parent widget.
int horizontalSpacing() const
Returns the spacing between widgets that are laid out side by side.
int verticalSpacing() const
Returns the spacing between widgets that are laid out on top of each other.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_TRANSFER
Definition qgis_sip.h:36