const QPointF YUV_Mg(.289, .515);
const QPointF YUV_Yl(-.437, .100);
-const QPen penThick(QBrush(QColor(250,250,250)), 2, Qt::SolidLine);
-const QPen penThin(QBrush(QColor(250,250,250)), 1, Qt::SolidLine);
-const QPen penLight(QBrush(QColor(200,200,250,150)), 1, Qt::SolidLine);
-const QPen penDark(QBrush(QColor(0,0,20,250)), 1, Qt::SolidLine);
-
Vectorscope::Vectorscope(Monitor *projMonitor, Monitor *clipMonitor, QWidget *parent) :
AbstractScopeWidget(projMonitor, clipMonitor, parent),
- m_gain(1),
- m_circleEnabled(false)
+ m_gain(1)
{
ui = new Ui::Vectorscope_UI();
ui->setupUi(this);
b &= connect(ui->backgroundMode, SIGNAL(currentIndexChanged(int)), this, SLOT(slotBackgroundChanged()));
b &= connect(ui->sliderGain, SIGNAL(valueChanged(int)), this, SLOT(slotGainChanged(int)));
b &= connect(ui->paintMode, SIGNAL(currentIndexChanged(int)), this, SLOT(forceUpdateScope()));
+ b &= connect(this, SIGNAL(signalMousePositionChanged()), this, SLOT(forceUpdateHUD()));
ui->sliderGain->setValue(0);
Q_ASSERT(b);
-
- this->setMouseTracking(true);
+ // To make the 1.0x text show
slotGainChanged(ui->sliderGain->value());
init();
m_aAxisEnabled->setChecked(scopeConfig.readEntry("axis", false));
ui->backgroundMode->setCurrentIndex(scopeConfig.readEntry("backgroundmode").toInt());
ui->paintMode->setCurrentIndex(scopeConfig.readEntry("paintmode").toInt());
+ ui->sliderGain->setValue(scopeConfig.readEntry("gain", 1));
}
void Vectorscope::writeConfig()
scopeConfig.writeEntry("75PBox", m_a75PBox->isChecked());
scopeConfig.writeEntry("axis", m_aAxisEnabled->isChecked());
scopeConfig.writeEntry("backgroundmode", ui->backgroundMode->currentIndex());
- scopeConfig.writeEntry("paintMode", ui->paintMode->currentIndex());
+ scopeConfig.writeEntry("paintmode", ui->paintMode->currentIndex());
+ scopeConfig.writeEntry("gain", ui->sliderGain->value());
scopeConfig.sync();
}
QImage hud;
- if (m_circleEnabled) {
+ if (m_mouseWithinWidget) {
// Mouse moved: Draw a circle over the scope
hud = QImage(m_scopeRect.size(), QImage::Format_ARGB32);
float angle = copysign(acos(dx/r)*180/M_PI, dy);
davinci.drawText(QPoint(10, m_scopeRect.height()), i18n("%1°", QString::number(angle, 'f', 1)));
- m_circleEnabled = false;
+// m_circleEnabled = false;
} else {
hud = QImage(0, 0, QImage::Format_ARGB32);
}
}
forceUpdateBackground();
}
-
-
-
-///// Events /////
-
-void Vectorscope::mouseMoveEvent(QMouseEvent *event)
-{
- // Draw a circle around the center,
- // showing percentage number of the radius length
-
- m_circleEnabled = true;
- m_mousePos = event->pos();
- forceUpdateHUD();
-}
-
-void Vectorscope::leaveEvent(QEvent *event)
-{
- // Repaint the HUD without the circle
-
- m_circleEnabled = false;
- QWidget::leaveEvent(event);
- forceUpdateHUD();
-}