14bbbdcb |
1 | // Created on: 2017-06-16 |
2 | // Created by: Natalia ERMOLAEVA |
3 | // Copyright (c) 2017 OPEN CASCADE SAS |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
6822a3be |
16 | #ifndef TreeModel_ContextMenu_H |
17 | #define TreeModel_ContextMenu_H |
14bbbdcb |
18 | |
19 | #include <Standard.hxx> |
20 | #include <Standard_Macro.hxx> |
21 | |
130eb114 |
22 | #include <Standard_WarningsDisable.hxx> |
14bbbdcb |
23 | #include <QObject> |
6822a3be |
24 | #include <QPoint> |
130eb114 |
25 | #include <Standard_WarningsRestore.hxx> |
14bbbdcb |
26 | |
6822a3be |
27 | class QTreeView; |
14bbbdcb |
28 | |
6822a3be |
29 | //! \class TreeModel_ContextMenu |
30 | //! \brief Creates actions to show/hide tree view columns |
31 | class TreeModel_ContextMenu : public QObject |
14bbbdcb |
32 | { |
6822a3be |
33 | Q_OBJECT |
14bbbdcb |
34 | public: |
14bbbdcb |
35 | //! Constructor |
6822a3be |
36 | Standard_EXPORT TreeModel_ContextMenu (QTreeView* theTreeView); |
14bbbdcb |
37 | |
38 | //! Destructor |
6822a3be |
39 | ~TreeModel_ContextMenu() {} |
14bbbdcb |
40 | |
6822a3be |
41 | protected slots: |
42 | //! Shows context menu for tree view header. It contains actions to change columns visibility. |
43 | //! \param thePosition a clicked point |
44 | void onTreeViewHeaderContextMenuRequested (const QPoint& thePosition); |
14bbbdcb |
45 | |
a110c4a3 |
46 | //! Changes clicked column visibility |
6822a3be |
47 | void onColumnVisibilityChanged(); |
14bbbdcb |
48 | |
49 | private: |
7e1c1e48 |
50 | QTreeView* myTreeView; //!< current tree view |
14bbbdcb |
51 | }; |
52 | |
14bbbdcb |
53 | #endif |