mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-10-31 13:00:26 -04:00 
			
		
		
		
	Add parent to delegate constructors.
This commit is contained in:
		
							parent
							
								
									6979117b26
								
							
						
					
					
						commit
						5e79f06c0e
					
				| @ -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 @@ | ||||
| 
 | ||||
| #include "datetimedelegate.h" | ||||
| 
 | ||||
| DateTimeDelegate::DateTimeDelegate(QString format) : | ||||
| DateTimeDelegate::DateTimeDelegate(QString format, QObject *parent) : | ||||
|     QStyledItemDelegate(parent), | ||||
|     m_format(format) | ||||
| { | ||||
| } | ||||
|  | ||||
| @ -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 @@ | ||||
| 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: | ||||
|  | ||||
| @ -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: | ||||
|     } | ||||
| }; | ||||
| 
 | ||||
| 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) | ||||
|  | ||||
| @ -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 @@ | ||||
| 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; | ||||
|  | ||||
| @ -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) | ||||
|  | ||||
| @ -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: | ||||
|  | ||||
| @ -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) | ||||
| { | ||||
|  | ||||
| @ -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; } | ||||
|  | ||||
| @ -20,7 +20,8 @@ | ||||
| 
 | ||||
| #include "nanosecondsdelegate.h" | ||||
| 
 | ||||
| NanoSecondsDelegate::NanoSecondsDelegate() | ||||
| NanoSecondsDelegate::NanoSecondsDelegate(QObject *parent) : | ||||
|     QStyledItemDelegate(parent) | ||||
| { | ||||
| } | ||||
| 
 | ||||
|  | ||||
| @ -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; | ||||
| 
 | ||||
| }; | ||||
|  | ||||
| @ -22,7 +22,8 @@ | ||||
| 
 | ||||
| #include "timedelegate.h" | ||||
| 
 | ||||
| TimeDelegate::TimeDelegate(QString format) : | ||||
| TimeDelegate::TimeDelegate(QString format, QObject *parent) : | ||||
|     QStyledItemDelegate(parent), | ||||
|     m_format(format) | ||||
| { | ||||
| } | ||||
|  | ||||
| @ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user