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. Multiple requests in the same method
Forum Updated to NodeBB v4.3 + New Features

Multiple requests in the same method

Scheduled Pinned Locked Moved Solved General and Desktop
24 Posts 3 Posters 6.0k Views 3 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.
  • M Offline
    M Offline
    Mr Gisa
    wrote on last edited by
    #21

    @Chris-Kawa Playing around I noticed that I needed extra information on my search method, two more arguments as QString. The thing is that I will be needing that two extra arguments later in another method/slot.

    More or less like this:

    search > processJson > processProducts

    I will need the extra arguments in the processProducts.

    The option I thought was:

    1 - store the values passed to search in a member and get later in another method.

    Is there a better alternative for that?

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #22

      If one instance of your class does only one search at a time then sounds like a reasonable thing to store the extra state as members. No point in complicating things.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Mr Gisa
        wrote on last edited by
        #23

        Yes, it will be one search per instance, because I will create a QTabWidget and each QWidget of the tab will have an instance of the Searcher. I mean, the new tab will be created after the user fills a line edit and click on the search button.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Mr Gisa
          wrote on last edited by Mr Gisa
          #24

          @Chris-Kawa I have a few more questions:

          The searcher will also be a downloader.

          The idea behind this application is that the user can search for a product and the product will appear in a tree view. I will explain the tree view.

          I want to do something like this:

          1 - The user fills a line edit with the product he wants to search and press the search button.
          2 - A new tab will be created in the QTabWidget with a tree view and an instance of the Searcher.
          3 - When the search is done and Searcher emits a signal that the search is done I want to display the results in a tree view.
          4 - The results that Searcher will return is a collection of Products, a struct with a few information such as the name, color and other information, but the most important one, it will have a link to a zip file.
          5 - I want to create a button on the tree view that is called Download in each Product which contains the zip link.
          6 - When the user clicks on that button I want to download that zip file and get the file names and put as children to the download clicked item on the tree view.

          For me its kinda complicated, any ideas of what I can do to archive that?

          0_1525652398920_de747c9f-def5-48cc-bb49-41ac06971d2c-image.png

          The Product B has a zip link so it will have a download button on the tree view. Imagine that the user clicked on the button, it downloaded the zip file, got its the file names and put as children for ProductB.

          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