QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
terminalstriplayoutpattern.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2022 The QElectroTech Team
3 This file is part of QElectroTech.
4
5 QElectroTech is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9
10 QElectroTech is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef TERMINALSTRIPLAYOUTPATTERN_H
19#define TERMINALSTRIPLAYOUTPATTERN_H
20
21#include <QRect>
22#include <QSize>
23#include <QTextOption>
24#include <QUuid>
25#include <QVector>
26
41{
42 public:
44
45 //Header of terminal strip
46 QRect m_header_rect{0,30,50,130};
47 Qt::Orientation m_header_text_orientation{Qt::Horizontal};
48 void setHeaderTextAlignment(const Qt::Alignment &alignment);
49 Qt::Alignment headerTextAlignment() const;
50 QTextOption headerTextOption() const;
51
52 //Spacer between the header and the terminals
53 QRect m_spacer_rect{0, 50, 10, 90};
54
55 //Terminals
56 QVector<QRect> m_terminal_rect
57 {
58 QRect{0, 0, 20, 190},
59 QRect{0, 10, 20, 170},
60 QRect{0, 20, 20, 150},
61 QRect{0, 30, 20, 130}
62 };
63
64 void setTerminalsTextAlignment(const QVector<Qt::Alignment> &alignment);
65 QVector<Qt::Alignment> terminalsTextAlignment() const;
66 QVector<QTextOption> terminalsTextOption() const;
67
68 QVector<QRect> m_terminals_text_rect
69 {
70 QRect{0,35,20,50},
71 QRect{0,35,20,50},
72 QRect{0,35,20,50},
73 QRect{0,35,20,50}
74 };
75 QVector<Qt::Orientation> m_terminals_text_orientation
76 {
77 Qt::Vertical,
78 Qt::Vertical,
79 Qt::Vertical,
80 Qt::Vertical
81 };
82
84 QVector<int> m_bridge_point_y_offset{50,70,90,110};
85
86 QUuid m_uuid{QUuid::createUuid()};
87 QString m_name;
88
89 private:
92
93 private:
94 Qt::Alignment m_header_text_alignment{Qt::AlignCenter};
96
97 QVector<Qt::Alignment> m_terminals_text_alignment
98 {
99 Qt::AlignRight | Qt::AlignVCenter,
100 Qt::AlignRight | Qt::AlignVCenter,
101 Qt::AlignRight | Qt::AlignVCenter,
102 Qt::AlignRight | Qt::AlignVCenter
103 };
104 QVector<QTextOption> m_terminals_text_option
105 {
106 QTextOption(),
107 QTextOption(),
108 QTextOption(),
109 QTextOption()
110 };
111};
112
113#endif // TERMINALSTRIPLAYOUTPATTERN_H
The TerminalStripLayoutPattern class A class with all values used to define how a terminal strip must...
Definition terminalstriplayoutpattern.h:41
QVector< QRect > m_terminal_rect
Definition terminalstriplayoutpattern.h:57
QVector< Qt::Alignment > terminalsTextAlignment() const
Definition terminalstriplayoutpattern.cpp:48
void setTerminalsTextAlignment(const QVector< Qt::Alignment > &alignment)
Definition terminalstriplayoutpattern.cpp:42
QVector< Qt::Orientation > m_terminals_text_orientation
Definition terminalstriplayoutpattern.h:76
QVector< QRect > m_terminals_text_rect
Definition terminalstriplayoutpattern.h:69
Qt::Alignment m_header_text_alignment
Definition terminalstriplayoutpattern.h:94
void updateHeaderTextOption()
Definition terminalstriplayoutpattern.cpp:58
QVector< QTextOption > m_terminals_text_option
Definition terminalstriplayoutpattern.h:105
QVector< Qt::Alignment > m_terminals_text_alignment
Definition terminalstriplayoutpattern.h:98
QTextOption headerTextOption() const
Definition terminalstriplayoutpattern.cpp:38
QRect m_header_rect
Definition terminalstriplayoutpattern.h:46
Qt::Orientation m_header_text_orientation
Definition terminalstriplayoutpattern.h:47
QVector< QTextOption > terminalsTextOption() const
Definition terminalstriplayoutpattern.cpp:53
QTextOption m_header_text_option
Definition terminalstriplayoutpattern.h:95
TerminalStripLayoutPattern()
Definition terminalstriplayoutpattern.cpp:21
void updateTerminalsTextOption()
Definition terminalstriplayoutpattern.cpp:64
void setHeaderTextAlignment(const Qt::Alignment &alignment)
Definition terminalstriplayoutpattern.cpp:27
int m_bridge_point_d
Definition terminalstriplayoutpattern.h:83
QString m_name
Definition terminalstriplayoutpattern.h:87
QUuid m_uuid
Definition terminalstriplayoutpattern.h:86
Qt::Alignment headerTextAlignment() const
Definition terminalstriplayoutpattern.cpp:33
QRect m_spacer_rect
Definition terminalstriplayoutpattern.h:53
QVector< int > m_bridge_point_y_offset
Definition terminalstriplayoutpattern.h:84