* @brief Opens a native QFileDialog to pick a logo for the report. */
| 1021 | * @brief Opens a native QFileDialog to pick a logo for the report. |
| 1022 | */ |
| 1023 | void 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 |
nothing calls this directly
no test coverage detected