"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/kdefrontend/dockwidgets/HistogramDock.cpp" between
labplot-2.8.1.tar.gz and labplot-2.8.2.tar.gz

About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.

HistogramDock.cpp  (labplot-2.8.1):HistogramDock.cpp  (labplot-2.8.2)
/*************************************************************************** /***************************************************************************
File : HistogramDock.cpp File : HistogramDock.cpp
Project : LabPlot Project : LabPlot
Description : widget for Histogram properties Description : widget for Histogram properties
-------------------------------------------------------------------- --------------------------------------------------------------------
Copyright : (C) 2016 Anu Mittal (anu22mittal@gmail.com) Copyright : (C) 2016 Anu Mittal (anu22mittal@gmail.com)
Copyright : (C) 2018 by Alexander Semke (alexander.semke@web.de) Copyright : (C) 2018-2021 by Alexander Semke (alexander.semke@web .de)
***************************************************************************/ ***************************************************************************/
/*************************************************************************** /***************************************************************************
* * * *
* This program is free software; you can redistribute it and/or modify * * 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 * * it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or * * the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. * * (at your option) any later version. *
* * * *
skipping to change at line 132 skipping to change at line 132
connect( ui.chkVisible, SIGNAL(clicked(bool)), this, SLOT(visibilityChang ed(bool)) ); connect( ui.chkVisible, SIGNAL(clicked(bool)), this, SLOT(visibilityChang ed(bool)) );
connect( cbDataColumn, SIGNAL(currentModelIndexChanged(QModelIndex)), thi s, SLOT(dataColumnChanged(QModelIndex)) ); connect( cbDataColumn, SIGNAL(currentModelIndexChanged(QModelIndex)), thi s, SLOT(dataColumnChanged(QModelIndex)) );
connect( ui.cbType, SIGNAL(currentIndexChanged(int)), this, SLOT(typeChan ged(int)) ); connect( ui.cbType, SIGNAL(currentIndexChanged(int)), this, SLOT(typeChan ged(int)) );
connect( ui.cbOrientation, SIGNAL(currentIndexChanged(int)), this, SLOT(o rientationChanged(int))); connect( ui.cbOrientation, SIGNAL(currentIndexChanged(int)), this, SLOT(o rientationChanged(int)));
connect( ui.cbBinningMethod, SIGNAL(currentIndexChanged(int)), this, SLOT (binningMethodChanged(int)) ); connect( ui.cbBinningMethod, SIGNAL(currentIndexChanged(int)), this, SLOT (binningMethodChanged(int)) );
connect(ui.sbBinCount, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::va lueChanged), this, &HistogramDock::binCountChanged); connect(ui.sbBinCount, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::va lueChanged), this, &HistogramDock::binCountChanged);
connect(ui.leBinWidth, &QLineEdit::textChanged, this, &HistogramDock::bin WidthChanged); connect(ui.leBinWidth, &QLineEdit::textChanged, this, &HistogramDock::bin WidthChanged);
connect( ui.chkAutoBinRanges, &QCheckBox::stateChanged, this, &HistogramD ock::autoBinRangesChanged ); connect( ui.chkAutoBinRanges, &QCheckBox::stateChanged, this, &HistogramD ock::autoBinRangesChanged );
connect( ui.leBinRangesMin, &QLineEdit::textChanged, this, &HistogramDock ::binRangesMinChanged ); connect( ui.leBinRangesMin, &QLineEdit::textChanged, this, &HistogramDock ::binRangesMinChanged );
connect( ui.leBinRangesMax, &QLineEdit::textChanged, this, &HistogramDock ::binRangesMaxChanged ); connect( ui.leBinRangesMax, &QLineEdit::textChanged, this, &HistogramDock ::binRangesMaxChanged );
connect(ui.dteBinRangesMin, &QDateTimeEdit::dateTimeChanged, this, &Histo
gramDock::binRangesMinDateTimeChanged);
connect(ui.dteBinRangesMax, &QDateTimeEdit::dateTimeChanged, this, &Histo
gramDock::binRangesMaxDateTimeChanged);
//Line //Line
connect(ui.cbLineType, static_cast<void (QComboBox::*)(int)>(&QComboBox:: currentIndexChanged), this, &HistogramDock::lineTypeChanged); connect(ui.cbLineType, static_cast<void (QComboBox::*)(int)>(&QComboBox:: currentIndexChanged), this, &HistogramDock::lineTypeChanged);
connect(ui.cbLineStyle, static_cast<void (QComboBox::*)(int)>(&QComboBox: :currentIndexChanged), this, &HistogramDock::lineStyleChanged); connect(ui.cbLineStyle, static_cast<void (QComboBox::*)(int)>(&QComboBox: :currentIndexChanged), this, &HistogramDock::lineStyleChanged);
connect(ui.kcbLineColor, &KColorButton::changed, this, &HistogramDock::li neColorChanged); connect(ui.kcbLineColor, &KColorButton::changed, this, &HistogramDock::li neColorChanged);
connect(ui.sbLineWidth, static_cast<void (QDoubleSpinBox::*)(double)>(&QD oubleSpinBox::valueChanged), this, &HistogramDock::lineWidthChanged); connect(ui.sbLineWidth, static_cast<void (QDoubleSpinBox::*)(double)>(&QD oubleSpinBox::valueChanged), this, &HistogramDock::lineWidthChanged);
connect(ui.sbLineOpacity, static_cast<void (QSpinBox::*)(int)>(&QSpinBox: :valueChanged), this, &HistogramDock::lineOpacityChanged); connect(ui.sbLineOpacity, static_cast<void (QSpinBox::*)(int)>(&QSpinBox: :valueChanged), this, &HistogramDock::lineOpacityChanged);
//Symbol //Symbol
connect( ui.cbSymbolStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(s ymbolsStyleChanged(int)) ); connect( ui.cbSymbolStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(s ymbolsStyleChanged(int)) );
skipping to change at line 163 skipping to change at line 165
//Values //Values
connect( ui.cbValuesType, SIGNAL(currentIndexChanged(int)), this, SLOT(va luesTypeChanged(int)) ); connect( ui.cbValuesType, SIGNAL(currentIndexChanged(int)), this, SLOT(va luesTypeChanged(int)) );
connect( cbValuesColumn, SIGNAL(currentModelIndexChanged(QModelIndex)), t his, SLOT(valuesColumnChanged(QModelIndex)) ); connect( cbValuesColumn, SIGNAL(currentModelIndexChanged(QModelIndex)), t his, SLOT(valuesColumnChanged(QModelIndex)) );
connect( ui.cbValuesPosition, SIGNAL(currentIndexChanged(int)), this, SLO T(valuesPositionChanged(int)) ); connect( ui.cbValuesPosition, SIGNAL(currentIndexChanged(int)), this, SLO T(valuesPositionChanged(int)) );
connect( ui.sbValuesDistance, SIGNAL(valueChanged(double)), this, SLOT(va luesDistanceChanged(double)) ); connect( ui.sbValuesDistance, SIGNAL(valueChanged(double)), this, SLOT(va luesDistanceChanged(double)) );
connect( ui.sbValuesRotation, SIGNAL(valueChanged(int)), this, SLOT(value sRotationChanged(int)) ); connect( ui.sbValuesRotation, SIGNAL(valueChanged(int)), this, SLOT(value sRotationChanged(int)) );
connect( ui.sbValuesOpacity, SIGNAL(valueChanged(int)), this, SLOT(values OpacityChanged(int)) ); connect( ui.sbValuesOpacity, SIGNAL(valueChanged(int)), this, SLOT(values OpacityChanged(int)) );
connect(ui.cbValuesNumericFormat, QOverload<int>::of(&QComboBox::currentI ndexChanged), this, &HistogramDock::valuesNumericFormatChanged); connect(ui.cbValuesNumericFormat, QOverload<int>::of(&QComboBox::currentI ndexChanged), this, &HistogramDock::valuesNumericFormatChanged);
connect(ui.sbValuesPrecision, QOverload<int>::of(&QSpinBox::valueChanged) , this, &HistogramDock::valuesPrecisionChanged); connect(ui.sbValuesPrecision, QOverload<int>::of(&QSpinBox::valueChanged) , this, &HistogramDock::valuesPrecisionChanged);
connect(ui.cbValuesDateTimeFormat, &QComboBox::currentTextChanged, this, &HistogramDock::valuesDateTimeFormatChanged); connect(ui.cbValuesDateTimeFormat, &QComboBox::currentTextChanged, this, &HistogramDock::valuesDateTimeFormatChanged);
connect( ui.leValuesPrefix, SIGNAL(returnPressed()), this, SLOT(valuesPre connect(ui.leValuesPrefix, &QLineEdit::textChanged, this, &HistogramDock:
fixChanged()) ); :valuesPrefixChanged);
connect( ui.leValuesSuffix, SIGNAL(returnPressed()), this, SLOT(valuesSuf connect(ui.leValuesSuffix, &QLineEdit::textChanged, this, &HistogramDock:
fixChanged()) ); :valuesSuffixChanged);
connect( ui.kfrValuesFont, SIGNAL(fontSelected(QFont)), this, SLOT(values FontChanged(QFont)) ); connect( ui.kfrValuesFont, SIGNAL(fontSelected(QFont)), this, SLOT(values FontChanged(QFont)) );
connect( ui.kcbValuesColor, SIGNAL(changed(QColor)), this, SLOT(valuesCol orChanged(QColor)) ); connect( ui.kcbValuesColor, SIGNAL(changed(QColor)), this, SLOT(valuesCol orChanged(QColor)) );
//Filling //Filling
connect(ui.chkFillingEnabled, &QCheckBox::stateChanged, this, &HistogramD ock::fillingEnabledChanged); connect(ui.chkFillingEnabled, &QCheckBox::stateChanged, this, &HistogramD ock::fillingEnabledChanged);
connect( ui.cbFillingType, SIGNAL(currentIndexChanged(int)), this, SLOT(f illingTypeChanged(int)) ); connect( ui.cbFillingType, SIGNAL(currentIndexChanged(int)), this, SLOT(f illingTypeChanged(int)) );
connect( ui.cbFillingColorStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(fillingColorStyleChanged(int)) ); connect( ui.cbFillingColorStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(fillingColorStyleChanged(int)) );
connect( ui.cbFillingImageStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(fillingImageStyleChanged(int)) ); connect( ui.cbFillingImageStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(fillingImageStyleChanged(int)) );
connect( ui.cbFillingBrushStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(fillingBrushStyleChanged(int)) ); connect( ui.cbFillingBrushStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(fillingBrushStyleChanged(int)) );
connect( ui.bFillingOpen, SIGNAL(clicked(bool)), this, SLOT(selectFile()) ); connect( ui.bFillingOpen, SIGNAL(clicked(bool)), this, SLOT(selectFile()) );
connect( ui.leFillingFileName, SIGNAL(returnPressed()), this, SLOT(fileNa meChanged()) ); connect(ui.leFillingFileName, &QLineEdit::textChanged, this, &HistogramDo ck::fileNameChanged);
connect( ui.leFillingFileName, SIGNAL(textChanged(QString)), this, SLOT(f ileNameChanged()) ); connect( ui.leFillingFileName, SIGNAL(textChanged(QString)), this, SLOT(f ileNameChanged()) );
connect( ui.kcbFillingFirstColor, SIGNAL(changed(QColor)), this, SLOT(fil lingFirstColorChanged(QColor)) ); connect( ui.kcbFillingFirstColor, SIGNAL(changed(QColor)), this, SLOT(fil lingFirstColorChanged(QColor)) );
connect( ui.kcbFillingSecondColor, SIGNAL(changed(QColor)), this, SLOT(fi llingSecondColorChanged(QColor)) ); connect( ui.kcbFillingSecondColor, SIGNAL(changed(QColor)), this, SLOT(fi llingSecondColorChanged(QColor)) );
connect( ui.sbFillingOpacity, SIGNAL(valueChanged(int)), this, SLOT(filli ngOpacityChanged(int)) ); connect( ui.sbFillingOpacity, SIGNAL(valueChanged(int)), this, SLOT(filli ngOpacityChanged(int)) );
//Error bars //Error bars
connect( ui.cbErrorType, SIGNAL(currentIndexChanged(int)), this, SLOT(err orTypeChanged(int)) ); connect( ui.cbErrorType, SIGNAL(currentIndexChanged(int)), this, SLOT(err orTypeChanged(int)) );
connect( ui.cbErrorBarsType, SIGNAL(currentIndexChanged(int)), this, SLOT (errorBarsTypeChanged(int)) ); connect( ui.cbErrorBarsType, SIGNAL(currentIndexChanged(int)), this, SLOT (errorBarsTypeChanged(int)) );
connect( ui.sbErrorBarsCapSize, SIGNAL(valueChanged(double)), this, SLOT( errorBarsCapSizeChanged(double)) ); connect( ui.sbErrorBarsCapSize, SIGNAL(valueChanged(double)), this, SLOT( errorBarsCapSizeChanged(double)) );
connect( ui.cbErrorBarsStyle, SIGNAL(currentIndexChanged(int)), this, SLO T(errorBarsStyleChanged(int)) ); connect( ui.cbErrorBarsStyle, SIGNAL(currentIndexChanged(int)), this, SLO T(errorBarsStyleChanged(int)) );
skipping to change at line 385 skipping to change at line 387
ui.lName->setEnabled(true); ui.lName->setEnabled(true);
ui.leName->setEnabled(true); ui.leName->setEnabled(true);
ui.lComment->setEnabled(true); ui.lComment->setEnabled(true);
ui.leComment->setEnabled(true); ui.leComment->setEnabled(true);
ui.lXColumn->setEnabled(true); ui.lXColumn->setEnabled(true);
cbDataColumn->setEnabled(true); cbDataColumn->setEnabled(true);
this->setModelIndexFromColumn(cbDataColumn, m_curve->dataColumn() ); this->setModelIndexFromColumn(cbDataColumn, m_curve->dataColumn() );
this->setModelIndexFromColumn(cbValuesColumn, m_curve->valuesColu mn()); this->setModelIndexFromColumn(cbValuesColumn, m_curve->valuesColu mn());
ui.leName->setText(m_curve->name()); ui.leName->setText(m_curve->name());
ui.leComment->setText(m_curve->comment()); ui.leComment->setText(m_curve->comment());
} else { } else {
ui.lName->setEnabled(false); ui.lName->setEnabled(false);
ui.leName->setEnabled(false); ui.leName->setEnabled(false);
ui.lComment->setEnabled(false); ui.lComment->setEnabled(false);
ui.leComment->setEnabled(false); ui.leComment->setEnabled(false);
ui.lXColumn->setEnabled(false); ui.lXColumn->setEnabled(false);
cbDataColumn->setEnabled(false); cbDataColumn->setEnabled(false);
cbDataColumn->setCurrentModelIndex(QModelIndex()); cbDataColumn->setCurrentModelIndex(QModelIndex());
cbValuesColumn->setCurrentModelIndex(QModelIndex()); cbValuesColumn->setCurrentModelIndex(QModelIndex());
ui.leName->setText(QString()); ui.leName->setText(QString());
ui.leComment->setText(QString()); ui.leComment->setText(QString());
} }
ui.leName->setStyleSheet(""); ui.leName->setStyleSheet("");
ui.leName->setToolTip(""); ui.leName->setToolTip("");
skipping to change at line 418 skipping to change at line 418
ui.cbType->setCurrentIndex(m_curve->type()); ui.cbType->setCurrentIndex(m_curve->type());
ui.cbOrientation->setCurrentIndex(m_curve->orientation()); ui.cbOrientation->setCurrentIndex(m_curve->orientation());
ui.cbBinningMethod->setCurrentIndex(m_curve->binningMethod()); ui.cbBinningMethod->setCurrentIndex(m_curve->binningMethod());
ui.sbBinCount->setValue(m_curve->binCount()); ui.sbBinCount->setValue(m_curve->binCount());
ui.leBinWidth->setText(numberLocale.toString(m_curve->binWidth())); ui.leBinWidth->setText(numberLocale.toString(m_curve->binWidth()));
ui.chkAutoBinRanges->setChecked(m_curve->autoBinRanges()); ui.chkAutoBinRanges->setChecked(m_curve->autoBinRanges());
ui.leBinRangesMin->setText( numberLocale.toString(m_curve->binRangesMin() ) ); ui.leBinRangesMin->setText( numberLocale.toString(m_curve->binRangesMin() ) );
ui.leBinRangesMax->setText( numberLocale.toString(m_curve->binRangesMax() ) ); ui.leBinRangesMax->setText( numberLocale.toString(m_curve->binRangesMax() ) );
ui.chkVisible->setChecked( m_curve->isVisible() ); ui.chkVisible->setChecked( m_curve->isVisible() );
//handle numeric vs. datetime widgets
//TODO: we need to react on range format changes in the plot in general,
//add signal-slot connection for this
const auto* plot = static_cast<const CartesianPlot*>(m_curve->parent(Aspe
ctType::CartesianPlot));
ui.dteBinRangesMin->setDisplayFormat(plot->xRangeDateTimeFormat());
ui.dteBinRangesMax->setDisplayFormat(plot->xRangeDateTimeFormat());
ui.dteBinRangesMin->setDateTime(QDateTime::fromMSecsSinceEpoch(m_curve->b
inRangesMin()));
ui.dteBinRangesMax->setDateTime(QDateTime::fromMSecsSinceEpoch(m_curve->b
inRangesMax()));
bool numeric = (plot->xRangeFormat() == CartesianPlot::RangeFormat::Numer
ic);
ui.lBinRangesMin->setVisible(numeric);
ui.lBinRangesMax->setVisible(numeric);
ui.leBinRangesMin->setVisible(numeric);
ui.leBinRangesMax->setVisible(numeric);
ui.lBinRangesMinDateTime->setVisible(!numeric);
ui.dteBinRangesMin->setVisible(!numeric);
ui.lBinRangesMaxDateTime->setVisible(!numeric);
ui.dteBinRangesMax->setVisible(!numeric);
//load the remaining properties
KConfig config(QString(), KConfig::SimpleConfig); KConfig config(QString(), KConfig::SimpleConfig);
loadConfig(config); loadConfig(config);
//Slots //Slots
//General-tab //General-tab
connect(m_curve, &Histogram::aspectDescriptionChanged, this, &HistogramDo ck::curveDescriptionChanged); connect(m_curve, &Histogram::aspectDescriptionChanged, this, &HistogramDo ck::curveDescriptionChanged);
connect(m_curve, &Histogram::dataColumnChanged, this, &HistogramDock::cur veDataColumnChanged); connect(m_curve, &Histogram::dataColumnChanged, this, &HistogramDock::cur veDataColumnChanged);
connect(m_curve, &Histogram::typeChanged, this, &HistogramDock::curveType Changed); connect(m_curve, &Histogram::typeChanged, this, &HistogramDock::curveType Changed);
connect(m_curve, &Histogram::orientationChanged, this, &HistogramDock::cu rveOrientationChanged); connect(m_curve, &Histogram::orientationChanged, this, &HistogramDock::cu rveOrientationChanged);
connect(m_curve, &Histogram::binningMethodChanged, this, &HistogramDock:: curveBinningMethodChanged); connect(m_curve, &Histogram::binningMethodChanged, this, &HistogramDock:: curveBinningMethodChanged);
skipping to change at line 463 skipping to change at line 485
connect(m_curve, &Histogram::valuesRotationAngleChanged, this, &Histogram Dock::curveValuesRotationAngleChanged); connect(m_curve, &Histogram::valuesRotationAngleChanged, this, &Histogram Dock::curveValuesRotationAngleChanged);
connect(m_curve, &Histogram::valuesNumericFormatChanged, this, &Histogram Dock::curveValuesNumericFormatChanged); connect(m_curve, &Histogram::valuesNumericFormatChanged, this, &Histogram Dock::curveValuesNumericFormatChanged);
connect(m_curve, &Histogram::valuesPrecisionChanged, this, &HistogramDock ::curveValuesPrecisionChanged); connect(m_curve, &Histogram::valuesPrecisionChanged, this, &HistogramDock ::curveValuesPrecisionChanged);
connect(m_curve, &Histogram::valuesDateTimeFormatChanged, this, &Histogra mDock::curveValuesDateTimeFormatChanged); connect(m_curve, &Histogram::valuesDateTimeFormatChanged, this, &Histogra mDock::curveValuesDateTimeFormatChanged);
connect(m_curve, &Histogram::valuesPrefixChanged, this, &HistogramDock::c urveValuesPrefixChanged); connect(m_curve, &Histogram::valuesPrefixChanged, this, &HistogramDock::c urveValuesPrefixChanged);
connect(m_curve, &Histogram::valuesSuffixChanged, this, &HistogramDock::c urveValuesSuffixChanged); connect(m_curve, &Histogram::valuesSuffixChanged, this, &HistogramDock::c urveValuesSuffixChanged);
connect(m_curve, &Histogram::valuesFontChanged, this, &HistogramDock::cur veValuesFontChanged); connect(m_curve, &Histogram::valuesFontChanged, this, &HistogramDock::cur veValuesFontChanged);
connect(m_curve, &Histogram::valuesColorChanged, this, &HistogramDock::cu rveValuesColorChanged); connect(m_curve, &Histogram::valuesColorChanged, this, &HistogramDock::cu rveValuesColorChanged);
//Filling-Tab //Filling-Tab
connect( m_curve, &Histogram::fillingEnabledChanged, this, &HistogramDock ::curveFillingEnabledChanged);
connect( m_curve, &Histogram::fillingTypeChanged, this, &HistogramDock::c urveFillingTypeChanged); connect( m_curve, &Histogram::fillingTypeChanged, this, &HistogramDock::c urveFillingTypeChanged);
connect( m_curve, &Histogram::fillingColorStyleChanged, this, &HistogramD ock::curveFillingColorStyleChanged); connect( m_curve, &Histogram::fillingColorStyleChanged, this, &HistogramD ock::curveFillingColorStyleChanged);
connect( m_curve, &Histogram::fillingImageStyleChanged, this, &HistogramD ock::curveFillingImageStyleChanged); connect( m_curve, &Histogram::fillingImageStyleChanged, this, &HistogramD ock::curveFillingImageStyleChanged);
connect( m_curve, &Histogram::fillingBrushStyleChanged, this, &HistogramD ock::curveFillingBrushStyleChanged); connect( m_curve, &Histogram::fillingBrushStyleChanged, this, &HistogramD ock::curveFillingBrushStyleChanged);
connect( m_curve, &Histogram::fillingFirstColorChanged, this, &HistogramD ock::curveFillingFirstColorChanged); connect( m_curve, &Histogram::fillingFirstColorChanged, this, &HistogramD ock::curveFillingFirstColorChanged);
connect( m_curve, &Histogram::fillingSecondColorChanged, this, &Histogram Dock::curveFillingSecondColorChanged); connect( m_curve, &Histogram::fillingSecondColorChanged, this, &Histogram Dock::curveFillingSecondColorChanged);
connect( m_curve, &Histogram::fillingFileNameChanged, this, &HistogramDoc k::curveFillingFileNameChanged); connect( m_curve, &Histogram::fillingFileNameChanged, this, &HistogramDoc k::curveFillingFileNameChanged);
connect( m_curve, &Histogram::fillingOpacityChanged, this, &HistogramDock ::curveFillingOpacityChanged); connect( m_curve, &Histogram::fillingOpacityChanged, this, &HistogramDock ::curveFillingOpacityChanged);
//"Error bars"-Tab //"Error bars"-Tab
skipping to change at line 598 skipping to change at line 621
if (ok) { if (ok) {
for (auto* curve : m_curvesList) for (auto* curve : m_curvesList)
curve->setBinWidth(width); curve->setBinWidth(width);
} }
} }
void HistogramDock::autoBinRangesChanged(int state) { void HistogramDock::autoBinRangesChanged(int state) {
bool checked = (state == Qt::Checked); bool checked = (state == Qt::Checked);
ui.leBinRangesMin->setEnabled(!checked); ui.leBinRangesMin->setEnabled(!checked);
ui.leBinRangesMax->setEnabled(!checked); ui.leBinRangesMax->setEnabled(!checked);
ui.dteBinRangesMin->setEnabled(!checked);
ui.dteBinRangesMax->setEnabled(!checked);
if (m_initializing) if (m_initializing)
return; return;
for (auto* hist : m_curvesList) for (auto* hist : m_curvesList)
hist->setAutoBinRanges(checked); hist->setAutoBinRanges(checked);
} }
void HistogramDock::binRangesMinChanged(const QString& value) { void HistogramDock::binRangesMinChanged(const QString& value) {
if (m_initializing) if (m_initializing)
skipping to change at line 634 skipping to change at line 659
const Lock lock(m_initializing); const Lock lock(m_initializing);
bool ok; bool ok;
SET_NUMBER_LOCALE SET_NUMBER_LOCALE
const double max{numberLocale.toDouble(value, &ok)}; const double max{numberLocale.toDouble(value, &ok)};
if (ok) { if (ok) {
for (auto* hist : m_curvesList) for (auto* hist : m_curvesList)
hist->setBinRangesMax(max); hist->setBinRangesMax(max);
} }
} }
void HistogramDock::binRangesMinDateTimeChanged(const QDateTime& dateTime) {
if (m_initializing)
return;
quint64 min = dateTime.toMSecsSinceEpoch();
for (auto* hist : m_curvesList)
hist->setBinRangesMin(min);
}
void HistogramDock::binRangesMaxDateTimeChanged(const QDateTime& dateTime) {
if (m_initializing)
return;
quint64 max = dateTime.toMSecsSinceEpoch();
for (auto* hist : m_curvesList)
hist->setBinRangesMax(max);
}
//Line tab //Line tab
void HistogramDock::lineTypeChanged(int index) { void HistogramDock::lineTypeChanged(int index) {
auto lineType = Histogram::LineType(index); auto lineType = Histogram::LineType(index);
if ( lineType == Histogram::NoLine) { if ( lineType == Histogram::NoLine) {
ui.cbLineStyle->setEnabled(false); ui.cbLineStyle->setEnabled(false);
ui.kcbLineColor->setEnabled(false); ui.kcbLineColor->setEnabled(false);
ui.sbLineWidth->setEnabled(false); ui.sbLineWidth->setEnabled(false);
ui.sbLineOpacity->setEnabled(false); ui.sbLineOpacity->setEnabled(false);
} else { } else {
skipping to change at line 1403 skipping to change at line 1446
m_initializing = true; m_initializing = true;
ui.chkAutoBinRanges->setChecked(value); ui.chkAutoBinRanges->setChecked(value);
m_initializing = false; m_initializing = false;
} }
void HistogramDock::curveBinRangesMinChanged(double value) { void HistogramDock::curveBinRangesMinChanged(double value) {
if (m_initializing)return; if (m_initializing)return;
const Lock lock(m_initializing); const Lock lock(m_initializing);
SET_NUMBER_LOCALE SET_NUMBER_LOCALE
ui.leBinRangesMin->setText(numberLocale.toString(value)); ui.leBinRangesMin->setText(numberLocale.toString(value));
ui.dteBinRangesMin->setDateTime(QDateTime::fromMSecsSinceEpoch(value));
} }
void HistogramDock::curveBinRangesMaxChanged(double value) { void HistogramDock::curveBinRangesMaxChanged(double value) {
if (m_initializing)return; if (m_initializing)return;
const Lock lock(m_initializing); const Lock lock(m_initializing);
SET_NUMBER_LOCALE SET_NUMBER_LOCALE
ui.leBinRangesMax->setText(numberLocale.toString(value)); ui.leBinRangesMax->setText(numberLocale.toString(value));
ui.dteBinRangesMax->setDateTime(QDateTime::fromMSecsSinceEpoch(value));
} }
//Line-Tab //Line-Tab
void HistogramDock::curveLineTypeChanged(Histogram::LineType type) { void HistogramDock::curveLineTypeChanged(Histogram::LineType type) {
m_initializing = true; m_initializing = true;
ui.cbLineType->setCurrentIndex((int)type); ui.cbLineType->setCurrentIndex((int)type);
m_initializing = false; m_initializing = false;
} }
void HistogramDock::curveLinePenChanged(const QPen& pen) { void HistogramDock::curveLinePenChanged(const QPen& pen) {
m_initializing = true; m_initializing = true;
skipping to change at line 1673 skipping to change at line 1718
//Filling //Filling
ui.chkFillingEnabled->setChecked( group.readEntry("FillingEnabled", m_cur ve->fillingEnabled()) ); ui.chkFillingEnabled->setChecked( group.readEntry("FillingEnabled", m_cur ve->fillingEnabled()) );
ui.cbFillingType->setCurrentIndex( group.readEntry("FillingType", (int) m _curve->fillingType()) ); ui.cbFillingType->setCurrentIndex( group.readEntry("FillingType", (int) m _curve->fillingType()) );
ui.cbFillingColorStyle->setCurrentIndex( group.readEntry("FillingColorSty le", (int) m_curve->fillingColorStyle()) ); ui.cbFillingColorStyle->setCurrentIndex( group.readEntry("FillingColorSty le", (int) m_curve->fillingColorStyle()) );
ui.cbFillingImageStyle->setCurrentIndex( group.readEntry("FillingImageSty le", (int) m_curve->fillingImageStyle()) ); ui.cbFillingImageStyle->setCurrentIndex( group.readEntry("FillingImageSty le", (int) m_curve->fillingImageStyle()) );
ui.cbFillingBrushStyle->setCurrentIndex( group.readEntry("FillingBrushSty le", (int) m_curve->fillingBrushStyle()) ); ui.cbFillingBrushStyle->setCurrentIndex( group.readEntry("FillingBrushSty le", (int) m_curve->fillingBrushStyle()) );
ui.leFillingFileName->setText( group.readEntry("FillingFileName", m_curve ->fillingFileName()) ); ui.leFillingFileName->setText( group.readEntry("FillingFileName", m_curve ->fillingFileName()) );
ui.kcbFillingFirstColor->setColor( group.readEntry("FillingFirstColor", m _curve->fillingFirstColor()) ); ui.kcbFillingFirstColor->setColor( group.readEntry("FillingFirstColor", m _curve->fillingFirstColor()) );
ui.kcbFillingSecondColor->setColor( group.readEntry("FillingSecondColor", m_curve->fillingSecondColor()) ); ui.kcbFillingSecondColor->setColor( group.readEntry("FillingSecondColor", m_curve->fillingSecondColor()) );
ui.sbFillingOpacity->setValue( round(group.readEntry("FillingOpacity", m_ curve->fillingOpacity())*100.0) ); ui.sbFillingOpacity->setValue( round(group.readEntry("FillingOpacity", m_ curve->fillingOpacity())*100.0) );
fillingEnabledChanged(ui.chkFillingEnabled->isChecked()); //update the bo x filling widgets
//Error bars //Error bars
ui.cbErrorType->setCurrentIndex( group.readEntry("ErrorType", (int) m_cur ve->errorType()) ); ui.cbErrorType->setCurrentIndex( group.readEntry("ErrorType", (int) m_cur ve->errorType()) );
ui.cbErrorBarsType->setCurrentIndex( group.readEntry("ErrorBarsType", (in t) m_curve->errorBarsType()) ); ui.cbErrorBarsType->setCurrentIndex( group.readEntry("ErrorBarsType", (in t) m_curve->errorBarsType()) );
ui.sbErrorBarsCapSize->setValue( Worksheet::convertFromSceneUnits(group.r eadEntry("ErrorBarsCapSize", m_curve->errorBarsCapSize()), Worksheet::Unit::Poin t) ); ui.sbErrorBarsCapSize->setValue( Worksheet::convertFromSceneUnits(group.r eadEntry("ErrorBarsCapSize", m_curve->errorBarsCapSize()), Worksheet::Unit::Poin t) );
ui.cbErrorBarsStyle->setCurrentIndex( group.readEntry("ErrorBarsStyle", ( int) m_curve->errorBarsPen().style()) ); ui.cbErrorBarsStyle->setCurrentIndex( group.readEntry("ErrorBarsStyle", ( int) m_curve->errorBarsPen().style()) );
ui.kcbErrorBarsColor->setColor( group.readEntry("ErrorBarsColor", m_curve ->errorBarsPen().color()) ); ui.kcbErrorBarsColor->setColor( group.readEntry("ErrorBarsColor", m_curve ->errorBarsPen().color()) );
ui.sbErrorBarsWidth->setValue( Worksheet::convertFromSceneUnits(group.rea dEntry("ErrorBarsWidth", m_curve->errorBarsPen().widthF()),Worksheet::Unit::Poin t) ); ui.sbErrorBarsWidth->setValue( Worksheet::convertFromSceneUnits(group.rea dEntry("ErrorBarsWidth", m_curve->errorBarsPen().widthF()),Worksheet::Unit::Poin t) );
ui.sbErrorBarsOpacity->setValue( round(group.readEntry("ErrorBarsOpacity" , m_curve->errorBarsOpacity())*100.0) ); ui.sbErrorBarsOpacity->setValue( round(group.readEntry("ErrorBarsOpacity" , m_curve->errorBarsOpacity())*100.0) );
} }
 End of changes. 13 change blocks. 
8 lines changed or deleted 60 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)