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. Display loading gif while lengthy function is running in parallel.
Forum Updated to NodeBB v4.3 + New Features

Display loading gif while lengthy function is running in parallel.

Scheduled Pinned Locked Moved Unsolved General and Desktop
parallelqmovieloading
2 Posts 2 Posters 334 Views
  • 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.
  • B Offline
    B Offline
    BigBen
    wrote on last edited by
    #1

    I have a loading gif named loading.gif.
    I want to display this gif in a label using QMovie, while a function named extractMeta() that takes some time to execute is running in parallel. Then I want this gif to disappear as soon as the extraxtMeta() function completed execution.
    How can I do so?
    I have read that QConcurrent might be a possible solution, but I am having trouble understanding how to implement this.

    J.HilkJ 1 Reply Last reply
    0
    • B BigBen

      I have a loading gif named loading.gif.
      I want to display this gif in a label using QMovie, while a function named extractMeta() that takes some time to execute is running in parallel. Then I want this gif to disappear as soon as the extraxtMeta() function completed execution.
      How can I do so?
      I have read that QConcurrent might be a possible solution, but I am having trouble understanding how to implement this.

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      hi @BigBen

      thats only possible, as long as your long running function does not modify Ui-elements

      but yes, QtConcurrent is one of the possible options to use

      let me link you to my git repo
      https://github.com/DeiVadder/QtThreadExample

      that covers all (Qt) ways of parallelisation, and should give you a good starting point


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      2

      • Login

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