Changeset View
Changeset View
Standalone View
Standalone View
src/gradientwidget_impl.cpp
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 55 | if (!gradient_slider->isEnabled()) { | |||
---|---|---|---|---|---|
58 | Play->setEnabled(true); | 58 | Play->setEnabled(true); | ||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | KalziumElementProperty *elementProperty = KalziumElementProperty::instance(); | 61 | KalziumElementProperty *elementProperty = KalziumElementProperty::instance(); | ||
62 | double dblMax = elementProperty->gradient()->maxValue(); | 62 | double dblMax = elementProperty->gradient()->maxValue(); | ||
63 | double dblMin = elementProperty->gradient()->minValue(); | 63 | double dblMin = elementProperty->gradient()->minValue(); | ||
64 | 64 | | |||
65 | // saving the decimals in the int | 65 | // saving the decimals in the int | ||
66 | const int intMax = dblMax * MULTIPLIKATOR; | 66 | const int intMax = static_cast<int>(dblMax * MULTIPLIKATOR); | ||
67 | const int intMin = dblMin * MULTIPLIKATOR; | 67 | const int intMin = static_cast<int>(dblMin * MULTIPLIKATOR); | ||
68 | 68 | | |||
69 | // now we have the slider numbers, so put the speed to a adequate value. | 69 | // now we have the slider numbers, so put the speed to a adequate value. | ||
70 | Speed->setMaximum(intMax / 100); | 70 | Speed->setMaximum(intMax / 100); | ||
71 | Speed->setValue((intMax / 100) / 2); | 71 | Speed->setValue((intMax / 100) / 2); | ||
72 | 72 | | |||
73 | gradient_slider->setMaximum(intMax); | 73 | gradient_slider->setMaximum(intMax); | ||
74 | gradient_slider->setMinimum(intMin); | 74 | gradient_slider->setMinimum(intMin); | ||
75 | 75 | | |||
Show All 31 Lines | |||||
107 | { | 107 | { | ||
108 | //the signals need to be blocked as both will return to this slot. But no | 108 | //the signals need to be blocked as both will return to this slot. But no | ||
109 | //matter which UI elements (slider oder spinbox) was changed, the other | 109 | //matter which UI elements (slider oder spinbox) was changed, the other | ||
110 | //has to be set to the same value | 110 | //has to be set to the same value | ||
111 | 111 | | |||
112 | gradient_slider->blockSignals(true); | 112 | gradient_slider->blockSignals(true); | ||
113 | 113 | | |||
114 | // setting the decimals in int | 114 | // setting the decimals in int | ||
115 | int intvar = doubleVar * MULTIPLIKATOR; | 115 | int intvar = static_cast<int>(doubleVar * MULTIPLIKATOR); | ||
116 | 116 | | |||
117 | gradient_slider->setValue(intvar); | 117 | gradient_slider->setValue(intvar); | ||
118 | 118 | | |||
119 | gradient_slider->blockSignals(false); | 119 | gradient_slider->blockSignals(false); | ||
120 | 120 | | |||
121 | emit gradientValueChanged(doubleVar); | 121 | emit gradientValueChanged(doubleVar); | ||
122 | 122 | | |||
123 | setNewValue(doubleVar); | 123 | setNewValue(doubleVar); | ||
▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines |