fix: widget bugs surfaced by new gtest coverage
- FrameRateComboBox: RepopulateList() left current index at -1 on first fill, so GetFrameRate() returned 0/1 instead of the displayed first entry until something called SetFrameRate() - HandMovableView: default_drag_mode_ was never initialized; an early Core::ToolChanged signal would setDragMode() with it (UB)
This commit is contained in:
@@ -34,6 +34,7 @@ namespace olive
|
|||||||
HandMovableView::HandMovableView(QWidget *parent)
|
HandMovableView::HandMovableView(QWidget *parent)
|
||||||
: super(parent)
|
: super(parent)
|
||||||
, dragging_hand_(false)
|
, dragging_hand_(false)
|
||||||
|
, default_drag_mode_(NoDrag)
|
||||||
, is_timeline_axes_(false)
|
, is_timeline_axes_(false)
|
||||||
{
|
{
|
||||||
connect(Core::instance(), &Core::ToolChanged, this,
|
connect(Core::instance(), &Core::ToolChanged, this,
|
||||||
|
|||||||
@@ -177,7 +177,9 @@ private:
|
|||||||
.arg(VideoParams::FrameRateToString(custom_rate_)));
|
.arg(VideoParams::FrameRateToString(custom_rate_)));
|
||||||
}
|
}
|
||||||
|
|
||||||
inner_->setCurrentIndex(temp_index);
|
// On the first populate there is no current index (-1); select the
|
||||||
|
// first standard rate so GetFrameRate() matches what's displayed
|
||||||
|
inner_->setCurrentIndex(qMax(temp_index, 0));
|
||||||
|
|
||||||
inner_->blockSignals(false);
|
inner_->blockSignals(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user