Commit 986bdecc authored by CABEL Tristan's avatar CABEL Tristan

rename dtkDoubleSpinBox to dtkWidgetsSpinBoxDouble

parent 96be275a
......@@ -20,7 +20,6 @@ project(dtkWidgets VERSION ${dtkWidgets_VERSION})
set(${PROJECT_NAME}_HEADERS
dtkApplication.h
dtkDoubleSpinBox.h
dtkWidgets
dtkWidgets.h
dtkWidgetsColorButton
......@@ -99,6 +98,7 @@ set(${PROJECT_NAME}_HEADERS
dtkWidgetsParameterStringListComboBox.h
dtkWidgetsSettings
dtkWidgetsSettings.h
dtkWidgetsSpinBoxDouble.h
dtkWidgetsWidget
dtkWidgetsWidget.h
dtkWidgetsWorkspace
......@@ -110,7 +110,6 @@ set(${PROJECT_NAME}_HEADERS
set(${PROJECT_NAME}_SOURCES
dtkApplication.cpp
dtkDoubleSpinBox.cpp
dtkWidgets.cpp
dtkWidgetsColorButton.cpp
dtkWidgetsController.cpp
......@@ -150,6 +149,7 @@ set(${PROJECT_NAME}_SOURCES
dtkWidgetsParameterStringLineEdit.cpp
dtkWidgetsParameterStringListComboBox.cpp
dtkWidgetsSettings.cpp
dtkWidgetsSpinBoxDouble.cpp
dtkWidgetsWidget.cpp
dtkWidgetsWorkspace.cpp
dtkWidgetsWorkspaceBar.cpp
......
......@@ -58,6 +58,7 @@
#include "dtkWidgetsParameterStringListComboBox.h"
#include "dtkWidgetsParameterScientificSpinBox.h"
#include "dtkWidgetsSettings.h"
#include "dtkWidgetsSpinBoxDouble.h"
#include "dtkWidgetsWidget.h"
#include "dtkWidgetsWorkspace.h"
#include "dtkWidgetsWorkspaceBar.h"
......
......@@ -14,7 +14,7 @@
#include "dtkWidgetsParameterDoubleSpinBox.h"
#include "dtkDoubleSpinBox.h"
#include "dtkWidgetsSpinBoxDouble.h"
#include <dtkLog>
// ///////////////////////////////////////////////////////////////////
......@@ -24,7 +24,7 @@
class dtkWidgetsParameterDoubleSpinBoxPrivate
{
public:
dtkDoubleSpinBox *spin_box = nullptr;
dtkWidgetsSpinBoxDouble *spin_box = nullptr;
};
// ///////////////////////////////////////////////////////////////////
......@@ -33,7 +33,7 @@ public:
dtkWidgetsParameterDoubleSpinBox::dtkWidgetsParameterDoubleSpinBox(QWidget* parent) : dtkWidgetsParameterBase<dtk::d_real>(parent), d(new dtkWidgetsParameterDoubleSpinBoxPrivate)
{
d->spin_box = new dtkDoubleSpinBox(QDoubleValidator::StandardNotation);
d->spin_box = new dtkWidgetsSpinBoxDouble(QDoubleValidator::StandardNotation);
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(d->spin_box);
......@@ -75,7 +75,7 @@ bool dtkWidgetsParameterDoubleSpinBox::connect(dtkCoreParameter *p)
d->spin_box->blockSignals(false);
});
QObject::connect(d->spin_box, QOverload<double>::of(&dtkDoubleSpinBox::valueChanged), [=] (double v)
QObject::connect(d->spin_box, QOverload<double>::of(&dtkWidgetsSpinBoxDouble::valueChanged), [=] (double v)
{
m_parameter->setValue(v);
});
......
......@@ -13,7 +13,7 @@
// Code:
#include "dtkWidgetsParameterScientificSpinBox.h"
#include "dtkDoubleSpinBox.h"
#include "dtkWidgetsSpinBoxDouble.h"
#include <dtkLog>
......@@ -24,7 +24,7 @@
class dtkWidgetsParameterScientificSpinBoxPrivate
{
public:
dtkDoubleSpinBox *spin_box = nullptr;
dtkWidgetsSpinBoxDouble *spin_box = nullptr;
};
......@@ -34,7 +34,7 @@ public:
dtkWidgetsParameterScientificSpinBox::dtkWidgetsParameterScientificSpinBox(QWidget* parent) : dtkWidgetsParameterBase<dtk::d_real>(parent), d(new dtkWidgetsParameterScientificSpinBoxPrivate)
{
d->spin_box = new dtkDoubleSpinBox(QDoubleValidator::ScientificNotation);
d->spin_box = new dtkWidgetsSpinBoxDouble(QDoubleValidator::ScientificNotation);
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(d->spin_box);
......@@ -76,7 +76,7 @@ bool dtkWidgetsParameterScientificSpinBox::connect(dtkCoreParameter *p)
d->spin_box->blockSignals(false);
});
QObject::connect(d->spin_box, QOverload<double>::of(&dtkDoubleSpinBox::valueChanged), [=] (double v)
QObject::connect(d->spin_box, QOverload<double>::of(&dtkWidgetsSpinBoxDouble::valueChanged), [=] (double v)
{
m_parameter->setValue(v);
});
......
......@@ -12,9 +12,9 @@
// Code:
#include "dtkDoubleSpinBox.h"
#include "dtkWidgetsSpinBoxDouble.h"
class dtkDoubleSpinBoxPrivate : public QObject
class dtkWidgetsSpinBoxDoublePrivate : public QObject
{
Q_OBJECT
......@@ -39,21 +39,21 @@ public:
public:
dtkDoubleSpinBox *q;
dtkWidgetsSpinBoxDouble *q;
};
void dtkDoubleSpinBoxPrivate::update(void)
void dtkWidgetsSpinBoxDoublePrivate::update(void)
{
this->value = valueFromText( q->text());
this->touch();
}
void dtkDoubleSpinBoxPrivate::touch()
void dtkWidgetsSpinBoxDoublePrivate::touch()
{
q->emit valueChanged(this->value);
}
QString dtkDoubleSpinBoxPrivate::textFromValue ( double value ) const
QString dtkWidgetsSpinBoxDoublePrivate::textFromValue ( double value ) const
{
QString strValue;
......@@ -71,7 +71,7 @@ QString dtkDoubleSpinBoxPrivate::textFromValue ( double value ) const
return strValue;
}
double dtkDoubleSpinBoxPrivate::valueFromText ( const QString & text ) const
double dtkWidgetsSpinBoxDoublePrivate::valueFromText ( const QString & text ) const
{
// truncate the input text to the right decimal
QString work_on = text;
......@@ -117,7 +117,7 @@ double dtkDoubleSpinBoxPrivate::valueFromText ( const QString & text ) const
return dblValue;
}
QValidator::State dtkDoubleSpinBoxPrivate::validate(QString &text, int &pos) const
QValidator::State dtkWidgetsSpinBoxDoublePrivate::validate(QString &text, int &pos) const
{
// check user input
bool input_check;
......@@ -129,9 +129,9 @@ QValidator::State dtkDoubleSpinBoxPrivate::validate(QString &text, int &pos) con
///
dtkDoubleSpinBox::dtkDoubleSpinBox(QDoubleValidator::Notation notation, QWidget *parent) : QAbstractSpinBox(parent)
dtkWidgetsSpinBoxDouble::dtkWidgetsSpinBoxDouble(QDoubleValidator::Notation notation, QWidget *parent) : QAbstractSpinBox(parent)
{
d = new dtkDoubleSpinBoxPrivate;
d = new dtkWidgetsSpinBoxDoublePrivate;
d->q = this;
this->setLocale(QLocale::C);
......@@ -164,13 +164,13 @@ dtkDoubleSpinBox::dtkDoubleSpinBox(QDoubleValidator::Notation notation, QWidget
}
dtkDoubleSpinBox::~dtkDoubleSpinBox(void)
dtkWidgetsSpinBoxDouble::~dtkWidgetsSpinBoxDouble(void)
{
delete d->validator;
delete d;
}
void dtkDoubleSpinBox::stepBy(int step)
void dtkWidgetsSpinBoxDouble::stepBy(int step)
{
if (step == 0 ) {
return;
......@@ -191,7 +191,7 @@ void dtkDoubleSpinBox::stepBy(int step)
}
}
void dtkDoubleSpinBox::stepDown(void)
void dtkWidgetsSpinBoxDouble::stepDown(void)
{
if (d->scientific)
d->value /= 10.0;
......@@ -201,7 +201,7 @@ void dtkDoubleSpinBox::stepDown(void)
d->touch();
}
void dtkDoubleSpinBox::stepUp(void)
void dtkWidgetsSpinBoxDouble::stepUp(void)
{
if (d->scientific)
d->value *= 10.0;
......@@ -212,17 +212,17 @@ void dtkDoubleSpinBox::stepUp(void)
}
void dtkDoubleSpinBox::setMinimum(double min)
void dtkWidgetsSpinBoxDouble::setMinimum(double min)
{
d->minimum = min;
}
void dtkDoubleSpinBox::setMaximum(double max)
void dtkWidgetsSpinBoxDouble::setMaximum(double max)
{
d->maximum = max;
}
void dtkDoubleSpinBox::setValue(double val)
void dtkWidgetsSpinBoxDouble::setValue(double val)
{
d->value = val;
this->lineEdit()->blockSignals(true);
......@@ -230,19 +230,19 @@ void dtkDoubleSpinBox::setValue(double val)
this->lineEdit()->blockSignals(false);
}
void dtkDoubleSpinBox::setDecimals(int dec)
void dtkWidgetsSpinBoxDouble::setDecimals(int dec)
{
d->decimals = dec;
this->setValue(d->value); // muste change the text in the widget accordingly
}
QAbstractSpinBox::StepEnabled dtkDoubleSpinBox::stepEnabled(void) const
QAbstractSpinBox::StepEnabled dtkWidgetsSpinBoxDouble::stepEnabled(void) const
{
return ( QAbstractSpinBox::StepUpEnabled | QAbstractSpinBox::StepDownEnabled ) ;
}
#include "dtkDoubleSpinBox.moc"
#include "dtkWidgetsSpinBoxDouble.moc"
//
// dtkDoubleSpinBox.h ends here
// dtkWidgetsSpinBoxDouble.h ends here
......@@ -11,12 +11,13 @@
//
// Code:
#pragma once
#include <QtCore>
#include <QtWidgets>
// ///////////////////////////////////////////////////////////////////
// dtkDoubleSpinbox
// dtkWidgetSpinBoxDouble
// ///////////////////////////////////////////////////////////////////
//
// holds both standard and scienti
......@@ -24,13 +25,13 @@
//
// ///////////////////////////////////////////////////////////////////
class dtkDoubleSpinBox : public QAbstractSpinBox
class dtkWidgetsSpinBoxDouble : public QAbstractSpinBox
{
Q_OBJECT
public:
dtkDoubleSpinBox(QDoubleValidator::Notation, QWidget * parent = 0);
~dtkDoubleSpinBox(void);
dtkWidgetsSpinBoxDouble(QDoubleValidator::Notation, QWidget * parent = 0);
~dtkWidgetsSpinBoxDouble(void);
signals:
void valueChanged(double);
......@@ -49,9 +50,9 @@ protected:
QAbstractSpinBox::StepEnabled stepEnabled(void) const;
private:
class dtkDoubleSpinBoxPrivate *d;
class dtkWidgetsSpinBoxDoublePrivate *d;
};
//
// dtkDoubleSpinBox.h ends here
// dtkWidgetsSpinBoxDouble.h ends here
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment