diff options
author | Tom Rondeau <tom@trondeau.com> | 2013-11-09 09:20:55 -0500 |
---|---|---|
committer | Tom Rondeau <tom@trondeau.com> | 2013-11-09 09:20:55 -0500 |
commit | 008dde8f59e8ef132af3ebc0f7b8d43f1e05b717 (patch) | |
tree | 2088a0538423db33358c23bf3c3e2e1430dbb4a7 /gr-qtgui/lib/histogram_sink_f_impl.cc | |
parent | 41d636b53cff8c3c563114e045f8e9382d16fd79 (diff) |
qtgui: fixed issue with newer versions of QT.
When creating the qApplication in the block, we have to make sure argc>0, argv contains at least one valid character (\0), and they exist over the life of the application.
Diffstat (limited to 'gr-qtgui/lib/histogram_sink_f_impl.cc')
-rw-r--r-- | gr-qtgui/lib/histogram_sink_f_impl.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gr-qtgui/lib/histogram_sink_f_impl.cc b/gr-qtgui/lib/histogram_sink_f_impl.cc index ef8a9a52c6..7519e18aba 100644 --- a/gr-qtgui/lib/histogram_sink_f_impl.cc +++ b/gr-qtgui/lib/histogram_sink_f_impl.cc @@ -57,6 +57,14 @@ namespace gr { d_size(size), d_bins(bins), d_xmin(xmin), d_xmax(xmax), d_name(name), d_nconnections(nconnections), d_parent(parent) { + // Required now for Qt; argc must be greater than 0 and argv + // must have at least one valid character. Must be valid through + // life of the qApplication: + // http://harmattan-dev.nokia.com/docs/library/html/qt4/qapplication.html + d_argc = 1; + d_argv = new char; + d_argv = '\0'; + d_main_gui = NULL; d_index = 0; @@ -83,6 +91,8 @@ namespace gr { for(int i = 0; i < d_nconnections; i++) { fft::free(d_residbufs[i]); } + + delete d_argv; } bool @@ -98,9 +108,7 @@ namespace gr { d_qApplication = qApp; } else { - int argc=0; - char **argv = NULL; - d_qApplication = new QApplication(argc, argv); + d_qApplication = new QApplication(d_argc, &d_argv); } d_main_gui = new HistogramDisplayForm(d_nconnections, d_parent); |