Merge pull request #3303 from cg2121/multiview-update-fix

UI: Fix multiview update regression
master
Jim 2020-08-22 08:57:56 -07:00 committed by GitHub
commit d1bc5eebc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 16 deletions

View File

@ -106,7 +106,11 @@ void SceneTree::startDrag(Qt::DropActions supportedActions)
void SceneTree::dropEvent(QDropEvent *event)
{
QListWidget::dropEvent(event);
if (event->source() == this && gridMode) {
if (event->source() != this)
return;
if (gridMode) {
int scrollWid = verticalScrollBar()->sizeHint().width();
int h = visualItemRect(item(count() - 1)).bottom();
@ -131,6 +135,8 @@ void SceneTree::dropEvent(QDropEvent *event)
setCurrentItem(item);
resize(size());
}
emit scenesReordered();
}
void SceneTree::dragMoveEvent(QDragMoveEvent *event)

View File

@ -34,4 +34,7 @@ protected:
virtual void dragMoveEvent(QDragMoveEvent *event) override;
virtual void rowsInserted(const QModelIndex &parent, int start,
int end) override;
signals:
void scenesReordered();
};

View File

@ -408,11 +408,8 @@ OBSBasic::OBSBasic(QWidget *parent)
connect(ui->enablePreviewButton, SIGNAL(clicked()), this,
SLOT(TogglePreview()));
connect(ui->scenes->model(),
SIGNAL(rowsMoved(QModelIndex, int, int, QModelIndex, int)),
this,
SLOT(ScenesReordered(const QModelIndex &, int, int,
const QModelIndex &, int)));
connect(ui->scenes, SIGNAL(scenesReordered()), this,
SLOT(ScenesReordered()));
}
static void SaveAudioDevice(const char *name, int channel, obs_data_t *parent,
@ -8232,15 +8229,8 @@ void OBSBasic::CheckDiskSpaceRemaining()
}
}
void OBSBasic::ScenesReordered(const QModelIndex &parent, int start, int end,
const QModelIndex &destination, int row)
void OBSBasic::ScenesReordered()
{
UNUSED_PARAMETER(parent);
UNUSED_PARAMETER(start);
UNUSED_PARAMETER(end);
UNUSED_PARAMETER(destination);
UNUSED_PARAMETER(row);
OBSProjector::UpdateMultiviewProjectors();
}

View File

@ -662,8 +662,7 @@ private slots:
void CheckDiskSpaceRemaining();
void OpenSavedProjector(SavedProjectorInfo *info);
void ScenesReordered(const QModelIndex &parent, int start, int end,
const QModelIndex &destination, int row);
void ScenesReordered();
void ResetStatsHotkey();