Skip to content

Commit

Permalink
Prevent black webcam preview, even if size == sizeHint
Browse files Browse the repository at this point in the history
  • Loading branch information
rgriebl committed May 6, 2024
1 parent 43a8d5b commit 1e62a8b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/desktop/itemscannerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,12 @@ ItemScannerDialog::ItemScannerDialog(QWidget *parent)

languageChange();

restoreGeometry(Config::inst()->value(u"MainWindow/ItemScannerDialog/Geometry"_qs).toByteArray());
if (!restoreGeometry(Config::inst()->value(u"MainWindow/ItemScannerDialog/Geometry"_qs).toByteArray())) {
// the camera preview is most likely just black without this
QMetaObject::invokeMethod(this, [this]() {
m_cameraPreviewWidget->resize(m_cameraPreviewWidget->size() + QSize(1, 1));
}, Qt::QueuedConnection);
}
m_pinWindow->setChecked(Config::inst()->value(u"MainWindow/ItemScannerDialog/Pinned"_qs, false).toBool());

updateItemTypeFilters();
Expand Down

0 comments on commit 1e62a8b

Please sign in to comment.