mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-19 16:02:09 -05:00
Fix crash when rapidly inserting / removing macro segments
This commit is contained in:
@@ -463,7 +463,17 @@ void MacroSegmentList::SetupVisibleMacroSegmentWidgets()
|
||||
|
||||
const auto viewportRect = viewport()->rect();
|
||||
|
||||
for (auto segment : widget()->findChildren<MacroSegmentEdit *>()) {
|
||||
for (int i = 0; i < _contentLayout->count(); ++i) {
|
||||
auto item = _contentLayout->itemAt(i);
|
||||
if (!item) {
|
||||
continue;
|
||||
}
|
||||
|
||||
auto segment = dynamic_cast<MacroSegmentEdit *>(item->widget());
|
||||
if (!segment) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const auto pos = segment->mapTo(viewport(), QPoint(0, 0));
|
||||
const QRect rect(pos, segment->size());
|
||||
if (!viewportRect.intersects(rect)) {
|
||||
|
||||
Reference in New Issue
Block a user