From: Soeren Apel Date: Tue, 5 May 2020 19:44:00 +0000 (+0200) Subject: Fix some signal/slot bugs X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=2c5b0f467f467836f2862f5218bbb0f9e8800d30;p=pulseview.git Fix some signal/slot bugs --- diff --git a/pv/data/analog.hpp b/pv/data/analog.hpp index bcdf7bc9..630075da 100644 --- a/pv/data/analog.hpp +++ b/pv/data/analog.hpp @@ -26,6 +26,7 @@ #include #include +#include "pv/data/segment.hpp" using std::deque; using std::shared_ptr; @@ -67,7 +68,7 @@ public: Q_SIGNALS: void samples_cleared(); - void samples_added(shared_ptr segment, uint64_t start_sample, + void samples_added(SharedPtrToSegment segment, uint64_t start_sample, uint64_t end_sample); void min_max_changed(float min, float max); diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 6758d77d..4c98b490 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -333,8 +333,8 @@ shared_ptr MainWindow::add_session() shared_ptr session = make_shared(device_manager_, name); - connect(session.get(), SIGNAL(add_view(views::ViewType, Session*)), - this, SLOT(on_add_view(views::ViewType, Session*))); + connect(session.get(), SIGNAL(add_view(ViewType, Session*)), + this, SLOT(on_add_view(ViewType, Session*))); connect(session.get(), SIGNAL(name_changed()), this, SLOT(on_session_name_changed())); connect(session.get(), SIGNAL(device_changed()), diff --git a/pv/mainwindow.hpp b/pv/mainwindow.hpp index 522ab1c0..c9a8ad26 100644 --- a/pv/mainwindow.hpp +++ b/pv/mainwindow.hpp @@ -31,7 +31,6 @@ #include "session.hpp" #include "subwindows/subwindowbase.hpp" -#include "views/viewbase.hpp" using std::list; using std::map; @@ -53,6 +52,7 @@ class MainBar; namespace view { class View; +class ViewBase; } namespace widgets { @@ -61,6 +61,9 @@ class DecoderMenu; #endif } +using pv::views::ViewBase; +using pv::views::ViewType; + class MainWindow : public QMainWindow { Q_OBJECT @@ -78,9 +81,9 @@ public: shared_ptr get_active_view() const; - shared_ptr add_view(views::ViewType type, Session &session); + shared_ptr add_view(ViewType type, Session &session); - void remove_view(shared_ptr view); + void remove_view(shared_ptr view); shared_ptr add_subwindow( subwindows::SubWindowType type, Session &session); @@ -113,7 +116,7 @@ private: virtual bool restoreState(const QByteArray &state, int version = 0); private Q_SLOTS: - void on_add_view(views::ViewType type, Session *session); + void on_add_view(ViewType type, Session *session); void on_focus_changed(); void on_focused_session_changed(shared_ptr session); diff --git a/pv/session.hpp b/pv/session.hpp index 56fbc3a4..77a20e3c 100644 --- a/pv/session.hpp +++ b/pv/session.hpp @@ -107,6 +107,7 @@ namespace views { class ViewBase; } +using pv::views::ViewType; class Session : public QObject { @@ -252,7 +253,7 @@ Q_SIGNALS: void data_received(); - void add_view(views::ViewType type, Session *session); + void add_view(ViewType type, Session *session); public Q_SLOTS: void on_data_saved();