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. Show window in parallel
QtWS25 Last Chance

Show window in parallel

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 211 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.
  • ivanicyI Offline
    ivanicyI Offline
    ivanicy
    wrote on last edited by
    #1

    Hello!!

    I have a function that takes a long time to run in MainWindow. How can I launch a window in parallel for the duration of the process?

    Thank you very much!

    Pl45m4P 1 Reply Last reply
    0
    • ivanicyI ivanicy

      Hello!!

      I have a function that takes a long time to run in MainWindow. How can I launch a window in parallel for the duration of the process?

      Thank you very much!

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @ivanicy

      Run this function in a new thread.

      • Create worker QObject
      • Let the worker do your "work" (put your function there)
      • Create new QThread and moveToThread your worker.
      • Then you can communicate with signals and slots with your thread / worker and do something else in your MainWindow (show another window or do some other stuff)

      Like here


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      2
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        Depending on what that function does, QtConcurrent::run might be a simpler alternative.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1

        • Login

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