ctkDoubleSlider.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0.txt
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =========================================================================*/
  14. // QT includes
  15. #include <QDebug>
  16. #include <QHBoxLayout>
  17. #include <QHelpEvent>
  18. #include <QStyle>
  19. #include <QStyleOptionSlider>
  20. #include <QToolTip>
  21. // CTK includes
  22. #include "ctkDoubleSlider.h"
  23. #include "ctkValueProxy.h"
  24. // STD includes
  25. #include <limits>
  26. //-----------------------------------------------------------------------------
  27. // ctkSlider
  28. //-----------------------------------------------------------------------------
  29. class ctkSlider: public QSlider
  30. {
  31. public:
  32. ctkSlider(QWidget* parent);
  33. using QSlider::initStyleOption;
  34. };
  35. //-----------------------------------------------------------------------------
  36. ctkSlider::ctkSlider(QWidget* parent): QSlider(parent)
  37. {
  38. }
  39. //-----------------------------------------------------------------------------
  40. // ctkDoubleSliderPrivate
  41. //-----------------------------------------------------------------------------
  42. class ctkDoubleSliderPrivate
  43. {
  44. Q_DECLARE_PUBLIC(ctkDoubleSlider);
  45. protected:
  46. ctkDoubleSlider* const q_ptr;
  47. public:
  48. ctkDoubleSliderPrivate(ctkDoubleSlider& object);
  49. int toInt(double value)const;
  50. double fromInt(int value)const;
  51. double safeFromInt(int value)const;
  52. void init();
  53. void updateOffset(double value);
  54. ctkSlider* Slider;
  55. QString HandleToolTip;
  56. double Minimum;
  57. double Maximum;
  58. bool SettingRange;
  59. // we should have a Offset and SliderPositionOffset (and MinimumOffset?)
  60. double Offset;
  61. double SingleStep;
  62. double PageStep;
  63. double Value;
  64. /// Converts input value with displayed value
  65. QWeakPointer<ctkValueProxy> Proxy;
  66. };
  67. // --------------------------------------------------------------------------
  68. ctkDoubleSliderPrivate::ctkDoubleSliderPrivate(ctkDoubleSlider& object)
  69. :q_ptr(&object)
  70. {
  71. this->Slider = 0;
  72. this->Minimum = 0.;
  73. this->Maximum = 100.;
  74. this->SettingRange = false;
  75. this->Offset = 0.;
  76. this->SingleStep = 1.;
  77. this->PageStep = 10.;
  78. this->Value = 0.;
  79. }
  80. // --------------------------------------------------------------------------
  81. void ctkDoubleSliderPrivate::init()
  82. {
  83. Q_Q(ctkDoubleSlider);
  84. this->Slider = new ctkSlider(q);
  85. this->Slider->installEventFilter(q);
  86. QHBoxLayout* l = new QHBoxLayout(q);
  87. l->addWidget(this->Slider);
  88. l->setContentsMargins(0,0,0,0);
  89. this->Minimum = this->Slider->minimum();
  90. this->Maximum = this->Slider->maximum();
  91. // this->Slider->singleStep is always 1
  92. this->SingleStep = this->Slider->singleStep();
  93. this->PageStep = this->Slider->pageStep();
  94. this->Value = this->Slider->value();
  95. q->connect(this->Slider, SIGNAL(valueChanged(int)), q, SLOT(onValueChanged(int)));
  96. q->connect(this->Slider, SIGNAL(sliderMoved(int)), q, SLOT(onSliderMoved(int)));
  97. q->connect(this->Slider, SIGNAL(sliderPressed()), q, SIGNAL(sliderPressed()));
  98. q->connect(this->Slider, SIGNAL(sliderReleased()), q, SIGNAL(sliderReleased()));
  99. q->connect(this->Slider, SIGNAL(rangeChanged(int,int)),
  100. q, SLOT(onRangeChanged(int,int)));
  101. q->setSizePolicy(this->Slider->sizePolicy());
  102. q->setAttribute(Qt::WA_WState_OwnSizePolicy, false);
  103. }
  104. // --------------------------------------------------------------------------
  105. int ctkDoubleSliderPrivate::toInt(double doubleValue)const
  106. {
  107. double tmp = doubleValue / this->SingleStep;
  108. static const double minInt = std::numeric_limits<int>::min();
  109. static const double maxInt = std::numeric_limits<int>::max();
  110. #ifndef QT_NO_DEBUG
  111. if (tmp < minInt || tmp > maxInt)
  112. {
  113. qWarning() << __FUNCTION__ << ": value " << doubleValue
  114. << " for singleStep " << this->SingleStep
  115. << " is out of integer bounds !";
  116. }
  117. #endif
  118. tmp = qBound(minInt, tmp, maxInt);
  119. int intValue = qRound(tmp);
  120. //qDebug() << __FUNCTION__ << doubleValue << tmp << intValue;
  121. return intValue;
  122. }
  123. // --------------------------------------------------------------------------
  124. double ctkDoubleSliderPrivate::fromInt(int intValue)const
  125. {
  126. double doubleValue = this->SingleStep * (this->Offset + intValue) ;
  127. //qDebug() << __FUNCTION__ << intValue << doubleValue;
  128. return doubleValue;
  129. }
  130. // --------------------------------------------------------------------------
  131. double ctkDoubleSliderPrivate::safeFromInt(int intValue)const
  132. {
  133. return qBound(this->Minimum, this->fromInt(intValue), this->Maximum);
  134. }
  135. // --------------------------------------------------------------------------
  136. void ctkDoubleSliderPrivate::updateOffset(double value)
  137. {
  138. this->Offset = (value / this->SingleStep) - this->toInt(value);
  139. }
  140. //-----------------------------------------------------------------------------
  141. // ctkDoubleSlider
  142. // --------------------------------------------------------------------------
  143. ctkDoubleSlider::ctkDoubleSlider(QWidget* _parent) : Superclass(_parent)
  144. , d_ptr(new ctkDoubleSliderPrivate(*this))
  145. {
  146. Q_D(ctkDoubleSlider);
  147. d->init();
  148. }
  149. // --------------------------------------------------------------------------
  150. ctkDoubleSlider::ctkDoubleSlider(Qt::Orientation _orientation, QWidget* _parent)
  151. : Superclass(_parent)
  152. , d_ptr(new ctkDoubleSliderPrivate(*this))
  153. {
  154. Q_D(ctkDoubleSlider);
  155. d->init();
  156. this->setOrientation(_orientation);
  157. }
  158. // --------------------------------------------------------------------------
  159. ctkDoubleSlider::~ctkDoubleSlider()
  160. {
  161. }
  162. // --------------------------------------------------------------------------
  163. void ctkDoubleSlider::setMinimum(double min)
  164. {
  165. this->setRange(min, qMax(min, this->maximum()));
  166. }
  167. // --------------------------------------------------------------------------
  168. void ctkDoubleSlider::setMaximum(double max)
  169. {
  170. this->setRange(qMin(this->minimum(), max), max);
  171. }
  172. // --------------------------------------------------------------------------
  173. void ctkDoubleSlider::setRange(double newMin, double newMax)
  174. {
  175. Q_D(ctkDoubleSlider);
  176. if (d->Proxy)
  177. {
  178. newMin = d->Proxy.data()->proxyValueFromValue(newMin);
  179. newMax = d->Proxy.data()->proxyValueFromValue(newMax);
  180. }
  181. if (newMin > newMax)
  182. {
  183. qSwap(newMin, newMax);
  184. }
  185. double oldMin = d->Minimum;
  186. double oldMax = d->Maximum;
  187. d->Minimum = newMin;
  188. d->Maximum = newMax;
  189. if (d->Minimum >= d->Value)
  190. {
  191. d->updateOffset(d->Minimum);
  192. }
  193. if (d->Maximum <= d->Value)
  194. {
  195. d->updateOffset(d->Maximum);
  196. }
  197. bool wasSettingRange = d->SettingRange;
  198. d->SettingRange = true;
  199. d->Slider->setRange(d->toInt(newMin), d->toInt(newMax));
  200. d->SettingRange = wasSettingRange;
  201. if (!wasSettingRange && (d->Minimum != oldMin || d->Maximum != oldMax))
  202. {
  203. emit this->rangeChanged(this->minimum(), this->maximum());
  204. }
  205. /// In case QSlider::setRange(...) didn't notify the value
  206. /// has changed.
  207. this->setValue(this->value());
  208. }
  209. // --------------------------------------------------------------------------
  210. double ctkDoubleSlider::minimum()const
  211. {
  212. Q_D(const ctkDoubleSlider);
  213. double min = d->Minimum;
  214. double max = d->Maximum;
  215. if (d->Proxy)
  216. {
  217. min = d->Proxy.data()->valueFromProxyValue(min);
  218. max = d->Proxy.data()->valueFromProxyValue(max);
  219. }
  220. return qMin(min, max);
  221. }
  222. // --------------------------------------------------------------------------
  223. double ctkDoubleSlider::maximum()const
  224. {
  225. Q_D(const ctkDoubleSlider);
  226. double min = d->Minimum;
  227. double max = d->Maximum;
  228. if (d->Proxy)
  229. {
  230. min = d->Proxy.data()->valueFromProxyValue(min);
  231. max = d->Proxy.data()->valueFromProxyValue(max);
  232. }
  233. return qMax(min, max);
  234. }
  235. // --------------------------------------------------------------------------
  236. double ctkDoubleSlider::sliderPosition()const
  237. {
  238. Q_D(const ctkDoubleSlider);
  239. int intPosition = d->Slider->sliderPosition();
  240. double position = d->safeFromInt(intPosition);
  241. if (d->Proxy)
  242. {
  243. position = d->Proxy.data()->valueFromProxyValue(position);
  244. }
  245. return position;
  246. }
  247. // --------------------------------------------------------------------------
  248. void ctkDoubleSlider::setSliderPosition(double newPosition)
  249. {
  250. Q_D(ctkDoubleSlider);
  251. if (d->Proxy)
  252. {
  253. newPosition = d->Proxy.data()->proxyValueFromValue(newPosition);
  254. }
  255. int newIntPosition = d->toInt(newPosition);
  256. d->Slider->setSliderPosition(newIntPosition);
  257. }
  258. // --------------------------------------------------------------------------
  259. double ctkDoubleSlider::value()const
  260. {
  261. Q_D(const ctkDoubleSlider);
  262. double val = d->Value;
  263. if (d->Proxy)
  264. {
  265. val = d->Proxy.data()->valueFromProxyValue(val);
  266. }
  267. return val;
  268. }
  269. // --------------------------------------------------------------------------
  270. void ctkDoubleSlider::setValue(double newValue)
  271. {
  272. Q_D(ctkDoubleSlider);
  273. if (d->Proxy)
  274. {
  275. newValue = d->Proxy.data()->proxyValueFromValue(newValue);
  276. }
  277. newValue = qBound(d->Minimum, newValue, d->Maximum);
  278. d->updateOffset(newValue);
  279. int newIntValue = d->toInt(newValue);
  280. if (newIntValue != d->Slider->value())
  281. {
  282. // d->Slider will emit a valueChanged signal that is connected to
  283. // ctkDoubleSlider::onValueChanged
  284. d->Slider->setValue(newIntValue);
  285. }
  286. else
  287. {
  288. double oldValue = d->Value;
  289. d->Value = newValue;
  290. // don't emit a valuechanged signal if the new value is quite
  291. // similar to the old value.
  292. if (qAbs(newValue - oldValue) > (d->SingleStep * 0.000000001))
  293. {
  294. emit this->valueChanged(this->value());
  295. }
  296. }
  297. }
  298. // --------------------------------------------------------------------------
  299. double ctkDoubleSlider::singleStep()const
  300. {
  301. Q_D(const ctkDoubleSlider);
  302. double step = d->SingleStep;
  303. return step;
  304. }
  305. // --------------------------------------------------------------------------
  306. void ctkDoubleSlider::setSingleStep(double newStep)
  307. {
  308. Q_D(ctkDoubleSlider);
  309. if (!this->isValidStep(newStep))
  310. {
  311. qWarning() << "ctkDoubleSlider::setSingleStep("<< newStep <<")"
  312. << "is outside of valid bounds.";
  313. return;
  314. }
  315. d->SingleStep = newStep;
  316. d->updateOffset(d->Value);
  317. // update the new values of the QSlider
  318. bool oldBlockSignals = d->Slider->blockSignals(true);
  319. d->Slider->setRange(d->toInt(d->Minimum), d->toInt(d->Maximum));
  320. d->Slider->setValue(d->toInt(d->Value));
  321. d->Slider->setPageStep(d->toInt(d->PageStep));
  322. d->Slider->blockSignals(oldBlockSignals);
  323. Q_ASSERT(qFuzzyCompare(d->Value,d->safeFromInt(d->Slider->value())));
  324. }
  325. // --------------------------------------------------------------------------
  326. bool ctkDoubleSlider::isValidStep(double step)const
  327. {
  328. Q_D(const ctkDoubleSlider);
  329. if (d->Minimum == d->Maximum)
  330. {
  331. return true;
  332. }
  333. const double minStep = qMax(d->Maximum / std::numeric_limits<double>::max(),
  334. std::numeric_limits<double>::epsilon());
  335. const double maxStep = qMin(d->Maximum - d->Minimum,
  336. static_cast<double>(std::numeric_limits<int>::max()));
  337. return step >= minStep && step <= maxStep;
  338. }
  339. // --------------------------------------------------------------------------
  340. double ctkDoubleSlider::pageStep()const
  341. {
  342. Q_D(const ctkDoubleSlider);
  343. return d->PageStep;
  344. }
  345. // --------------------------------------------------------------------------
  346. void ctkDoubleSlider::setPageStep(double newStep)
  347. {
  348. Q_D(ctkDoubleSlider);
  349. d->PageStep = newStep;
  350. int intPageStep = d->toInt(d->PageStep);
  351. d->Slider->setPageStep(intPageStep);
  352. }
  353. // --------------------------------------------------------------------------
  354. double ctkDoubleSlider::tickInterval()const
  355. {
  356. Q_D(const ctkDoubleSlider);
  357. // No need to apply Offset
  358. double interval = d->SingleStep * d->Slider->tickInterval();
  359. return interval;
  360. }
  361. // --------------------------------------------------------------------------
  362. void ctkDoubleSlider::setTickInterval(double newInterval)
  363. {
  364. Q_D(ctkDoubleSlider);
  365. int newIntInterval = d->toInt(newInterval);
  366. d->Slider->setTickInterval(newIntInterval);
  367. }
  368. // --------------------------------------------------------------------------
  369. QSlider::TickPosition ctkDoubleSlider::tickPosition()const
  370. {
  371. Q_D(const ctkDoubleSlider);
  372. return d->Slider->tickPosition();
  373. }
  374. // --------------------------------------------------------------------------
  375. void ctkDoubleSlider::setTickPosition(QSlider::TickPosition newTickPosition)
  376. {
  377. Q_D(ctkDoubleSlider);
  378. d->Slider->setTickPosition(newTickPosition);
  379. }
  380. // --------------------------------------------------------------------------
  381. bool ctkDoubleSlider::hasTracking()const
  382. {
  383. Q_D(const ctkDoubleSlider);
  384. return d->Slider->hasTracking();
  385. }
  386. // --------------------------------------------------------------------------
  387. void ctkDoubleSlider::setTracking(bool enable)
  388. {
  389. Q_D(ctkDoubleSlider);
  390. d->Slider->setTracking(enable);
  391. }
  392. // --------------------------------------------------------------------------
  393. bool ctkDoubleSlider::invertedAppearance()const
  394. {
  395. Q_D(const ctkDoubleSlider);
  396. return d->Slider->invertedAppearance();
  397. }
  398. // --------------------------------------------------------------------------
  399. void ctkDoubleSlider::setInvertedAppearance(bool invertedAppearance)
  400. {
  401. Q_D(ctkDoubleSlider);
  402. d->Slider->setInvertedAppearance(invertedAppearance);
  403. }
  404. // --------------------------------------------------------------------------
  405. bool ctkDoubleSlider::invertedControls()const
  406. {
  407. Q_D(const ctkDoubleSlider);
  408. return d->Slider->invertedControls();
  409. }
  410. // --------------------------------------------------------------------------
  411. void ctkDoubleSlider::setInvertedControls(bool invertedControls)
  412. {
  413. Q_D(ctkDoubleSlider);
  414. d->Slider->setInvertedControls(invertedControls);
  415. }
  416. // --------------------------------------------------------------------------
  417. void ctkDoubleSlider::triggerAction( QAbstractSlider::SliderAction action)
  418. {
  419. Q_D(ctkDoubleSlider);
  420. d->Slider->triggerAction(action);
  421. }
  422. // --------------------------------------------------------------------------
  423. Qt::Orientation ctkDoubleSlider::orientation()const
  424. {
  425. Q_D(const ctkDoubleSlider);
  426. return d->Slider->orientation();
  427. }
  428. // --------------------------------------------------------------------------
  429. void ctkDoubleSlider::setOrientation(Qt::Orientation newOrientation)
  430. {
  431. Q_D(ctkDoubleSlider);
  432. if (this->orientation() == newOrientation)
  433. {
  434. return;
  435. }
  436. if (!testAttribute(Qt::WA_WState_OwnSizePolicy))
  437. {
  438. QSizePolicy sp = this->sizePolicy();
  439. sp.transpose();
  440. this->setSizePolicy(sp);
  441. this->setAttribute(Qt::WA_WState_OwnSizePolicy, false);
  442. }
  443. // d->Slider will take care of calling updateGeometry
  444. d->Slider->setOrientation(newOrientation);
  445. }
  446. // --------------------------------------------------------------------------
  447. QString ctkDoubleSlider::handleToolTip()const
  448. {
  449. Q_D(const ctkDoubleSlider);
  450. return d->HandleToolTip;
  451. }
  452. // --------------------------------------------------------------------------
  453. void ctkDoubleSlider::setHandleToolTip(const QString& toolTip)
  454. {
  455. Q_D(ctkDoubleSlider);
  456. d->HandleToolTip = toolTip;
  457. }
  458. // --------------------------------------------------------------------------
  459. void ctkDoubleSlider::onValueChanged(int newValue)
  460. {
  461. Q_D(ctkDoubleSlider);
  462. double doubleNewValue = d->safeFromInt(newValue);
  463. /*
  464. qDebug() << "onValueChanged: " << newValue << "->"<< d->fromInt(newValue+d->Offset)
  465. << " old: " << d->Value << "->" << d->toInt(d->Value)
  466. << "offset:" << d->Offset << doubleNewValue;
  467. */
  468. if (d->Value == doubleNewValue)
  469. {
  470. return;
  471. }
  472. d->Value = doubleNewValue;
  473. emit this->valueChanged(this->value());
  474. }
  475. // --------------------------------------------------------------------------
  476. void ctkDoubleSlider::onSliderMoved(int newPosition)
  477. {
  478. Q_D(const ctkDoubleSlider);
  479. emit this->sliderMoved(d->safeFromInt(newPosition));
  480. }
  481. // --------------------------------------------------------------------------
  482. void ctkDoubleSlider::onRangeChanged(int newIntMin, int newIntMax)
  483. {
  484. Q_D(const ctkDoubleSlider);
  485. if (d->SettingRange)
  486. {
  487. return;
  488. }
  489. double newMin = d->fromInt(newIntMin);
  490. double newMax = d->fromInt(newIntMax);
  491. if (d->Proxy)
  492. {
  493. newMin = d->Proxy.data()->valueFromProxyValue(newMin);
  494. newMax = d->Proxy.data()->valueFromProxyValue(newMax);
  495. }
  496. this->setRange(newMin, newMax);
  497. }
  498. // --------------------------------------------------------------------------
  499. bool ctkDoubleSlider::eventFilter(QObject* watched, QEvent* event)
  500. {
  501. Q_D(ctkDoubleSlider);
  502. if (watched == d->Slider)
  503. {
  504. switch(event->type())
  505. {
  506. case QEvent::ToolTip:
  507. {
  508. QHelpEvent* helpEvent = static_cast<QHelpEvent*>(event);
  509. QStyleOptionSlider opt;
  510. d->Slider->initStyleOption(&opt);
  511. QStyle::SubControl hoveredControl =
  512. d->Slider->style()->hitTestComplexControl(
  513. QStyle::CC_Slider, &opt, helpEvent->pos(), this);
  514. if (!d->HandleToolTip.isEmpty() &&
  515. hoveredControl == QStyle::SC_SliderHandle)
  516. {
  517. QToolTip::showText(helpEvent->globalPos(), d->HandleToolTip.arg(this->value()));
  518. event->accept();
  519. return true;
  520. }
  521. }
  522. default:
  523. break;
  524. }
  525. }
  526. return this->Superclass::eventFilter(watched, event);
  527. }
  528. // --------------------------------------------------------------------------
  529. QSlider* ctkDoubleSlider::slider()const
  530. {
  531. Q_D(const ctkDoubleSlider);
  532. return d->Slider;
  533. }
  534. //----------------------------------------------------------------------------
  535. void ctkDoubleSlider::setValueProxy(ctkValueProxy* proxy)
  536. {
  537. Q_D(ctkDoubleSlider);
  538. if (proxy == d->Proxy.data())
  539. {
  540. return;
  541. }
  542. this->onValueProxyAboutToBeModified();
  543. if (d->Proxy.data())
  544. {
  545. disconnect(d->Proxy.data(), 0, this, 0);
  546. }
  547. d->Proxy = proxy;
  548. if (d->Proxy)
  549. {
  550. connect(d->Proxy.data(), SIGNAL(proxyAboutToBeModified()),
  551. this, SLOT(onValueProxyAboutToBeModified()));
  552. connect(d->Proxy.data(), SIGNAL(proxyModified()),
  553. this, SLOT(onValueProxyModified()));
  554. }
  555. this->onValueProxyModified();
  556. }
  557. //----------------------------------------------------------------------------
  558. ctkValueProxy* ctkDoubleSlider::valueProxy() const
  559. {
  560. Q_D(const ctkDoubleSlider);
  561. return d->Proxy.data();
  562. }
  563. // --------------------------------------------------------------------------
  564. void ctkDoubleSlider::onValueProxyAboutToBeModified()
  565. {
  566. Q_D(ctkDoubleSlider);
  567. d->Slider->setProperty("inputValue", this->value());
  568. d->Slider->setProperty("inputMinimum", this->minimum());
  569. d->Slider->setProperty("inputMaximum", this->maximum());
  570. }
  571. // --------------------------------------------------------------------------
  572. void ctkDoubleSlider::onValueProxyModified()
  573. {
  574. Q_D(ctkDoubleSlider);
  575. bool wasBlockingSignals = this->blockSignals(true);
  576. bool wasSettingRange = d->SettingRange;
  577. d->SettingRange = true;
  578. this->setRange(d->Slider->property("inputMinimum").toDouble(),
  579. d->Slider->property("inputMaximum").toDouble());
  580. d->SettingRange = wasSettingRange;
  581. this->setValue(d->Slider->property("inputValue").toDouble());
  582. this->blockSignals(wasBlockingSignals);
  583. }