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. How to unit test the code inside the paintEvent(QPaintEvent *)
Forum Updated to NodeBB v4.3 + New Features

How to unit test the code inside the paintEvent(QPaintEvent *)

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 323 Views 2 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.
  • J Offline
    J Offline
    jay1
    wrote on last edited by
    #1

    I have no idea how can i do the unit test on the paintEvent function that is override.

    Kindly suggest any ideas or opinions.

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

      Hi,

      What does happen in that paint event that you want to test ?

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

        In the paintEvent, just draws simple drawings like a circle. So i want to test if the drawing is actually drawn i.e. paintEvent function is executed or not.

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

          Since you know what is rendered, you can dump the result and check that the resulting image is not blank.

          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
          2
          • J Offline
            J Offline
            jay1
            wrote on last edited by
            #5

            Thanks for the reply.

            I was able to use this approach to solve the problem by storing the image and later compare the image stored.

            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