ctkDoubleSlider.cpp 19 KB

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