Browse Source

Add parent to delegate constructors.

chirpmodem-v8.0.0
srcejon 3 years ago
parent
commit
5e79f06c0e
  1. 5
      sdrgui/gui/datetimedelegate.cpp
  2. 4
      sdrgui/gui/datetimedelegate.h
  3. 8
      sdrgui/gui/decimaldelegate.cpp
  4. 6
      sdrgui/gui/decimaldelegate.h
  5. 3
      sdrgui/gui/frequencydelegate.cpp
  6. 2
      sdrgui/gui/frequencydelegate.h
  7. 6
      sdrgui/gui/int64delegate.cpp
  8. 4
      sdrgui/gui/int64delegate.h
  9. 3
      sdrgui/gui/nanosecondsdelegate.cpp
  10. 2
      sdrgui/gui/nanosecondsdelegate.h
  11. 3
      sdrgui/gui/timedelegate.cpp
  12. 2
      sdrgui/gui/timedelegate.h

5
sdrgui/gui/datetimedelegate.cpp

@ -2,7 +2,7 @@ @@ -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 <f4exb06@gmail.com> //
// Copyright (C) 2020-2022 Jon Beniston, M7RCE <jon@beniston.com> //
// Copyright (C) 2020-2024 Jon Beniston, M7RCE <jon@beniston.com> //
// //
// 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 @@ @@ -22,7 +22,8 @@
#include "datetimedelegate.h"
DateTimeDelegate::DateTimeDelegate(QString format) :
DateTimeDelegate::DateTimeDelegate(QString format, QObject *parent) :
QStyledItemDelegate(parent),
m_format(format)
{
}

4
sdrgui/gui/datetimedelegate.h

@ -2,7 +2,7 @@ @@ -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 <f4exb06@gmail.com> //
// Copyright (C) 2021-2022 Jon Beniston, M7RCE <jon@beniston.com> //
// Copyright (C) 2021-2024 Jon Beniston, M7RCE <jon@beniston.com> //
// //
// 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 @@ @@ -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:

8
sdrgui/gui/decimaldelegate.cpp

@ -2,7 +2,7 @@ @@ -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 <f4exb06@gmail.com> //
// Copyright (C) 2020-2022 Jon Beniston, M7RCE <jon@beniston.com> //
// Copyright (C) 2020-2024 Jon Beniston, M7RCE <jon@beniston.com> //
// //
// 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: @@ -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<double>::max()),
m_max(std::numeric_limits<double>::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)

6
sdrgui/gui/decimaldelegate.h

@ -2,7 +2,7 @@ @@ -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 <f4exb06@gmail.com> //
// Copyright (C) 2021-2023 Jon Beniston, M7RCE <jon@beniston.com> //
// Copyright (C) 2021-2024 Jon Beniston, M7RCE <jon@beniston.com> //
// //
// 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 @@ @@ -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;

3
sdrgui/gui/frequencydelegate.cpp

@ -23,7 +23,8 @@ @@ -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)

2
sdrgui/gui/frequencydelegate.h

@ -29,7 +29,7 @@ @@ -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:

6
sdrgui/gui/int64delegate.cpp

@ -20,13 +20,15 @@ @@ -20,13 +20,15 @@
#include "int64delegate.h"
#include "int64validator.h"
Int64Delegate::Int64Delegate() :
Int64Delegate::Int64Delegate(QObject *parent) :
QStyledItemDelegate(parent),
m_min(-std::numeric_limits<qint64>::max()),
m_max(std::numeric_limits<qint64>::max())
{
}
Int64Delegate::Int64Delegate(qint64 min, qint64 max) :
Int64Delegate::Int64Delegate(qint64 min, qint64 max, QObject *parent) :
QStyledItemDelegate(parent),
m_min(min),
m_max(max)
{

4
sdrgui/gui/int64delegate.h

@ -27,8 +27,8 @@ @@ -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; }

3
sdrgui/gui/nanosecondsdelegate.cpp

@ -20,7 +20,8 @@ @@ -20,7 +20,8 @@
#include "nanosecondsdelegate.h"
NanoSecondsDelegate::NanoSecondsDelegate()
NanoSecondsDelegate::NanoSecondsDelegate(QObject *parent) :
QStyledItemDelegate(parent)
{
}

2
sdrgui/gui/nanosecondsdelegate.h

@ -29,7 +29,7 @@ @@ -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;
};

3
sdrgui/gui/timedelegate.cpp

@ -22,7 +22,8 @@ @@ -22,7 +22,8 @@
#include "timedelegate.h"
TimeDelegate::TimeDelegate(QString format) :
TimeDelegate::TimeDelegate(QString format, QObject *parent) :
QStyledItemDelegate(parent),
m_format(format)
{
}

2
sdrgui/gui/timedelegate.h

@ -29,7 +29,7 @@ @@ -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:

Loading…
Cancel
Save