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. Login on a Url
Forum Updated to NodeBB v4.3 + New Features

Login on a Url

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.2k Views 1 Watching
  • 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 Offline
    D Offline
    dotK
    wrote on last edited by
    #1

    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
    0
    • B Offline
      B Offline
      b1gsnak3
      wrote on last edited by
      #2

      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
      0
      • D Offline
        D Offline
        dotK
        wrote on last edited by
        #3

        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
        0

        • Login

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