Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F34128447
navigatabletreeview.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
1 KB
Subscribers
None
navigatabletreeview.cpp
View Options
/*
ui/navigatabletreeview.cpp
This file is part of libkleopatra
SPDX-FileCopyrightText: 2022 g10 Code GmbH
SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include
<config-libkleo.h>
#include
"navigatabletreeview.h"
using
namespace
Kleo
;
QModelIndex
NavigatableTreeView
::
moveCursor
(
QAbstractItemView
::
CursorAction
cursorAction
,
Qt
::
KeyboardModifiers
modifiers
)
{
// make column by column keyboard navigation with Left/Right possible by switching
// the selection behavior to SelectItems before calling the parent class's moveCursor,
// because it ignores MoveLeft/MoveRight if the selection behavior is SelectRows;
// moreover, temporarily disable exanding of items to prevent expanding/collapsing
// on MoveLeft/MoveRight
if
((
cursorAction
!=
MoveLeft
)
&&
(
cursorAction
!=
MoveRight
))
{
return
QTreeView
::
moveCursor
(
cursorAction
,
modifiers
);
}
const
auto
savedSelectionBehavior
=
selectionBehavior
();
setSelectionBehavior
(
SelectItems
);
const
auto
savedItemsExpandable
=
itemsExpandable
();
setItemsExpandable
(
false
);
const
auto
result
=
QTreeView
::
moveCursor
(
cursorAction
,
modifiers
);
setItemsExpandable
(
savedItemsExpandable
);
setSelectionBehavior
(
savedSelectionBehavior
);
return
result
;
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sun, Dec 7, 4:42 PM (19 h, 14 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
b2/56/dd3dddde6308da00cbb496ac5d1b
Attached To
rLIBKLEO Libkleo
Event Timeline
Log In to Comment