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

  • Home
  • SEARCH
  • 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 8070613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:26:27+00:00 2026-06-05T13:26:27+00:00

Under qt, I post a query to server using QTcpSocket. I will receive an

  • 0

Under qt, I post a query to server using QTcpSocket.
I will receive an xml result.
I use QLabel to display xml content.

I have tried like this.

QDataStream ini(&sock);
QString result;
in >> result;
ui->label->setText(result);

I’m sorry that I cant provide result, because stackoverflow don’t allow me post images.

But I got some messy code instead of xml. What’s the reason?

Sometimes I can receive some http response words though very rare.
And I will appreciate if you can tell me how to do it.

Perhaps it’s how I display xml content made messy code. I’m confused.:)

  • 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-05T13:26:30+00:00Added an answer on June 5, 2026 at 1:26 pm

    1) The data from the server is not in datastream format. So you cannot read it using QDatastream. Use sock->read()/sock->readAll() directly instead.

    2) Make sure you use the QLabel in plain text mode:

    label->setTextFormat( Qt::PlainText )
    

    Using a QTextBrowser (also, with setPlainText) would be more useful though and will give you more readable and easier to navigate output.

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

Sidebar

Related Questions

I am using Solr 3.5.0 with the example server under jetty-6.1-SNAPSHOT. I have started
I have an odd XML document that I have to query. Its from the
I have a small app which query our SharePoint server' Web Service interface for
I made some meta_values under a custom post type called 'Show'. I have confirmed
When I try to query some content from certain table under certain column, The
Under Windows, I have used a program called Dependency Walker to examine the libraries
Under Django 1.1.1, I am using several authentication backends such as social-registration for facebook
Under certain circumstances, I wish to display an error message to the user if
Under JBoss 4.0.1SP1, I have a servlet that makes multiple, concurrent calls to web
I've certain situation that requires certain result set from MySQL query, let's see the

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.