From 934e73f7a79f98a515325baebcccabb8abb51d45 Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 12 Apr 2017 23:41:30 +0200 Subject: [PATCH] RTL-SDR: moved input object creation at top of GUI comstructor --- plugins/samplesource/rtlsdr/rtlsdrgui.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/samplesource/rtlsdr/rtlsdrgui.cpp b/plugins/samplesource/rtlsdr/rtlsdrgui.cpp index d6660fa9e..bfa328b6d 100644 --- a/plugins/samplesource/rtlsdr/rtlsdrgui.cpp +++ b/plugins/samplesource/rtlsdr/rtlsdrgui.cpp @@ -36,7 +36,10 @@ RTLSDRGui::RTLSDRGui(DeviceSourceAPI *deviceAPI, QWidget* parent) : m_sampleSource(0), m_lastEngineState((DSPDeviceSourceEngine::State)-1) { - ui->setupUi(this); + m_sampleSource = new RTLSDRInput(m_deviceAPI); + m_deviceAPI->setSource(m_sampleSource); + + ui->setupUi(this); ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold)); ui->centerFrequency->setValueRange(7, 24000U, 1900000U); @@ -49,9 +52,7 @@ RTLSDRGui::RTLSDRGui(DeviceSourceAPI *deviceAPI, QWidget* parent) : displaySettings(); - m_sampleSource = new RTLSDRInput(m_deviceAPI); connect(m_sampleSource->getOutputMessageQueueToGUI(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages())); - m_deviceAPI->setSource(m_sampleSource); char recFileNameCStr[30]; sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID());