Commit 600b1dcf4d5682182520f62d17eb90560cd3b69b

Authored by David Graeff
Committed by David Gräff
1 parent c9da580c

Register std::vector<unsigned> to the Qt metadata system to make it work with si…

…gnal/slots. Fixes #101
openhantek/src/docks/HorizontalDock.h
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 #include <QDockWidget> 5 #include <QDockWidget>
6 #include <QGridLayout> 6 #include <QGridLayout>
7 7
  8 +#include <vector>
8 #include "definitions.h" 9 #include "definitions.h"
9 #include "settings.h" 10 #include "settings.h"
10 11
@@ -14,8 +15,8 @@ class QComboBox; @@ -14,8 +15,8 @@ class QComboBox;
14 15
15 class SiSpinBox; 16 class SiSpinBox;
16 17
17 -////////////////////////////////////////////////////////////////////////////////  
18 -/// \class HorizontalDock dockwindows.h 18 +Q_DECLARE_METATYPE(std::vector<unsigned>)
  19 +
19 /// \brief Dock window for the horizontal axis. 20 /// \brief Dock window for the horizontal axis.
20 /// It contains the settings for the timebase and the display format. 21 /// It contains the settings for the timebase and the display format.
21 class HorizontalDock : public QDockWidget { 22 class HorizontalDock : public QDockWidget {
openhantek/src/docks/SpectrumDock.cpp
@@ -64,9 +64,6 @@ SpectrumDock::SpectrumDock(DsoSettings *settings, QWidget *parent, Qt::WindowFla @@ -64,9 +64,6 @@ SpectrumDock::SpectrumDock(DsoSettings *settings, QWidget *parent, Qt::WindowFla
64 } 64 }
65 } 65 }
66 66
67 -/// \brief Cleans up everything.  
68 -SpectrumDock::~SpectrumDock() {}  
69 -  
70 /// \brief Don't close the dock, just hide it 67 /// \brief Don't close the dock, just hide it
71 /// \param event The close event that should be handled. 68 /// \param event The close event that should be handled.
72 void SpectrumDock::closeEvent(QCloseEvent *event) { 69 void SpectrumDock::closeEvent(QCloseEvent *event) {
openhantek/src/docks/SpectrumDock.h
@@ -14,8 +14,6 @@ class QComboBox; @@ -14,8 +14,6 @@ class QComboBox;
14 14
15 class SiSpinBox; 15 class SiSpinBox;
16 16
17 -////////////////////////////////////////////////////////////////////////////////  
18 -/// \class SpectrumDock dockwindows.h  
19 /// \brief Dock window for the spectrum view. 17 /// \brief Dock window for the spectrum view.
20 /// It contains the magnitude for all channels and allows to enable/disable the 18 /// It contains the magnitude for all channels and allows to enable/disable the
21 /// channels. 19 /// channels.
@@ -24,7 +22,6 @@ class SpectrumDock : public QDockWidget { @@ -24,7 +22,6 @@ class SpectrumDock : public QDockWidget {
24 22
25 public: 23 public:
26 SpectrumDock(DsoSettings *settings, QWidget *parent, Qt::WindowFlags flags = 0); 24 SpectrumDock(DsoSettings *settings, QWidget *parent, Qt::WindowFlags flags = 0);
27 - ~SpectrumDock();  
28 25
29 int setMagnitude(int channel, double magnitude); 26 int setMagnitude(int channel, double magnitude);
30 int setUsed(int channel, bool used); 27 int setUsed(int channel, bool used);
openhantek/src/docks/TriggerDock.cpp
@@ -72,9 +72,6 @@ TriggerDock::TriggerDock(DsoSettings *settings, const QStringList *specialTrigge @@ -72,9 +72,6 @@ TriggerDock::TriggerDock(DsoSettings *settings, const QStringList *specialTrigge
72 this->setSource(settings->scope.trigger.special, settings->scope.trigger.source); 72 this->setSource(settings->scope.trigger.special, settings->scope.trigger.source);
73 } 73 }
74 74
75 -/// \brief Cleans up everything.  
76 -TriggerDock::~TriggerDock() {}  
77 -  
78 /// \brief Don't close the dock, just hide it 75 /// \brief Don't close the dock, just hide it
79 /// \param event The close event that should be handled. 76 /// \param event The close event that should be handled.
80 void TriggerDock::closeEvent(QCloseEvent *event) { 77 void TriggerDock::closeEvent(QCloseEvent *event) {
openhantek/src/docks/TriggerDock.h
@@ -14,8 +14,6 @@ class QComboBox; @@ -14,8 +14,6 @@ class QComboBox;
14 14
15 class SiSpinBox; 15 class SiSpinBox;
16 16
17 -////////////////////////////////////////////////////////////////////////////////  
18 -/// \class TriggerDock dockwindows.h  
19 /// \brief Dock window for the trigger settings. 17 /// \brief Dock window for the trigger settings.
20 /// It contains the settings for the trigger mode, source and slope. 18 /// It contains the settings for the trigger mode, source and slope.
21 class TriggerDock : public QDockWidget { 19 class TriggerDock : public QDockWidget {
@@ -23,7 +21,6 @@ class TriggerDock : public QDockWidget { @@ -23,7 +21,6 @@ class TriggerDock : public QDockWidget {
23 21
24 public: 22 public:
25 TriggerDock(DsoSettings *settings, const QStringList *specialTriggers, QWidget *parent, Qt::WindowFlags flags = 0); 23 TriggerDock(DsoSettings *settings, const QStringList *specialTriggers, QWidget *parent, Qt::WindowFlags flags = 0);
26 - ~TriggerDock();  
27 24
28 int setMode(Dso::TriggerMode mode); 25 int setMode(Dso::TriggerMode mode);
29 int setSource(bool special, unsigned int id); 26 int setSource(bool special, unsigned int id);
openhantek/src/docks/VoltageDock.cpp
@@ -84,9 +84,6 @@ VoltageDock::VoltageDock(DsoSettings *settings, QWidget *parent, Qt::WindowFlags @@ -84,9 +84,6 @@ VoltageDock::VoltageDock(DsoSettings *settings, QWidget *parent, Qt::WindowFlags
84 } 84 }
85 } 85 }
86 86
87 -/// \brief Cleans up everything.  
88 -VoltageDock::~VoltageDock() {}  
89 -  
90 /// \brief Don't close the dock, just hide it 87 /// \brief Don't close the dock, just hide it
91 /// \param event The close event that should be handled. 88 /// \param event The close event that should be handled.
92 void VoltageDock::closeEvent(QCloseEvent *event) { 89 void VoltageDock::closeEvent(QCloseEvent *event) {
openhantek/src/docks/VoltageDock.h
@@ -14,8 +14,6 @@ class QComboBox; @@ -14,8 +14,6 @@ class QComboBox;
14 14
15 class SiSpinBox; 15 class SiSpinBox;
16 16
17 -////////////////////////////////////////////////////////////////////////////////  
18 -/// \class VoltageDock dockwindows.h  
19 /// \brief Dock window for the voltage channel settings. 17 /// \brief Dock window for the voltage channel settings.
20 /// It contains the settings for gain and coupling for both channels and 18 /// It contains the settings for gain and coupling for both channels and
21 /// allows to enable/disable the channels. 19 /// allows to enable/disable the channels.
@@ -24,7 +22,6 @@ class VoltageDock : public QDockWidget { @@ -24,7 +22,6 @@ class VoltageDock : public QDockWidget {
24 22
25 public: 23 public:
26 VoltageDock(DsoSettings *settings, QWidget *parent, Qt::WindowFlags flags = 0); 24 VoltageDock(DsoSettings *settings, QWidget *parent, Qt::WindowFlags flags = 0);
27 - ~VoltageDock();  
28 25
29 int setCoupling(int channel, Dso::Coupling coupling); 26 int setCoupling(int channel, Dso::Coupling coupling);
30 int setGain(int channel, double gain); 27 int setGain(int channel, double gain);
openhantek/src/docks/dockwindows.cpp
@@ -28,4 +28,5 @@ void registerDockMetaTypes() { @@ -28,4 +28,5 @@ void registerDockMetaTypes() {
28 qRegisterMetaType<Dso::ChannelMode>(); 28 qRegisterMetaType<Dso::ChannelMode>();
29 qRegisterMetaType<Dso::WindowFunction>(); 29 qRegisterMetaType<Dso::WindowFunction>();
30 qRegisterMetaType<Dso::InterpolationMode>(); 30 qRegisterMetaType<Dso::InterpolationMode>();
  31 + qRegisterMetaType<std::vector<unsigned> >();
31 } 32 }