Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KItinerary
Commits
32c619a5
Commit
32c619a5
authored
Nov 06, 2022
by
Volker Krause
Browse files
Add method to get all fields in a given area of an U_TLAY block
parent
e55cd390
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/uic9183/uic9183ticketlayout.cpp
View file @
32c619a5
...
...
@@ -197,3 +197,21 @@ QSize Uic9183TicketLayout::size() const
}
return
QSize
(
width
,
height
);
}
std
::
vector
<
Uic9183TicketLayoutField
>
Uic9183TicketLayout
::
fields
(
int
row
,
int
column
,
int
width
,
int
height
)
const
{
std
::
vector
<
Uic9183TicketLayoutField
>
result
;
for
(
auto
f
=
firstField
();
!
f
.
isNull
();
f
=
f
.
next
())
{
// there's non-compliant samples out there with zero field sizes...
const
auto
effectiveHeight
=
std
::
max
(
f
.
height
(),
1
);
if
(
f
.
row
()
+
effectiveHeight
-
1
<
row
||
f
.
row
()
>
row
+
height
-
1
)
{
continue
;
}
const
auto
effectiveFieldWidth
=
f
.
width
()
>
0
?
f
.
width
()
:
f
.
size
();
if
(
f
.
column
()
+
effectiveFieldWidth
-
1
<
column
||
f
.
column
()
>
column
+
width
-
1
)
{
continue
;
}
result
.
push_back
(
f
);
}
return
result
;
}
src/lib/uic9183/uic9183ticketlayout.h
View file @
32c619a5
...
...
@@ -96,6 +96,9 @@ public:
*/
Uic9183TicketLayoutField
firstField
()
const
;
/** All fields covering the given area. */
std
::
vector
<
Uic9183TicketLayoutField
>
fields
(
int
row
,
int
column
,
int
width
,
int
height
)
const
;
static
constexpr
const
char
RecordId
[]
=
"U_TLAY"
;
private:
QExplicitlySharedDataPointer
<
Uic9183TicketLayoutPrivate
>
d
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment