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. Widget not repainting
Forum Updated to NodeBB v4.3 + New Features

Widget not repainting

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 3 Posters 1.2k Views 1 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.
  • D Offline
    D Offline
    DalePennington
    wrote on last edited by
    #1

    We have an application that handles reporting system Alerts. It has 2 visible windows based on QWidget :

    1. Log Window : Contains a QTextEdit that we add alert text to the top of. May not be visible.
    2. Alert Window : Temporarily displays latest alert, then hides after 5 seconds (QTimer triggering a hide).

    When both windows are visible, the Alert Window obscures a part of the top of the Log Window.

    When an alert comes in, the processing turns the alert to text and inserts it in the Text Edit, then passes it to the Alert Window, which displays it and starts its 5 second to hide timer.

    The issue we are seeing is that some times, the Log Window does not appear to be painting. A new alert shows up in the Alert Window, but not the Log WIndow, and when the Alert Window goes away, the part overlapping the Log Window is not redrawn. Also, it does not respond in any other way, as if it is frozen, or not repainting. But is a hide then show is issued for the Log Window, it starts behaving normally.

    As noted above we suspect the issue is with the Log Window for some reason not repainting like it normally should. So the question is : Is there anything in Qt that might be preventing this ? And is there a way to determine if that condition is in effect ?

    Thanks,
    Dale Pennington

    JonBJ 1 Reply Last reply
    0
    • D DalePennington

      We have an application that handles reporting system Alerts. It has 2 visible windows based on QWidget :

      1. Log Window : Contains a QTextEdit that we add alert text to the top of. May not be visible.
      2. Alert Window : Temporarily displays latest alert, then hides after 5 seconds (QTimer triggering a hide).

      When both windows are visible, the Alert Window obscures a part of the top of the Log Window.

      When an alert comes in, the processing turns the alert to text and inserts it in the Text Edit, then passes it to the Alert Window, which displays it and starts its 5 second to hide timer.

      The issue we are seeing is that some times, the Log Window does not appear to be painting. A new alert shows up in the Alert Window, but not the Log WIndow, and when the Alert Window goes away, the part overlapping the Log Window is not redrawn. Also, it does not respond in any other way, as if it is frozen, or not repainting. But is a hide then show is issued for the Log Window, it starts behaving normally.

      As noted above we suspect the issue is with the Log Window for some reason not repainting like it normally should. So the question is : Is there anything in Qt that might be preventing this ? And is there a way to determine if that condition is in effect ?

      Thanks,
      Dale Pennington

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

      @DalePennington
      The initial answer is that you really ought take your Log & Alter windows code and try to reproduce in a standalone application.

      It sounds like you have a window update problem.

      Two quick initial questions:

      • Do you have any "blocking" loops, which could prevent the Qt event loop from being hit? When these logs/alerts are being performed, is your "backend" busy doing something?

      • Do you have any threading in your code?

      Maybe show your dispatching, timeout and hiding code, in case there is something there.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DalePennington
        wrote on last edited by
        #3

        Techically they are a seperate application is a suite of application we have.

        On the blocking, I cannot find any (other than some controlled mutexes, and other behavior shows they are not blocking), and the fact the Alert window is still showing updates when the Log Window does not seems to indicate the GUI thread is still running strong.

        We do have 2 other threads. Both take incoming communications and pass them to the Qt thread. This is done by calling a function to place the incoming data in a queue (protected by mutexes), then emitting a signal to have the GUI thread put the data out of the queue and update the windows.

        Dale

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

          Hi,

          How do you show your alert window ?

          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
          0
          • D Offline
            D Offline
            DalePennington
            wrote on last edited by
            #5

            The Alert Window is never actually hidden (per show/hide). Instead, it gets resized from 1 (the "hidden" mode) to 67. So when they want to user to see it they do

            this->resize(856,67);
            this->raise;

            and when they want to not show it

            this->resize(856,1);

            The Log Window uses show and hide.

            Dale

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

              On which OS are you seeing this behaviour ?

              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
              0
              • D Offline
                D Offline
                DalePennington
                wrote on last edited by
                #7

                We are running on RHEL 8.4, using QT 5.12.5

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

                  Would it be possible to use a more recent version of Qt ? 5.12 is more than outdated.

                  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
                  0
                  • D Offline
                    D Offline
                    DalePennington
                    wrote on last edited by
                    #9

                    We tried using the 5.15.5 (libraries, not recompiling the apps), and saw the same behavior.

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

                      Can you reproduce that with a minimal application ?

                      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
                      0
                      • D Offline
                        D Offline
                        DalePennington
                        wrote on last edited by
                        #11

                        At this point, no. Part of it appears to be interaction between multiple apps and a custom Window Manager (all Qt based).
                        The next thing we are thinking of trying is downloaded the latest Qt5.15 source, and adding debug to track outgoing/incoming XCB events/activities relating to sizeing, mapping and exposing and see if that gives us a clue to what is going on.

                        Dale

                        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