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. How do I auth with QtWebView then open QtApplication?
QtWS25 Last Chance

How do I auth with QtWebView then open QtApplication?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 2.3k 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.
  • W Offline
    W Offline
    wazoo
    wrote on last edited by
    #1

    Hi all,

    I'm attempting to build a game client using a mix of HTML5 and native.

    Upon launch, I want to pop open a QTWebView to my login page on my server, then once the player has authenticated, I want to close down the WebView, send the authenticated user token back from the server, and get into a native QtApplication running OpenGL (whatever the proper class name is)..

    I've created the WebView which pulls up my login page, but now I'm stuck on where to direct my research..

    I respect everyone's time too much to ask for a code sample (and I want to learn it heh), so even just a suggestion on what topic to start with would be greatly appreciated..

    thanks so much!

    1 Reply Last reply
    0
    • A Offline
      A Offline
      AcerExtensa
      wrote on last edited by
      #2

      Maybe it is better to show simple QWidget for username & pass, after just send POST request with QNetworkAccessManager to the server and analyze response in finished slot.(for session ID or what ever the server response)

      But if QWebView is absolutely necessarily, then:

      1. you can create your NetworkAccessManager and set it for QWebView
        1.1 peek and anaylse response
      2. connect to QNetworkManager of QWebView
        2.1 peek and anaylse data

      God is Real unless explicitly declared as Integer.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #3

        You need to have a QApplication running for the QWebView to do its job. The correct order would be:

        create QApplication

        set up basic things

        create a dialog containing the QWebView and show it

        rund QApplication's event loop with exec()

        in the dialog, if the login was successful, open your main mindow

        close the dialog by calling accept() and/or deleteLater()

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • W Offline
          W Offline
          wazoo
          wrote on last edited by
          #4

          Thanks @AcerExtensa and @Volker for the suggestions!

          I do need to show a QWebView to not only support Facebook / Twitter authentication, but also to make sure any latest updates to the game are shown for players.

          I've managed to create two windows that launch at the same time (probably under the umbrella of a QApplication idea that @Volker had)..

          So the next key to cracking this problem is to figure out how to listen for some kind of event from the WebView in order to close it up and open the other main window..

          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