comparison widgets/Thumbwheel.cpp @ 1266:a34a2a25907c

Untabify
author Chris Cannam
date Thu, 01 Mar 2018 18:02:22 +0000
parents 54e6be7ebe11
children 13f5f84fbfad
comparison
equal deleted inserted replaced
1265:6e724c81f18f 1266:a34a2a25907c
27 27
28 #include <cmath> 28 #include <cmath>
29 #include <iostream> 29 #include <iostream>
30 30
31 Thumbwheel::Thumbwheel(Qt::Orientation orientation, 31 Thumbwheel::Thumbwheel(Qt::Orientation orientation,
32 QWidget *parent) : 32 QWidget *parent) :
33 QWidget(parent), 33 QWidget(parent),
34 m_min(0), 34 m_min(0),
35 m_max(100), 35 m_max(100),
36 m_default(50), 36 m_default(50),
37 m_value(50), 37 m_value(50),
242 { 242 {
243 int step = int(lrintf(m_speed)); 243 int step = int(lrintf(m_speed));
244 if (step == 0) step = 1; 244 if (step == 0) step = 1;
245 245
246 if (up) { 246 if (up) {
247 setValue(m_value + step); 247 setValue(m_value + step);
248 } else { 248 } else {
249 setValue(m_value - step); 249 setValue(m_value - step);
250 } 250 }
251 251
252 emit valueChanged(getValue()); 252 emit valueChanged(getValue());
253 } 253 }
254 254
428 { 428 {
429 int step = int(lrintf(m_speed)); 429 int step = int(lrintf(m_speed));
430 if (step == 0) step = 1; 430 if (step == 0) step = 1;
431 431
432 if (e->delta() > 0) { 432 if (e->delta() > 0) {
433 setValue(m_value + step); 433 setValue(m_value + step);
434 } else { 434 } else {
435 setValue(m_value - step); 435 setValue(m_value - step);
436 } 436 }
437 437
438 emit valueChanged(getValue()); 438 emit valueChanged(getValue());
439 } 439 }
440 440