mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-23 08:28:36 -05:00
Use common delegate
This commit is contained in:
parent
5a14126549
commit
cd2873dde8
@ -33,6 +33,7 @@
|
|||||||
#include "gui/basicchannelsettingsdialog.h"
|
#include "gui/basicchannelsettingsdialog.h"
|
||||||
#include "gui/devicestreamselectiondialog.h"
|
#include "gui/devicestreamselectiondialog.h"
|
||||||
#include "gui/crightclickenabler.h"
|
#include "gui/crightclickenabler.h"
|
||||||
|
#include "gui/decimaldelegate.h"
|
||||||
#include "maincore.h"
|
#include "maincore.h"
|
||||||
|
|
||||||
#include "noisefigure.h"
|
#include "noisefigure.h"
|
||||||
@ -40,26 +41,6 @@
|
|||||||
#include "noisefigurecontroldialog.h"
|
#include "noisefigurecontroldialog.h"
|
||||||
#include "noisefigureenrdialog.h"
|
#include "noisefigureenrdialog.h"
|
||||||
|
|
||||||
// Deligate for table to control precision used to display floating point values
|
|
||||||
class DecimalDelegate : public QStyledItemDelegate {
|
|
||||||
|
|
||||||
public:
|
|
||||||
DecimalDelegate(int precision = 2) :
|
|
||||||
m_precision(precision)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual QString displayText(const QVariant &value, const QLocale &locale) const override
|
|
||||||
{
|
|
||||||
(void) locale;
|
|
||||||
return QString::number(value.toDouble(), 'f', m_precision);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
int m_precision;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
void NoiseFigureGUI::resizeTable()
|
void NoiseFigureGUI::resizeTable()
|
||||||
{
|
{
|
||||||
// Fill table with a row of dummy data that will size the columns nicely
|
// Fill table with a row of dummy data that will size the columns nicely
|
||||||
|
Loading…
Reference in New Issue
Block a user