ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvOverlayDialog.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 "CVPluginAPI.h"
11 
12 // Qt
13 #include <QDialog>
14 #include <QList>
15 
17 class CVPLUGIN_LIB_API ccOverlayDialog : public QDialog {
18  Q_OBJECT
19 
20 public:
22  explicit ccOverlayDialog(QWidget* parent = nullptr,
23  Qt::WindowFlags flags = Qt::FramelessWindowHint |
24  Qt::Tool);
25 
27  ~ccOverlayDialog() override;
28 
30 
33  virtual bool linkWith(QWidget* win);
34 
36 
38  virtual bool start();
39 
41 
44  virtual void stop(bool accepted);
45 
46  // reimplemented from QDialog
47  void reject() override;
48 
51 
54  void addOverridenShortcut(Qt::Key key);
55 
57  bool started() const { return m_processing; }
58 
59 signals:
60 
62 
64  void processFinished(bool accepted);
65 
67 
69  void shortcutTriggered(int key);
70 
72  void shown();
73 
74 protected slots:
75 
77  virtual void onLinkedWindowDeletion(QObject* object = nullptr);
78 
79 protected:
80  // inherited from QObject
81  bool eventFilter(QObject* obj, QEvent* e) override;
82 
84  QWidget* m_associatedWin;
85 
88 
90  QList<int> m_overriddenKeys;
91 };
#define CVPLUGIN_LIB_API
Definition: CVPluginAPI.h:15
#define slots
#define signals
Generic overlay dialog interface.
void shown()
Signal emitted when a 'show' event is detected.
void shortcutTriggered(int key)
Signal emitted when an overridden key shortcut is pressed.
QList< int > m_overriddenKeys
Overridden keys.
bool started() const
Returns whether the tool is currently started or not.
bool m_processing
Running/processing state.
void processFinished(bool accepted)
Signal emitted when process is finished.
QWidget * m_associatedWin
Associated (MDI) window.