diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2013-07-03 15:12:34 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2013-07-04 13:08:51 +0300 |
commit | 0963cf7feda67225700f4291264e68c9060046f6 (patch) | |
tree | 7a3e03f116e5ff2466c6e1311c9d3de4ed4f8034 /examples/spectrum/spectrumapp | |
parent | 28ed69c2f6ba8520dc0202b94a4a3f8260ccda7e (diff) |
Data proxy implementation for bars.
Old QDataSet can be used with custom QOldDataProxy. This will be
removed entirely once we have a viable variant based proxy to use,
as it provides no real additional value over just using default
proxy directly.
Change-Id: Iee492152eec5d33b7a488053447fae6027409d71
Reviewed-by: Mika Salmela <mika.salmela@digia.com>
Diffstat (limited to 'examples/spectrum/spectrumapp')
-rw-r--r-- | examples/spectrum/spectrumapp/main.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/spectrum/spectrumapp/main.cpp b/examples/spectrum/spectrumapp/main.cpp index 9865802a..19f195fa 100644 --- a/examples/spectrum/spectrumapp/main.cpp +++ b/examples/spectrum/spectrumapp/main.cpp @@ -41,6 +41,7 @@ #include "q3dbars.h" #include "engine.h" #include "utils.h" +#include "qolddataproxy.h" #include <QGuiApplication> #include <QAudio> @@ -118,6 +119,9 @@ MainApp::MainApp(Q3DBars *window) QObject::connect(m_engine, &Engine::stateChanged, this, &MainApp::stateChanged); m_restartTimer->setSingleShot(true); QObject::connect(m_restartTimer, &QTimer::timeout, this, &MainApp::restart); + + QOldDataProxy *proxy = new QOldDataProxy; + m_chart->setDataProxy(proxy); } MainApp::~MainApp() @@ -156,7 +160,7 @@ void MainApp::spectrumChanged(qint64 position, qint64 length, const FrequencySpe } } if (data.size() > 0) - m_chart->addDataRow(data); + static_cast<QOldDataProxy *>(m_chart->dataProxy())->addDataRow(data); } void MainApp::stateChanged(QAudio::Mode mode, QAudio::State state) |