From: Joel Holdsworth Date: Sat, 23 Nov 2013 10:40:35 +0000 (+0000) Subject: Added Popup::closed signal X-Git-Tag: pulseview-0.2.0~214 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=0bce86095e332bedff9643e3dfbe409259e2df5f;p=pulseview.git Added Popup::closed signal --- diff --git a/CMakeLists.txt b/CMakeLists.txt index f2159f5e..5072c452 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -182,6 +182,7 @@ set(pulseview_HEADERS pv/widgets/colourbutton.h pv/widgets/colourpopup.h pv/widgets/decodermenu.h + pv/widgets/popup.h pv/widgets/popuptoolbutton.h pv/widgets/wellarray.h ) diff --git a/pv/widgets/popup.cpp b/pv/widgets/popup.cpp index 099c5499..9863887e 100644 --- a/pv/widgets/popup.cpp +++ b/pv/widgets/popup.cpp @@ -164,6 +164,11 @@ void Popup::reposition_widget() move(_point + o); } +void Popup::closeEvent(QCloseEvent*) +{ + closed(); +} + void Popup::paintEvent(QPaintEvent*) { QPainter painter(this); diff --git a/pv/widgets/popup.h b/pv/widgets/popup.h index 1da09d85..e7c867ac 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 { @@ -63,6 +65,9 @@ private: void reposition_widget(); +private: + void closeEvent(QCloseEvent*); + void paintEvent(QPaintEvent*); void resizeEvent(QResizeEvent*); @@ -72,6 +77,9 @@ private: protected: void showEvent(QShowEvent *e); +signals: + void closed(); + private: QPoint _point; Position _pos; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 18deb63b..f8715043 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -101,6 +101,7 @@ set(pulseview_TEST_HEADERS ${PROJECT_SOURCE_DIR}/pv/widgets/colourbutton.h ${PROJECT_SOURCE_DIR}/pv/widgets/colourpopup.h ${PROJECT_SOURCE_DIR}/pv/widgets/decodermenu.h + ${PROJECT_SOURCE_DIR}/pv/widgets/popup.h ${PROJECT_SOURCE_DIR}/pv/widgets/wellarray.h )