Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
acad0e34
Commit
acad0e34
authored
Jun 15, 2021
by
Tomaz Canabrava
Browse files
Simplify code / Adapt to recursion
parent
84f52870
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/widgets/ViewSplitter.cpp
View file @
acad0e34
...
@@ -400,23 +400,12 @@ QPoint Konsole::ViewSplitter::mapToTopLevel(const QPoint& p)
...
@@ -400,23 +400,12 @@ QPoint Konsole::ViewSplitter::mapToTopLevel(const QPoint& p)
QPoint
Konsole
::
ViewSplitter
::
mapFromTopLevel
(
const
QPoint
&
p
)
QPoint
Konsole
::
ViewSplitter
::
mapFromTopLevel
(
const
QPoint
&
p
)
{
{
QStack
<
ViewSplitter
*>
tillTopLevel
;
tillTopLevel
.
push
(
this
);
auto
parentSplitter
=
qobject_cast
<
ViewSplitter
*>
(
parent
());
auto
parentSplitter
=
qobject_cast
<
ViewSplitter
*>
(
parent
());
while
(
parentSplitter
)
{
if
(
parentSplitter
)
{
tillTopLevel
.
push
(
parentSplitter
);
return
mapFromParent
(
parentSplitter
->
mapFromTopLevel
(
p
));
parentSplitter
=
qobject_cast
<
ViewSplitter
*>
(
parentSplitter
->
parent
());
}
tillTopLevel
.
pop
();
QPoint
retPoint
=
p
;
while
(
!
tillTopLevel
.
isEmpty
())
{
ViewSplitter
*
view
=
tillTopLevel
.
pop
();
retPoint
=
view
->
mapFromParent
(
retPoint
);
}
}
return
retPoint
;
return
p
;
}
}
Konsole
::
ViewSplitterHandle
::
ViewSplitterHandle
(
Qt
::
Orientation
orientation
,
QSplitter
*
parent
)
Konsole
::
ViewSplitterHandle
::
ViewSplitterHandle
(
Qt
::
Orientation
orientation
,
QSplitter
*
parent
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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