MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / pickReportLogo

Method pickReportLogo

app/src/Sessions/DatabaseManager.cpp:1023–1042  ·  view source on GitHub ↗

* @brief Opens a native QFileDialog to pick a logo for the report. */

Source from the content-addressed store, hash-verified

1021 * @brief Opens a native QFileDialog to pick a logo for the report.
1022 */
1023void Sessions::DatabaseManager::pickReportLogo()
1024{
1025 auto* dialog = new QFileDialog(qApp->activeWindow(),
1026 tr("Select logo image"),
1027 QString(),
1028 tr("Images (*.png *.jpg *.jpeg *.svg)"));
1029 dialog->setAcceptMode(QFileDialog::AcceptOpen);
1030 dialog->setFileMode(QFileDialog::ExistingFile);
1031 dialog->setAttribute(Qt::WA_DeleteOnClose);
1032
1033 connect(dialog, &QFileDialog::fileSelected, this, [this](const QString& path) {
1034 if (path.isEmpty())
1035 return;
1036
1037 QMetaObject::invokeMethod(
1038 this, [this, path]() { Q_EMIT reportLogoPicked(path); }, Qt::QueuedConnection);
1039 });
1040
1041 dialog->open();
1042}
1043
1044//--------------------------------------------------------------------------------------------------
1045// Project metadata sync

Callers

nothing calls this directly

Calls 3

isEmptyMethod · 0.80
activeWindowMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected