Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Login on a Url

    General and Desktop
    2
    3
    1014
    Loading More Posts
    • 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.
    • D
      dotK last edited by

      Hello everyone, I have a small question, and I think is easy but I'm so much crazy to see.

      I'm doying a Upload Image Application, and I have a site I want show the Image. My question is how I can do a login, by my application, on a url? This is possible? How?

      [.k] - A Mad Programmer

      1 Reply Last reply Reply Quote 0
      • B
        b1gsnak3 last edited by

        Well... You should use QNetworkAccessManager and post a request with the url. Assuming that the url is like "http://www.something.com/login?&user=username&password=password" the code would be something like this:

        @
        QNetworkAccessManager man = new QNetworkAccessManager();
        QNetworkRequest req;
        req.setUrl(QUrl("http://www.something.com/login?&user=username&password=password"));
        man->get(req);
        connect(man, SIGNAL(finished(QNetworkReply
        )), this, SLOT(someSlot(QNetworkReply*)));
        @

        and in the someSlot you process the reply. Here you check if the login is successful or not.

        1 Reply Last reply Reply Quote 0
        • D
          dotK last edited by

          Ok, thank you @b1gsnak3, I will read about QNetworkAccessManager, and try with this code, I think it will work.

          [.k] - A Mad Programmer

          1 Reply Last reply Reply Quote 0
          • First post
            Last post