Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7863907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:37:36+00:00 2026-06-02T23:37:36+00:00

I have a QUrl as this: https://www.example.com/success.html#token=XYZ&user=guest and I want to obtain the value

  • 0

I have a QUrl as this: https://www.example.com/success.html#token=XYZ&user=guest and I want to obtain the value of the token i.e. XYZ

My current code

QString token = url.queryItemValue(QString("token"));
cout << QString("access token is %1").arg(access_token);

returns an empty string.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T23:37:38+00:00Added an answer on June 2, 2026 at 11:37 pm

    Of course it returns an empty string. token is not a valid query item in your given URL. For https://www.example.com/success.html?token=XYZ&user=guest it would be valid. Usually # is used for an anchor name reference and not for parameters. If you really have URLs like that, you need to either first convert the # into a ? or custom parse the URL. You can get the stuff followed by the # with QUrl::fragment().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a look at this picture alt text http://www.abbeylegal.com/downloads/2009-04-01/web%20part%20top%20line.jpg Does anyone know what css
i Have been given this simple task , I want to connect to facebook
I have used this code to sent the user name and a password to
Why doesn't drag and drop pictures work on this QTextEdit? I have tried everything.
Have finally got a responsive site working (of a fashion). What I want to
I have this function here that assembles an API call to eBay. It used
Have some dates in my local Oracle 11g database that are in this format:
Have anyone used Redmine Documentor which lets you convert PHP to HTML to Redmine
I have a website with Drupal installed in a subfolder /drupal . This instance
I have the following piece of code. QNetworkAccessManager *man = new QNetworkAccessManager(this); QNetworkRequest getRequest;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.