X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fwidgets%2Fpopup.h;h=83ad7ee0fbd082ebb533fe7dafa280b6944d6a04;hp=1da09d85eb5965401205d459ccd038ab160e1fb0;hb=8dbbc7f0b9ea59d0f0d62225772f8a56eee125f5;hpb=b7b659aa72851df2d34d4c1e5fd5636fbd9176d1 diff --git a/pv/widgets/popup.h b/pv/widgets/popup.h index 1da09d85..83ad7ee0 100644 --- a/pv/widgets/popup.h +++ b/pv/widgets/popup.h @@ -28,6 +28,8 @@ namespace widgets { class Popup : public QWidget { + Q_OBJECT + public: enum Position { @@ -50,7 +52,13 @@ public: void set_position(const QPoint point, Position pos); + bool eventFilter(QObject *obj, QEvent *evt); + + void show(); + private: + bool space_for_arrow() const; + QPolygon arrow_polygon() const; QRegion arrow_region() const; @@ -63,6 +71,9 @@ private: void reposition_widget(); +private: + void closeEvent(QCloseEvent*); + void paintEvent(QPaintEvent*); void resizeEvent(QResizeEvent*); @@ -72,9 +83,12 @@ private: protected: void showEvent(QShowEvent *e); +Q_SIGNALS: + void closed(); + private: - QPoint _point; - Position _pos; + QPoint point_; + Position pos_; }; } // namespace widgets