1 // Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef SUIT_PAGEPREFSHORTCUTTREEITEM_H
24 #define SUIT_PAGEPREFSHORTCUTTREEITEM_H
27 #include <QtxPagePrefMgr.h>
33 class SUIT_ShortcutTree;
34 class SUIT_ShortcutContainer;
37 class SUIT_EXPORT SUIT_PagePrefShortcutTreeItem : public QtxPagePrefItem
40 SUIT_PagePrefShortcutTreeItem(QtxPreferenceItem* theParent);
41 virtual ~SUIT_PagePrefShortcutTreeItem() = default;
43 virtual void retrieve();
44 virtual void retrieveDefault();
48 SUIT_ShortcutTree* myShortcutTree;
50 // { root item (preference window), shortcut container of synchronized trees (widgets within the same window) }
51 static std::map<QtxPreferenceItem*, std::weak_ptr<SUIT_ShortcutContainer>> shortcutContainers;
53 * Every QtxPagePrefMgr is eventually a preference window. Each preference window has button "Apply".
54 * When the button is pressed, all descendants of the QtxPagePrefMgr store changes they carry into preferences.
55 * The pitfall with shortcut trees is as follows: made in independent shortcut trees, changes may conflict,
56 * and merge of such changes is ambiguous. And the solution is to keep shortcut trees within the same window
57 * synchronized - all changes being made in a tree of a synchronized bundle are projected to other trees from the bundle
58 * without interacting with SUIT_ShortcutMgr.
60 * Every time shortcut preferences stored to the ShortcutMgr, all instances of SUIT_ShortcutTree are updated.
64 #endif // SUIT_PAGEPREFSHORTCUTTREEITEM_H