Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. oauth2 setModifyParametersFunction post qt6
Forum Updated to NodeBB v4.3 + New Features

oauth2 setModifyParametersFunction post qt6

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 529 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.
  • testmonkeyT Offline
    testmonkeyT Offline
    testmonkey
    wrote on last edited by
    #1

    Hello Folks

    Trying to update and compile some of my legacy apps using Qt 6.3.... come across a stumbling block.

    any ideas on how to make this work on Qt6+ ?

    oauth2->setModifyParametersFunction([](QAbstractOAuth::Stage stage, QVariantMap* parameters) {
           (*parameters)["redirect_uri"] = QUrl("https://localhost:1234");
        });
    

    works absolutly fine as as expected in Qt 5.15.2

    however on Qt 6.3 erroring out with;

    no viable conversion from lambda to 'const QAbstractOAuth::ModifyParametersFunction' (aka 'const function<void (QAbstractOAuth::Stage, QMultiMap<QString, QVariant> *)>')

    Any clues on how to fix this, or is there another way to set redirect_uri on 6.3 ?

    Thanks

    Craig

    JonBJ 1 Reply Last reply
    0
    • testmonkeyT testmonkey

      Hello Folks

      Trying to update and compile some of my legacy apps using Qt 6.3.... come across a stumbling block.

      any ideas on how to make this work on Qt6+ ?

      oauth2->setModifyParametersFunction([](QAbstractOAuth::Stage stage, QVariantMap* parameters) {
             (*parameters)["redirect_uri"] = QUrl("https://localhost:1234");
          });
      

      works absolutly fine as as expected in Qt 5.15.2

      however on Qt 6.3 erroring out with;

      no viable conversion from lambda to 'const QAbstractOAuth::ModifyParametersFunction' (aka 'const function<void (QAbstractOAuth::Stage, QMultiMap<QString, QVariant> *)>')

      Any clues on how to fix this, or is there another way to set redirect_uri on 6.3 ?

      Thanks

      Craig

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @testmonkey
      Does changing QVariantMap* parameters to QMultiMap<QString, QVariant>* parameters fix this?

      1 Reply Last reply
      1
      • testmonkeyT Offline
        testmonkeyT Offline
        testmonkey
        wrote on last edited by testmonkey
        #3

        brilliant thanks JonB; got me a step further....

        error moved onto the next line;
        error: No viable overloaded operator[] for type 'QMultiMap<QString, QVariant>'

        So I changed the code for insert instead. That function now works...

        But looks like the urlrequestinterceptor is failing now... which is another error not relating to setModifyParametersFunction.

        Probably something else changed in webengine

        FATAL:navigation_url_loader_impl.cc(1114)] Check failed: parsed_headers.Equals(head->parsed_headers).

        1 Reply Last reply
        0
        • testmonkeyT Offline
          testmonkeyT Offline
          testmonkey
          wrote on last edited by
          #4

          thanks again @JonB !

          I have managed to get the app working.
          For completeness;
          I used to used to call a redirect in the requestinterceptor and link connect to the signal via --
          connect(view, &QWebEngineView::urlChanged, view, &QWebEngineView::reload);

          in Qt 6.3 this was cause the QWebEnginePage::setUrlRequestInterceptor to backtrace and error out as mentioned with the parsed_headers.Equals error.

          So after a bit of digging and a few qDebug decided to settle on creating and emitting the newurl instead and changed the connect to ;
          connect(interceptor, &RequestInterceptor::newurl, view, &QWebEngineView::setUrl)

          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