KDDockWidgets API Documentation  1.5
Widget.cpp
Go to the documentation of this file.
1 /*
2  This file is part of KDDockWidgets.
3 
4  SPDX-FileCopyrightText: 2020-2022 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 
15 using namespace Layouting;
16 
17 static qint64 s_nextFrameId = 1;
18 
20  : m_id(QString::number(s_nextFrameId++))
21  , m_thisObj(thisObj)
22 {
23 }
24 
26 {
27 }
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 }
Layouting::Widget::id
QString id() const
returns an id for corelation purposes for saving layouts
Definition: Widget.cpp:29
Layouting::Widget::boundedMaxSize
static QSize boundedMaxSize(QSize min, QSize max)
Definition: Widget.cpp:34
Widget.h
An abstraction/wrapper around QWidget, QtQuickItem or anything else.
s_nextFrameId
static qint64 s_nextFrameId
Definition: Widget.cpp:17
QSize
QSize::width
int width() const const
QSize::setWidth
void setWidth(int width)
QObject
QSize::height
int height() const const
QString
QSize::boundedTo
QSize boundedTo(const QSize &otherSize) const const
Layouting::Widget::Widget
Widget(QObject *thisObj)
Definition: Widget.cpp:19
QSize::expandedTo
QSize expandedTo(const QSize &otherSize) const const
Layouting
Definition: FrameworkWidgetFactory.h:32
QSize::setHeight
void setHeight(int height)
Layouting::Widget::~Widget
virtual ~Widget()
Definition: Widget.cpp:25

© 2019-2022 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 Mon Mar 7 2022 02:01:21 for KDDockWidgets API Documentation by doxygen 1.8.20