Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. WebEngine FileDialog Request accept dialog
Qt 6.11 is out! See what's new in the release blog

WebEngine FileDialog Request accept dialog

Scheduled Pinned Locked Moved Solved QtWebEngine
3 Posts 2 Posters 987 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mmjvoxM Offline
    mmjvoxM Offline
    mmjvox
    wrote on last edited by
    #1

    I searched in qt sources and in 'qquickwebenginedialogrequests.cpp' file i found this functions :

    void QQuickWebEngineFileDialogRequest::dialogAccept(const QStringList &files)
    {
        m_accepted = true;
        QSharedPointer<FilePickerController> controller = m_controller.toStrongRef();
        if (controller)
            controller->accepted(files);
    }
    
    
    void QQuickWebEngineFileDialogRequest::dialogReject()
    {
        m_accepted = true;
        QSharedPointer<FilePickerController> controller = m_controller.toStrongRef();
        if (controller)
            controller->rejected();
    }
    

    I can reject WebEngineView file dialog launched by file dialog request by calling this:

    QMetaObject::invokeMethod(upload, "dialogReject");
    

    But i don't know how to accept that,
    I tried

    QMetaObject::invokeMethod(upload, "dialogAccept",Q_ARG(QString,path));
    

    but didn't worked.
    What should I do?

    jsulmJ 1 Reply Last reply
    0
    • mmjvoxM mmjvox

      I searched in qt sources and in 'qquickwebenginedialogrequests.cpp' file i found this functions :

      void QQuickWebEngineFileDialogRequest::dialogAccept(const QStringList &files)
      {
          m_accepted = true;
          QSharedPointer<FilePickerController> controller = m_controller.toStrongRef();
          if (controller)
              controller->accepted(files);
      }
      
      
      void QQuickWebEngineFileDialogRequest::dialogReject()
      {
          m_accepted = true;
          QSharedPointer<FilePickerController> controller = m_controller.toStrongRef();
          if (controller)
              controller->rejected();
      }
      

      I can reject WebEngineView file dialog launched by file dialog request by calling this:

      QMetaObject::invokeMethod(upload, "dialogReject");
      

      But i don't know how to accept that,
      I tried

      QMetaObject::invokeMethod(upload, "dialogAccept",Q_ARG(QString,path));
      

      but didn't worked.
      What should I do?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @mmjvox said in WebEngine FileDialog Request accept dialog:

      QString,path

      It needs to be QStringList, not QString:

      QStringList paths;
      paths << path;
      QMetaObject::invokeMethod(upload, "dialogAccept",Q_ARG(QStringList,paths));
      

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • mmjvoxM Offline
        mmjvoxM Offline
        mmjvox
        wrote on last edited by
        #3

        Thanks a lot
        Wow, I made a funny mistake
        I get very confused when I'm tired

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved