KDStateMachineEditor API Documentation 2.1
Loading...
Searching...
No Matches
layoutproperties.cpp
Go to the documentation of this file.
1/*
2 This file is part of the KDAB State Machine Editor Library.
3
4 SPDX-FileCopyrightText: 2014 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5 Author: Kevin Funk <kevin.funk@kdab.com>
6
7 SPDX-License-Identifier: LGPL-2.1-only OR LicenseRef-KDAB-KDStateMachineEditor
8
9 Licensees holding valid commercial KDAB State Machine Editor Library
10 licenses may use this file in accordance with the KDAB State Machine Editor
11 Library License Agreement provided with the Software.
12
13 Contact info@kdab.com if any conditions of this licensing are not clear to you.
14*/
15
16#include "layoutproperties.h"
17
18using namespace KDSME;
19
20struct LayoutProperties::Private
21{
22 Private();
23
24 qreal regionMargins;
25 QFont regionLabelFont;
26 qreal regionLabelMargins;
27 QSizeF regionLabelButtonBoxSize;
28 bool showTransitionLabels;
29};
30
31LayoutProperties::Private::Private()
32 : regionMargins(10.)
33 , regionLabelMargins(5.)
34 , regionLabelButtonBoxSize(18., 18.)
35 , showTransitionLabels(true)
36{
37 regionLabelFont.setBold(true);
38}
39
41 : QObject(parent)
42 , d(new Private)
43{
44}
45
49
51{
52 return d->regionMargins;
53}
54
56{
57 if (d->regionMargins == margins) {
58 return;
59 }
60
61 d->regionMargins = margins;
62 Q_EMIT regionMarginsChanged(margins);
63 Q_EMIT changed();
64}
65
67{
68 return d->regionLabelFont;
69}
70
72{
73 if (d->regionLabelFont == font) {
74 return;
75 }
76
77 d->regionLabelFont = font;
78 Q_EMIT regionLabelFontChanged(font);
79 Q_EMIT changed();
80}
81
83{
84 return d->regionLabelMargins;
85}
86
88{
89 if (d->regionLabelMargins == margins) {
90 return;
91 }
92
93 d->regionLabelMargins = margins;
94 Q_EMIT regionLabelMarginsChanged(margins);
95 Q_EMIT changed();
96}
97
99{
100 return d->regionLabelButtonBoxSize;
101}
102
103void LayoutProperties::setRegionLabelButtonBoxSize(const QSizeF &size) // clazy:exclude=function-args-by-value
104{
105 if (d->regionLabelButtonBoxSize == size) {
106 return;
107 }
108
109 d->regionLabelButtonBoxSize = size;
111 Q_EMIT changed();
112}
113
115{
116 return d->showTransitionLabels;
117}
118
120{
121 if (d->showTransitionLabels == show) {
122 return;
123 }
124
125 d->showTransitionLabels = show;
126 Q_EMIT showTransitionLabelsChanged(show);
127 Q_EMIT changed();
128}
void regionLabelMarginsChanged(qreal)
void regionMarginsChanged(qreal)
void setRegionLabelMargins(qreal margins)
void setRegionLabelFont(const QFont &font)
void regionLabelButtonBoxSizeChanged(const QSizeF &)
LayoutProperties(QObject *parent=nullptr)
void setRegionMargins(qreal margins)
void setShowTransitionLabels(bool show)
void showTransitionLabelsChanged(bool)
void setRegionLabelButtonBoxSize(const QSizeF &size)
void regionLabelFontChanged(const QFont &)

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDStateMachineEditor
Create Qt State Machine metacode using a graphical user interface
https://github.com/KDAB/KDStateMachineEditor
Generated on Tue Jul 15 2025 15:21:47 for KDStateMachineEditor API Documentation by doxygen 1.9.8