KDDockWidgets API Documentation 1.7
Loading...
Searching...
No Matches
Widget.cpp
Go to the documentation of this file.
1/*
2 This file is part of KDDockWidgets.
3
4 SPDX-FileCopyrightText: 2020-2023 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5 Author: SĂ©rgio Martins <sergio.martins@kdab.com>
6
7 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
8
9 Contact KDAB at <info@kdab.com> for commercial licensing options.
10*/
11
12#include "Widget.h"
13#include "Item_p.h"
14
15using namespace Layouting;
16
17static qint64 s_nextFrameId = 1;
18
20 : m_id(QString::number(s_nextFrameId++))
21 , m_thisObj(thisObj)
22{
23}
24
28
30{
31 return m_id;
32}
33
35{
36 // Max should be bigger than min, but not bigger than the hardcoded max
37 max = max.boundedTo(Layouting::Item::hardcodedMaximumSize);
38
39 // 0 interpreted as not having max
40 if (max.width() <= 0)
41 max.setWidth(Layouting::Item::hardcodedMaximumSize.width());
42 if (max.height() <= 0)
43 max.setHeight(Layouting::Item::hardcodedMaximumSize.height());
44
45 max = max.expandedTo(min);
46
47 return max;
48}
49
52{
53 return Item::hardcodedMinimumSize;
54}
static qint64 s_nextFrameId
Definition Widget.cpp:17
An abstraction/wrapper around QWidget, QtQuickItem or anything else.
static QSize boundedMaxSize(QSize min, QSize max)
Definition Widget.cpp:34
QString id() const
returns an id for correlation purposes for saving layouts
Definition Widget.cpp:29
virtual ~Widget()
Definition Widget.cpp:25
static QSize hardcodedMinimumSize()
Definition Widget.cpp:51
Widget(QObject *thisObj)
Definition Widget.cpp:19
QSize boundedTo(const QSize &otherSize) const const
QSize expandedTo(const QSize &otherSize) const const
int height() const const
void setHeight(int height)
void setWidth(int width)
int width() const const

© 2019-2023 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDDockWidgets
Advanced Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets/
Generated on Wed Nov 1 2023 00:02:31 for KDDockWidgets API Documentation by doxygen 1.9.8