diff --git a/sdrgui/gui/datetimedelegate.cpp b/sdrgui/gui/datetimedelegate.cpp index 870b96193..0bc1d211d 100644 --- a/sdrgui/gui/datetimedelegate.cpp +++ b/sdrgui/gui/datetimedelegate.cpp @@ -2,7 +2,7 @@ // Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany // // written by Christian Daniel // // Copyright (C) 2015-2020 Edouard Griffiths, F4EXB // -// Copyright (C) 2020-2022 Jon Beniston, M7RCE // +// Copyright (C) 2020-2024 Jon Beniston, M7RCE // // // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // @@ -22,7 +22,8 @@ #include "datetimedelegate.h" -DateTimeDelegate::DateTimeDelegate(QString format) : +DateTimeDelegate::DateTimeDelegate(QString format, QObject *parent) : + QStyledItemDelegate(parent), m_format(format) { } diff --git a/sdrgui/gui/datetimedelegate.h b/sdrgui/gui/datetimedelegate.h index d54ccafda..838979691 100644 --- a/sdrgui/gui/datetimedelegate.h +++ b/sdrgui/gui/datetimedelegate.h @@ -2,7 +2,7 @@ // Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany // // written by Christian Daniel // // Copyright (C) 2015-2019 Edouard Griffiths, F4EXB // -// Copyright (C) 2021-2022 Jon Beniston, M7RCE // +// Copyright (C) 2021-2024 Jon Beniston, M7RCE // // // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // @@ -29,7 +29,7 @@ class SDRGUI_API DateTimeDelegate : public QStyledItemDelegate { public: - DateTimeDelegate(QString format = "yyyy/MM/dd hh:mm:ss"); + DateTimeDelegate(QString format = "yyyy/MM/dd hh:mm:ss", QObject *parent = nullptr); virtual QString displayText(const QVariant &value, const QLocale &locale) const override; private: diff --git a/sdrgui/gui/decimaldelegate.cpp b/sdrgui/gui/decimaldelegate.cpp index 2b56b74cd..bc3f297a5 100644 --- a/sdrgui/gui/decimaldelegate.cpp +++ b/sdrgui/gui/decimaldelegate.cpp @@ -2,7 +2,7 @@ // Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany // // written by Christian Daniel // // Copyright (C) 2015-2020 Edouard Griffiths, F4EXB // -// Copyright (C) 2020-2022 Jon Beniston, M7RCE // +// Copyright (C) 2020-2024 Jon Beniston, M7RCE // // // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // @@ -41,14 +41,16 @@ public: } }; -DecimalDelegate::DecimalDelegate(int precision) : +DecimalDelegate::DecimalDelegate(int precision, QObject *parent) : + QStyledItemDelegate(parent), m_precision(precision), m_min(-std::numeric_limits::max()), m_max(std::numeric_limits::max()) { } -DecimalDelegate::DecimalDelegate(int precision, double min, double max) : +DecimalDelegate::DecimalDelegate(int precision, double min, double max, QObject *parent) : + QStyledItemDelegate(parent), m_precision(precision), m_min(min), m_max(max) diff --git a/sdrgui/gui/decimaldelegate.h b/sdrgui/gui/decimaldelegate.h index a88ec4dad..5ff79e57b 100644 --- a/sdrgui/gui/decimaldelegate.h +++ b/sdrgui/gui/decimaldelegate.h @@ -2,7 +2,7 @@ // Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany // // written by Christian Daniel // // Copyright (C) 2015-2019 Edouard Griffiths, F4EXB // -// Copyright (C) 2021-2023 Jon Beniston, M7RCE // +// Copyright (C) 2021-2024 Jon Beniston, M7RCE // // // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // @@ -30,8 +30,8 @@ class SDRGUI_API DecimalDelegate : public QStyledItemDelegate { public: - DecimalDelegate(int precision = 2); - DecimalDelegate(int precision, double min, double max); + DecimalDelegate(int precision = 2, QObject *parent = nullptr); + DecimalDelegate(int precision, double min, double max, QObject *parent = nullptr); virtual QString displayText(const QVariant &value, const QLocale &locale) const override; QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override; diff --git a/sdrgui/gui/frequencydelegate.cpp b/sdrgui/gui/frequencydelegate.cpp index 057f5d3a4..4953d2c72 100644 --- a/sdrgui/gui/frequencydelegate.cpp +++ b/sdrgui/gui/frequencydelegate.cpp @@ -23,7 +23,8 @@ #include "frequencydelegate.h" #include "int64validator.h" -FrequencyDelegate::FrequencyDelegate(const QString& units, int precision, bool group) : +FrequencyDelegate::FrequencyDelegate(const QString& units, int precision, bool group, QObject *parent) : + QStyledItemDelegate(parent), m_units(units), m_precision(precision), m_group(group) diff --git a/sdrgui/gui/frequencydelegate.h b/sdrgui/gui/frequencydelegate.h index ff7aa8d16..700b11e89 100644 --- a/sdrgui/gui/frequencydelegate.h +++ b/sdrgui/gui/frequencydelegate.h @@ -29,7 +29,7 @@ class SDRGUI_API FrequencyDelegate : public QStyledItemDelegate { public: - FrequencyDelegate(const QString& units = "kHz", int precision=1, bool group=true); + FrequencyDelegate(const QString& units = "kHz", int precision=1, bool group=true, QObject *parent = nullptr); QString displayText(const QVariant &value, const QLocale &locale) const override; protected: diff --git a/sdrgui/gui/int64delegate.cpp b/sdrgui/gui/int64delegate.cpp index c5a8e7781..4fff34890 100644 --- a/sdrgui/gui/int64delegate.cpp +++ b/sdrgui/gui/int64delegate.cpp @@ -20,13 +20,15 @@ #include "int64delegate.h" #include "int64validator.h" -Int64Delegate::Int64Delegate() : +Int64Delegate::Int64Delegate(QObject *parent) : + QStyledItemDelegate(parent), m_min(-std::numeric_limits::max()), m_max(std::numeric_limits::max()) { } -Int64Delegate::Int64Delegate(qint64 min, qint64 max) : +Int64Delegate::Int64Delegate(qint64 min, qint64 max, QObject *parent) : + QStyledItemDelegate(parent), m_min(min), m_max(max) { diff --git a/sdrgui/gui/int64delegate.h b/sdrgui/gui/int64delegate.h index e69688f07..9bea32ca4 100644 --- a/sdrgui/gui/int64delegate.h +++ b/sdrgui/gui/int64delegate.h @@ -27,8 +27,8 @@ class SDRGUI_API Int64Delegate : public QStyledItemDelegate { public: - Int64Delegate(); - Int64Delegate(qint64 min, qint64 max); + Int64Delegate(QObject *parent = nullptr); + Int64Delegate(qint64 min, qint64 max, QObject *parent = nullptr); virtual QString displayText(const QVariant &value, const QLocale &locale) const override; virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override; void setMin(qint64 min) { m_min = min; } diff --git a/sdrgui/gui/nanosecondsdelegate.cpp b/sdrgui/gui/nanosecondsdelegate.cpp index afc107f81..5a1cb93ba 100644 --- a/sdrgui/gui/nanosecondsdelegate.cpp +++ b/sdrgui/gui/nanosecondsdelegate.cpp @@ -20,7 +20,8 @@ #include "nanosecondsdelegate.h" -NanoSecondsDelegate::NanoSecondsDelegate() +NanoSecondsDelegate::NanoSecondsDelegate(QObject *parent) : + QStyledItemDelegate(parent) { } diff --git a/sdrgui/gui/nanosecondsdelegate.h b/sdrgui/gui/nanosecondsdelegate.h index 5122bb69a..1914d5470 100644 --- a/sdrgui/gui/nanosecondsdelegate.h +++ b/sdrgui/gui/nanosecondsdelegate.h @@ -29,7 +29,7 @@ class SDRGUI_API NanoSecondsDelegate : public QStyledItemDelegate { public: - NanoSecondsDelegate(); + NanoSecondsDelegate(QObject *parent = nullptr); virtual QString displayText(const QVariant &value, const QLocale &locale) const override; }; diff --git a/sdrgui/gui/timedelegate.cpp b/sdrgui/gui/timedelegate.cpp index 0c2e50d63..b0a0560f0 100644 --- a/sdrgui/gui/timedelegate.cpp +++ b/sdrgui/gui/timedelegate.cpp @@ -22,7 +22,8 @@ #include "timedelegate.h" -TimeDelegate::TimeDelegate(QString format) : +TimeDelegate::TimeDelegate(QString format, QObject *parent) : + QStyledItemDelegate(parent), m_format(format) { } diff --git a/sdrgui/gui/timedelegate.h b/sdrgui/gui/timedelegate.h index adab31fdf..fb4cb2270 100644 --- a/sdrgui/gui/timedelegate.h +++ b/sdrgui/gui/timedelegate.h @@ -29,7 +29,7 @@ class SDRGUI_API TimeDelegate : public QStyledItemDelegate { public: - TimeDelegate(QString format = "hh:mm:ss"); + TimeDelegate(QString format = "hh:mm:ss", QObject *parent = nullptr); virtual QString displayText(const QVariant &value, const QLocale &locale) const override; private: