X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fwidgets%2Fpopup.h;h=2fdb23c0b3b0bbd16da05162ce95dfb3a1ddac96;hb=0715fb8c638b53ac25590841fcbf3a1da3546b68;hp=402fc6bda3d60944f7b087c4a99034133ef69d5e;hpb=6e3f046e779b939efebdfa4d9e68fe28d9beee59;p=pulseview.git diff --git a/pv/widgets/popup.h b/pv/widgets/popup.h index 402fc6b..2fdb23c 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,14 +71,21 @@ private: void reposition_widget(); +private: + void closeEvent(QCloseEvent*); + void paintEvent(QPaintEvent*); void resizeEvent(QResizeEvent*); - void showEvent(QShowEvent*); - void mouseReleaseEvent(QMouseEvent *e); +protected: + void showEvent(QShowEvent *e); + +Q_SIGNALS: + void closed(); + private: QPoint _point; Position _pos;