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 Painting Problem in QT 4.8.X
Forum Updated to NodeBB v4.3 + New Features

Widget Painting Problem in QT 4.8.X

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.1k 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.
  • L Offline
    L Offline
    LuckDG
    wrote on last edited by
    #1

    Hello All. I have a strange painting problem in QT 4.8.X and am wondering if someone has seen this before. In my app, I have a QMainWindow. (Please see attached screen cap for reference). As a child of this main window, I have a blue menu bar that hold some buttons. Also as a child of the main window, I have a "drawer" (this is the gray thing over the blue bar) that, among other things, displays the current date and time. The drawer is placed over the top of the menu bar and brought to the foreground using ::raise().

    The problem I have is, on some Win7x64 systems, the date/time display on the drawer will not paint. I have placed debug output in the ::paintEvent() function of the drawer, and the ::paintEvent() function is getting called correctly. It is that, for whatever reason, the actual newly painted control contents are never making it out to the screen. The widget contents will get painted once, and then be locked forevermore with the first date/time. As I said, on some systems it works OK, on some systems the widget will not paint correctly. Strange, right?

    Any thoughts?
    !http://i912.photobucket.com/albums/ac321/nathanislucky/TitleBarNoPaint_zps033b3612.png(Example Pic)!

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

      Hi,

      Maybe a silly question but: Are you calling update regularly so that a repaint is triggered ?

      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
      • L Offline
        L Offline
        LuckDG
        wrote on last edited by
        #3

        Yes, I am most surely calling ::update() regularly. I put debug statements in the ::paintEvent() function where I paint the text onto the drawer (using QPainter and its ::drawText() function). Thus, I know for a fact the ::paintEvent() code is being called and executed. I even dumped out the date/time QString I supposedly painted and it is changing like it should.

        For some reason the results of the paint are not getting out to the screen.

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

          Strange...

          Could you share a minimal implementation example ?

          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

          • Login

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