Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Real-time information window auxiliary to the main app

Real-time information window auxiliary to the main app

Scheduled Pinned Locked Moved Unsolved Qt for Python
9 Posts 3 Posters 1.0k 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.
  • J Offline
    J Offline
    john_hobbyist
    wrote on last edited by
    #1

    Hello! I have built I pyqt5 application that does some things. The problem is that in order to identify if an action is finished I mostly read prints I have put inside the code. The problem I need to do it more formal, so auxiliary to the main window to open a secondary window that will show "this action happened", "that action happened". Obviously, I do not want to reinvent the wheel. Is there something that I could use in order to print real-time messages in parallel as the main application does the work? Thank you for your time....

    JonBJ 1 Reply Last reply
    0
    • J john_hobbyist

      Hello! I have built I pyqt5 application that does some things. The problem is that in order to identify if an action is finished I mostly read prints I have put inside the code. The problem I need to do it more formal, so auxiliary to the main window to open a secondary window that will show "this action happened", "that action happened". Obviously, I do not want to reinvent the wheel. Is there something that I could use in order to print real-time messages in parallel as the main application does the work? Thank you for your time....

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @john_hobbyist
      Create a modeless QDialog, put a QTextEdit or list of QLabels on it. Outside world can update it, or better emit a signal for which that has a slot. Howeverm code does depend if you really mean "real-time" messages/updates.

      J 1 Reply Last reply
      1
      • JonBJ JonB

        @john_hobbyist
        Create a modeless QDialog, put a QTextEdit or list of QLabels on it. Outside world can update it, or better emit a signal for which that has a slot. Howeverm code does depend if you really mean "real-time" messages/updates.

        J Offline
        J Offline
        john_hobbyist
        wrote on last edited by
        #3

        @JonB So, I let the QDialog window open at the same time as the other main window works? Will that concept work? I mean to have in parallel 2 windows do jobs? Do I need thread level programming?

        JonBJ 1 Reply Last reply
        0
        • J john_hobbyist

          @JonB So, I let the QDialog window open at the same time as the other main window works? Will that concept work? I mean to have in parallel 2 windows do jobs? Do I need thread level programming?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @john_hobbyist
          Yes; yes; yes; no. :)

          1 Reply Last reply
          2
          • J Offline
            J Offline
            john_hobbyist
            wrote on last edited by john_hobbyist
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • J Offline
              J Offline
              john_hobbyist
              wrote on last edited by
              #6

              So I managed to connect a QDialog when a button is pressed. I initialized a global string. I need when a function is called to send data to the global string and I need the QDialog to update its text by reading the global string and print it. How can I achieve that?

              JonBJ 1 Reply Last reply
              0
              • J john_hobbyist

                So I managed to connect a QDialog when a button is pressed. I initialized a global string. I need when a function is called to send data to the global string and I need the QDialog to update its text by reading the global string and print it. How can I achieve that?

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by
                #7

                @john_hobbyist
                No global variables. You know that Qt is all about signals & slots. That is how best to communicate between separate windows.

                J 1 Reply Last reply
                3
                • JonBJ JonB

                  @john_hobbyist
                  No global variables. You know that Qt is all about signals & slots. That is how best to communicate between separate windows.

                  J Offline
                  J Offline
                  john_hobbyist
                  wrote on last edited by
                  #8

                  @JonB So, when each function takes place it should emit signal to the function related to QDialog? I am trying to understand the rationale here...

                  jsulmJ 1 Reply Last reply
                  0
                  • J john_hobbyist

                    @JonB So, when each function takes place it should emit signal to the function related to QDialog? I am trying to understand the rationale here...

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

                    @john_hobbyist said in Real-time information window auxiliary to the main app:

                    when each function takes place it should emit signal to the function related to QDialog?

                    Yes.

                    Or, if you use open() instead of exec(), you could also implement setter functions in your dialog which can be easily called from other places to pass some data to the dialog.

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

                    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