comparison widgets/Thumbwheel.cpp @ 191:3ed71a9d578b

* Fix a crash in spectrogram * Don't clear background of curved area of thumbwheel (this way it looks better on a dark background)
author Chris Cannam
date Mon, 22 Jan 2007 16:09:03 +0000
parents 53835534a9d3
children fcc043f75c41
comparison
equal deleted inserted replaced
190:53835534a9d3 191:3ed71a9d578b
421 void 421 void
422 Thumbwheel::paintEvent(QPaintEvent *) 422 Thumbwheel::paintEvent(QPaintEvent *)
423 { 423 {
424 Profiler profiler("Thumbwheel::paintEvent", true); 424 Profiler profiler("Thumbwheel::paintEvent", true);
425 425
426 int bw = 3;
427
428 QRect subclip;
429 if (m_orientation == Qt::Horizontal) {
430 subclip = QRect(bw, bw+1, width() - bw*2, height() - bw*2 - 2);
431 } else {
432 subclip = QRect(bw+1, bw, width() - bw*2 - 2, height() - bw*2);
433 }
434
426 QPainter paint(this); 435 QPainter paint(this);
427 paint.fillRect(rect(), palette().background().color()); 436 paint.fillRect(subclip, palette().background().color());
428 437
429 paint.setRenderHint(QPainter::Antialiasing, true); 438 paint.setRenderHint(QPainter::Antialiasing, true);
430
431 int bw = 3;
432 439
433 float w = width(); 440 float w = width();
434 float w0 = 0.5; 441 float w0 = 0.5;
435 float w1 = w - 0.5; 442 float w1 = w - 0.5;
436 443
462 } 469 }
463 470
464 paint.drawPath(path); 471 paint.drawPath(path);
465 } 472 }
466 473
467 474 paint.setClipRect(subclip);
468 if (m_orientation == Qt::Horizontal) {
469 paint.setClipRect(QRect(bw, bw+1, width() - bw*2, height() - bw*2 - 2));
470 } else {
471 paint.setClipRect(QRect(bw+1, bw, width() - bw*2 - 2, height() - bw*2));
472 }
473 475
474 float radians = m_rotation * 1.5f * M_PI; 476 float radians = m_rotation * 1.5f * M_PI;
475 477
476 // std::cerr << "value = " << m_value << ", min = " << m_min << ", max = " << m_max << ", rotation = " << rotation << std::endl; 478 // std::cerr << "value = " << m_value << ", min = " << m_min << ", max = " << m_max << ", rotation = " << rotation << std::endl;
477 479