ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ProjectViewContextMenu.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <QMenu>
11 #include <QModelIndex>
12 
13 class QTreeView;
14 class QFileSystemModel;
15 
16 class ProjectView;
17 
18 class ProjectViewContextMenu final : public QMenu
19 {
20  Q_OBJECT
21 
22  public:
23  explicit ProjectViewContextMenu(ProjectView *view);
24 
25  public Q_SLOTS:
26  void requested(const QPoint &pos);
27 
28  private Q_SLOTS:
29  void renameFile() const;
30  void deleteElement() const;
31  void createFile() const;
32  void createFolder() const;
33 
34  private:
35  ProjectView *m_treeView;
36  QModelIndex m_currentIndex;
37 
38  QAction m_renameAction;
39  QAction m_deleteAction;
40  QAction m_createFileAction;
41  QAction m_createFolderAction;
42 };
void requested(const QPoint &pos)
ProjectViewContextMenu(ProjectView *view)