Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. How to show data from a thread to status bar?

How to show data from a thread to status bar?

Scheduled Pinned Locked Moved Unsolved Qt 6
4 Posts 2 Posters 552 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.
  • K Offline
    K Offline
    KyRillos_BoshRa
    wrote on last edited by
    #1

    I'm currently working on a project where I have threads that handle user requests, I'm tring to find a way so when user send request I show some information about this user and the request on the main widget's status bar (on the server side) how can I do this?

    jsulmJ 1 Reply Last reply
    0
    • K KyRillos_BoshRa

      I'm currently working on a project where I have threads that handle user requests, I'm tring to find a way so when user send request I show some information about this user and the request on the main widget's status bar (on the server side) how can I do this?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @KyRillos_BoshRa Emit a signal from the thread and connect this signal to a slot in your UI where you update the status bar.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • K Offline
        K Offline
        KyRillos_BoshRa
        wrote on last edited by
        #3

        but I don't know how to get data that I read inside the thread this way, can you explain more please?

        jsulmJ 1 Reply Last reply
        0
        • K KyRillos_BoshRa

          but I don't know how to get data that I read inside the thread this way, can you explain more please?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @KyRillos_BoshRa The data from the thread can be sent via the signal: it would be simply signal parameter. Please read https://doc.qt.io/qt-6/signalsandslots.html

          class MyClass
          {
          signals:
              void mySignal(const QString &myData); // Here myData is an example for data which is passed from signal to slot
          };
          

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          4

          • Login

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