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 7836629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:14:20+00:00 2026-06-02T14:14:20+00:00

Having some problem figuring out how to do this. Will try and explain what

  • 0

Having some problem figuring out how to do this. Will try and explain what it is that I’m trying to do first.

First I have this class which contains a Read-Only file. This class will use a this other class(StorageProvider) to upload blocks of this file. That class contains a QNetworkAccessManager. When uploading blocks of the file, I will send the block to the StorageProvider class that then uses a REST request that it sends of to the QNAM. When the QNetworkReply is done, the StorageProvider will then signal this to the uploader (so that it know that that block is done).

Uploader -> StorageProvider -> QNetworkAccessManager -> Internet

So far so good right? I could just put a slot in the uploader that listens to when the StorageHandler is done with the request that it made on the QNAM.

However, since the QNAM can, over HTTP, do 6 requests at the same time, I was thinking to make it so that when the StorageProvider signals that it is done with a block, and unique BlockId is connected to the signal, allowing the uploader to know WHICH block that is done, not just that it IS done.

This would mean that the slot that will be called whenever a signal(blockId) is emitted by the StorageProvider, will have to store the id that was done and then look for a new one that is not uploaded (Forgot to mention that I have a list of IDs that are already uploaded, so when it steps though the ids (0…1000), it also needs to 1. push the index of the file 4mb forward 2. check in the list of already existing block if it is in.

So, my question is: If I have a slot which increses a “currentBlockId” by one until it finds the next one that can be upload + reads the file 4mb at the time until we are at position “currentBlockId” * 4mb (the index in the file will be pushed forward like an index and it will not be random access. when this index reaches the end of the file we are done) and this slot will be called whenever one of 5 uploads are done, will I have an issue? The reason why I’m asking is beacuse the QNAM makes it calls in different threads which might do so that 2-5 “finished()” signals are emitted at the same time, which would call the slot that handles that at the same time? Like, I’m not too sure what will happen then. Notice that none of my code is threaded and in theory the signals should be queued right? and the slot would be called 5 times, one after another?

Thanks

  • 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-02T14:14:33+00:00Added an answer on June 2, 2026 at 2:14 pm

    Wow, my eyes. Read through that once, still don’t have a handle on what you want… so here’s the scoop.

    By default, slots are called on the event thread. By default, there is only one event thread. In this regard, you are correct. By default, when a slot is consuming the event thread, the calls queue up for later.

    However, that does not mean it’s safe to assume that all 5 of your calls will necessarily arrive in the order that you expect them to, or even from the same thread. If you want to get fancy and process stuff in parallel (can’t tell, the post is too confusing), then use QtConcurrent::run() for just one example of how to launch a new thread for processing. Under this scheme, all the slot would do is push your data onto a queue (remember to protect it with a mutex) and fire off the QtConrrent::run() function.

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

Sidebar

Related Questions

I having some trouble figuring this problem out where I have one button which
I am having some problems figuring out this issue. I have a server that
I'm having some trouble figuring out the right selector syntax for this problem and
I'm having some problems figuring out a solution to this problem. I want to
I am new to programming and having some problem figuring out nested loops. I
I'm having some trouble figuring out the best/Djangoic way to do this. I'm creating
First time poster, long time reader. I've been having a problem with figuring this
This is a straightforward problem to explain and yet I'm having some tough time
Here's an interesting problem: I have some jQuery that looks like this: $(document).ready(function() {
Ok, I have been having a VERY hard time figuring this out. I guess

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.