@@ -628,9 +628,11 @@ bool Application::event(QEvent *event)
628628 case QEvent::FileOpen:
629629 {
630630 QString fileName = static_cast <QFileOpenEvent*>(event)->file ().normalized (QString::NormalizationForm_C);
631- QMetaObject::invokeMethod (this , [fileName = std::move (fileName)] {
632- parseArgs ({ fileName });
633- });
631+ #if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
632+ QMetaObject::invokeMethod (this , [&fileName] { parseArgs ({fileName}); });
633+ #else
634+ QMetaObject::invokeMethod (this , qOverload<QStringList>(&Application::parseArgs), QStringList (fileName));
635+ #endif
634636 return true ;
635637 }
636638#ifdef Q_OS_MAC
@@ -871,7 +873,7 @@ void Application::showClient(const QStringList ¶ms, bool crypto, bool sign,
871873{
872874 if (sign)
873875 sign = params.size () != 1 || !CONTAINER_EXT .contains (QFileInfo (params.value (0 )).suffix (), Qt::CaseInsensitive);
874- QWidget *w = nullptr ;
876+ MainWindow *w = nullptr ;
875877 if (!newWindow && params.isEmpty ())
876878 {
877879 // If no files selected (e.g. restoring minimized window), select first
@@ -921,8 +923,12 @@ void Application::showClient(const QStringList ¶ms, bool crypto, bool sign,
921923 w->show ();
922924 w->activateWindow ();
923925 w->raise ();
924- if ( !params.isEmpty () )
925- QMetaObject::invokeMethod (w, " open" , Q_ARG (QStringList,params), Q_ARG (bool ,crypto), Q_ARG (bool ,sign));
926+ if (!params.isEmpty ())
927+ #if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
928+ QMetaObject::invokeMethod (w, [&] { w->open (params, crypto, sign); });
929+ #else
930+ QMetaObject::invokeMethod (w, &MainWindow::open, params, crypto, sign);
931+ #endif
926932}
927933
928934void Application::showWarning ( const QString &msg, const digidoc::Exception &e )
0 commit comments