From c8d226bd049fa1bfb1f83c0b7cda2a7fb2827115 Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Thu, 29 Jun 2023 15:55:01 +0800 Subject: [PATCH] Add 'override' key for implementation function to disable warning message --- DSView/pv/dialogs/applicationpardlg.h | 4 --- DSView/pv/dialogs/decoderoptionsdlg.h | 7 ++-- DSView/pv/dialogs/dsdialog.h | 2 +- DSView/pv/dock/dsotriggerdock.h | 2 +- DSView/pv/dock/measuredock.h | 2 +- DSView/pv/dock/protocoldock.h | 14 ++++---- DSView/pv/dock/searchdock.h | 2 +- DSView/pv/dock/triggerdock.h | 2 +- DSView/pv/mainwindow.h | 40 +++++++++++------------ DSView/pv/prop/binding/decoderoptions.cpp | 1 - DSView/pv/prop/binding/decoderoptions.h | 1 - DSView/pv/sigsession.h | 4 +-- DSView/pv/toolbars/filebar.h | 2 +- DSView/pv/toolbars/logobar.h | 2 +- DSView/pv/toolbars/samplingbar.h | 2 +- DSView/pv/toolbars/titlebar.h | 2 +- DSView/pv/toolbars/trigbar.h | 2 +- DSView/pv/view/devmode.h | 2 +- DSView/pv/view/dsldial.cpp | 4 +-- DSView/pv/view/view.h | 2 +- DSView/pv/view/viewport.h | 2 +- 21 files changed, 47 insertions(+), 54 deletions(-) diff --git a/DSView/pv/dialogs/applicationpardlg.h b/DSView/pv/dialogs/applicationpardlg.h index c13f6529..7c0291a1 100644 --- a/DSView/pv/dialogs/applicationpardlg.h +++ b/DSView/pv/dialogs/applicationpardlg.h @@ -49,12 +49,8 @@ namespace pv ~ApplicationParamDlg(); bool ShowDlg(QWidget *parent); - private: - //IDlgCallback - void OnDlgResult(bool bYes); - void bind_font_name_list(QComboBox *box, QString v); void bind_font_size_list(QComboBox *box, float size); diff --git a/DSView/pv/dialogs/decoderoptionsdlg.h b/DSView/pv/dialogs/decoderoptionsdlg.h index cf460190..f1632e57 100644 --- a/DSView/pv/dialogs/decoderoptionsdlg.h +++ b/DSView/pv/dialogs/decoderoptionsdlg.h @@ -43,9 +43,10 @@ namespace pv { class Decoder; } } - namespace prop::binding - { - class DecoderOptions; + namespace prop{ + namespace binding{ + class DecoderOptions; + } } namespace view{ class View; diff --git a/DSView/pv/dialogs/dsdialog.h b/DSView/pv/dialogs/dsdialog.h index c6b423dc..af94c8d6 100644 --- a/DSView/pv/dialogs/dsdialog.h +++ b/DSView/pv/dialogs/dsdialog.h @@ -68,7 +68,7 @@ public: void SetTitleSpace(int h); //IFontForm - void update_font(); + void update_font() override; void show(); diff --git a/DSView/pv/dock/dsotriggerdock.h b/DSView/pv/dock/dsotriggerdock.h index 446ce1a7..4c5c3f27 100644 --- a/DSView/pv/dock/dsotriggerdock.h +++ b/DSView/pv/dock/dsotriggerdock.h @@ -61,7 +61,7 @@ private: bool check_trig_channel(); //IFontForm - void update_font(); + void update_font() override; signals: void set_trig_pos(int percent); diff --git a/DSView/pv/dock/measuredock.h b/DSView/pv/dock/measuredock.h index 3f8a9234..04442dbf 100644 --- a/DSView/pv/dock/measuredock.h +++ b/DSView/pv/dock/measuredock.h @@ -91,7 +91,7 @@ private: void reStyle(); //IFontForm - void update_font(); + void update_font() override; void build_dist_pannel(); void build_edge_pannel(); diff --git a/DSView/pv/dock/protocoldock.h b/DSView/pv/dock/protocoldock.h index dedbf01c..adbaa233 100644 --- a/DSView/pv/dock/protocoldock.h +++ b/DSView/pv/dock/protocoldock.h @@ -103,21 +103,21 @@ private: static bool protocol_sort_callback(const DecoderInfoItem *o1, const DecoderInfoItem *o2); //IProtocolItemLayerCallback - void OnProtocolSetting(void *handle); - void OnProtocolDelete(void *handle); - void OnProtocolFormatChanged(QString format, void *handle); + void OnProtocolSetting(void *handle) override; + void OnProtocolDelete(void *handle) override; + void OnProtocolFormatChanged(QString format, void *handle) override; //IKeywordActive - void BeginEditKeyword(); + void BeginEditKeyword() override; //ISearchItemClick - void OnItemClick(void *sender, void *data_handle); + void OnItemClick(void *sender, void *data_handle) override; //IDecoderPannel - void update_deocder_item_name(void *trace_handel, const char *name); + void update_deocder_item_name(void *trace_handel, const char *name) override; //IFontForm - void update_font(); + void update_font() override; signals: void protocol_updated(); diff --git a/DSView/pv/dock/searchdock.h b/DSView/pv/dock/searchdock.h index 38f706fe..4eb5c300 100644 --- a/DSView/pv/dock/searchdock.h +++ b/DSView/pv/dock/searchdock.h @@ -75,7 +75,7 @@ private: void reStyle(); //IFontForm - void update_font(); + void update_font() override; public slots: void on_previous(); diff --git a/DSView/pv/dock/triggerdock.h b/DSView/pv/dock/triggerdock.h index 1246be01..edc157d3 100644 --- a/DSView/pv/dock/triggerdock.h +++ b/DSView/pv/dock/triggerdock.h @@ -87,7 +87,7 @@ private: bool commit_trigger(); //IFontForm - void update_font(); + void update_font() override; private slots: void simple_trigger(); diff --git a/DSView/pv/mainwindow.h b/DSView/pv/mainwindow.h index 225c8fb9..6d28b65c 100644 --- a/DSView/pv/mainwindow.h +++ b/DSView/pv/mainwindow.h @@ -129,7 +129,7 @@ signals: public: //IMainForm - void switchLanguage(int language); + void switchLanguage(int language) override; bool able_to_close(); private: @@ -160,29 +160,29 @@ private: private: //ISessionCallback - void session_error(); - void session_save(); - void data_updated(); - void update_capture(); - void cur_snap_samplerate_changed(); - void signals_changed(); - void receive_trigger(quint64 trigger_pos); - void frame_ended(); - void frame_began(); - void show_region(uint64_t start, uint64_t end, bool keep); - void show_wait_trigger(); - void repeat_hold(int percent); - void decode_done(); - void receive_data_len(quint64 len); - void receive_header(); - void trigger_message(int msg); - void delay_prop_msg(QString strMsg); + void session_error() override; + void session_save() override; + void data_updated() override; + void update_capture() override; + void cur_snap_samplerate_changed() override; + void signals_changed() override; + void receive_trigger(quint64 trigger_pos) override; + void frame_ended() override; + void frame_began() override; + void show_region(uint64_t start, uint64_t end, bool keep) override; + void show_wait_trigger() override; + void repeat_hold(int percent) override; + void decode_done() override; + void receive_data_len(quint64 len) override; + void receive_header() override; + void trigger_message(int msg) override; + void delay_prop_msg(QString strMsg) override; //ISessionDataGetter - bool genSessionData(std::string &str); + bool genSessionData(std::string &str) override; //IMessageListener - void OnMessage(int msg); + void OnMessage(int msg) override; private: pv::view::View *_view; diff --git a/DSView/pv/prop/binding/decoderoptions.cpp b/DSView/pv/prop/binding/decoderoptions.cpp index 892f1f59..30e44067 100644 --- a/DSView/pv/prop/binding/decoderoptions.cpp +++ b/DSView/pv/prop/binding/decoderoptions.cpp @@ -43,7 +43,6 @@ namespace binding { DecoderOptions::DecoderOptions(pv::data::DecoderStack* decoder_stack, data::decode::Decoder *decoder) : Binding(), - _decoder_stack(decoder_stack), _decoder(decoder) { assert(_decoder); diff --git a/DSView/pv/prop/binding/decoderoptions.h b/DSView/pv/prop/binding/decoderoptions.h index 0911d23d..6e083528 100644 --- a/DSView/pv/prop/binding/decoderoptions.h +++ b/DSView/pv/prop/binding/decoderoptions.h @@ -59,7 +59,6 @@ private: private: - pv::data::DecoderStack *_decoder_stack; pv::data::decode::Decoder *_decoder; }; diff --git a/DSView/pv/sigsession.h b/DSView/pv/sigsession.h index cec63819..a8d722b9 100644 --- a/DSView/pv/sigsession.h +++ b/DSView/pv/sigsession.h @@ -482,10 +482,10 @@ private: } //IMessageListener - void OnMessage(int msg); + void OnMessage(int msg) override; //IDeviceAgentCallback - void DeviceConfigChanged(); + void DeviceConfigChanged() override; private: /** diff --git a/DSView/pv/toolbars/filebar.h b/DSView/pv/toolbars/filebar.h index f7185529..6982ec1f 100644 --- a/DSView/pv/toolbars/filebar.h +++ b/DSView/pv/toolbars/filebar.h @@ -53,7 +53,7 @@ private: void reStyle(); //IFontForm - void update_font(); + void update_font() override; signals: void sig_load_file(QString); diff --git a/DSView/pv/toolbars/logobar.h b/DSView/pv/toolbars/logobar.h index 1f9391f1..8d3f2d08 100644 --- a/DSView/pv/toolbars/logobar.h +++ b/DSView/pv/toolbars/logobar.h @@ -60,7 +60,7 @@ private: void reStyle(); //IFontForm - void update_font(); + void update_font() override; signals: //post event message to open user help document, MainWindow class receive it diff --git a/DSView/pv/toolbars/samplingbar.h b/DSView/pv/toolbars/samplingbar.h index 2b9441cf..e8aa63f4 100644 --- a/DSView/pv/toolbars/samplingbar.h +++ b/DSView/pv/toolbars/samplingbar.h @@ -124,7 +124,7 @@ namespace pv bool action_instant_stop(); //IFontForm - void update_font(); + void update_font() override; private slots: void on_collect_mode(); diff --git a/DSView/pv/toolbars/titlebar.h b/DSView/pv/toolbars/titlebar.h index 49ec7395..1d577bd0 100644 --- a/DSView/pv/toolbars/titlebar.h +++ b/DSView/pv/toolbars/titlebar.h @@ -44,7 +44,7 @@ public: QString title(); //IFontForm - void update_font(); + void update_font() override; private: void changeEvent(QEvent *event); diff --git a/DSView/pv/toolbars/trigbar.h b/DSView/pv/toolbars/trigbar.h index 0faa72f3..53c913fa 100644 --- a/DSView/pv/toolbars/trigbar.h +++ b/DSView/pv/toolbars/trigbar.h @@ -56,7 +56,7 @@ private: void update_checked_status(); //IFontForm - void update_font(); + void update_font() override; signals: void sig_setTheme(QString style); diff --git a/DSView/pv/view/devmode.h b/DSView/pv/view/devmode.h index 7377eebc..319fceef 100644 --- a/DSView/pv/view/devmode.h +++ b/DSView/pv/view/devmode.h @@ -72,7 +72,7 @@ private: const dev_mode_name* get_mode_name(int mode); //IFontForm - void update_font(); + void update_font() override; public slots: void set_device(); diff --git a/DSView/pv/view/dsldial.cpp b/DSView/pv/view/dsldial.cpp index fcafb836..3ac842f1 100644 --- a/DSView/pv/view/dsldial.cpp +++ b/DSView/pv/view/dsldial.cpp @@ -152,9 +152,7 @@ uint64_t dslDial::get_max() } uint64_t dslDial::get_value() -{ - this->_div = this->_div; - +{ if (_sel >= (uint64_t)_value.count()){ assert(false); } diff --git a/DSView/pv/view/view.h b/DSView/pv/view/view.h index d228aac2..d4065bd6 100644 --- a/DSView/pv/view/view.h +++ b/DSView/pv/view/view.h @@ -321,7 +321,7 @@ public: } //IFontForm - void update_font(); + void update_font() override; signals: void hover_point_changed(); diff --git a/DSView/pv/view/viewport.h b/DSView/pv/view/viewport.h index 899e44a8..14c02722 100644 --- a/DSView/pv/view/viewport.h +++ b/DSView/pv/view/viewport.h @@ -112,7 +112,7 @@ public: void update_lang(); //IFontForm - void update_font(); + void update_font() override; protected: bool event(QEvent *event) override;