Commit 71138a62 authored by SZPYRKA Jean-Luc's avatar SZPYRKA Jean-Luc

scientific spinbox

parent 051fe512
......@@ -33,9 +33,10 @@ int main(int argc, char **argv)
dtk::d_real real_parameter = 5.;
real_parameter.setDocumentation("A real parameter.");
real_parameter.setDecimals(3);
dtkWidgetsParameter *first_real_parameter_widget = dtk::widgets::parameters::pluginFactory().create(&real_parameter, "dtkWidgetsParameterDoubleSpinBox");
dtkWidgetsParameter *second_real_parameter_widget = dtk::widgets::parameters::pluginFactory().create(&real_parameter, "dtkWidgetsParameterDoubleSpinBox");
dtkWidgetsParameter *second_real_parameter_widget = dtk::widgets::parameters::pluginFactory().create(&real_parameter, "dtkWidgetsParameterScientificSpinBox");
real_parameter.connect([=] (QVariant v) {
double value = v.value<dtk::d_real>().value();
......
......@@ -20,6 +20,7 @@ project(dtkWidgets VERSION ${dtkWidgets_VERSION})
set(${PROJECT_NAME}_HEADERS
dtkApplication.h
dtkScientificSpinBox.h
dtkWidgets
dtkWidgets.h
dtkWidgetsColorButton
......@@ -85,6 +86,8 @@ set(${PROJECT_NAME}_HEADERS
dtkWidgetsParameterIntSpinBox.h
dtkWidgetsParameterMenuBarGenerator
dtkWidgetsParameterMenuBarGenerator.h
dtkWidgetsParameterScientificSpinBox
dtkWidgetsParameterScientificSpinBox.h
dtkWidgetsParameterStringListComboBox
dtkWidgetsParameterStringListComboBox.h
dtkWidgetsSettings
......@@ -100,6 +103,7 @@ set(${PROJECT_NAME}_HEADERS
set(${PROJECT_NAME}_SOURCES
dtkApplication.cpp
dtkScientificSpinBox.cpp
dtkWidgets.cpp
dtkWidgetsColorButton.cpp
dtkWidgetsController.cpp
......@@ -132,6 +136,7 @@ set(${PROJECT_NAME}_SOURCES
dtkWidgetsParameterFactory.cpp
dtkWidgetsParameterFileBrowse.cpp
dtkWidgetsParameterMenuBarGenerator.cpp
dtkWidgetsParameterScientificSpinBox.cpp
dtkWidgetsParameterStringListComboBox.cpp
dtkWidgetsSettings.cpp
dtkWidgetsWidget.cpp
......
......@@ -26,6 +26,7 @@
#include "dtkWidgetsParameterIntSpinBox.h"
#include "dtkWidgetsParameterMenuBarGenerator.h"
#include "dtkWidgetsParameterStringListComboBox.h"
#include "dtkWidgetsParameterScientificSpinBox.h"
#include "dtkWidgetsSettings.h"
#include "dtkWidgetsWidget.h"
#include "dtkWidgetsWorkspace.h"
......
......@@ -23,6 +23,7 @@
#include "dtkWidgetsParameterBoolCheckBox.h"
#include "dtkWidgetsParameterBoolPushButton.h"
#include "dtkWidgetsParameterDoubleSpinBox.h"
#include "dtkWidgetsParameterScientificSpinBox.h"
#include "dtkWidgetsParameterDirBrowse.h"
#include "dtkWidgetsParameterFileBrowse.h"
#include "dtkWidgetsParameterIntSlider.h"
......@@ -72,6 +73,7 @@ namespace dtk {
dtk::widgets::parameters::pluginFactory().record("dtkWidgetsParameterBoolPushButton", dtkWidgetsParameterBoolPushButtonCreator);
dtk::widgets::parameters::pluginFactory().record("dtkWidgetsParameterDirBrowse", dtkWidgetsParameterDirBrowseCreator);
dtk::widgets::parameters::pluginFactory().record("dtkWidgetsParameterDoubleSpinBox", dtkWidgetsParameterDoubleSpinBoxCreator);
dtk::widgets::parameters::pluginFactory().record("dtkWidgetsParameterScientificSpinBox", dtkWidgetsParameterScientificSpinBoxCreator);
dtk::widgets::parameters::pluginFactory().record("dtkWidgetsParameterIntSlider", dtkWidgetsParameterIntSliderCreator);
dtk::widgets::parameters::pluginFactory().record("dtkWidgetsParameterIntSpinBox", dtkWidgetsParameterIntSpinBoxCreator);
dtk::widgets::parameters::pluginFactory().record("dtkWidgetsParameterFileBrowse", dtkWidgetsParameterFileBrowseCreator);
......
......@@ -64,6 +64,7 @@ bool dtkWidgetsParameterDoubleSpinBox::connect(dtkCoreParameter *p)
d->spin_box->setToolTip(m_parameter->documentation());
d->spin_box->setValue(m_parameter->value());
d->spin_box->setDecimals(m_parameter->decimals());
m_parameter->connect([=] (QVariant v)
{
......
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