Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [Solved] PaintEvent being displayed underneath a text label
QtWS25 Last Chance

[Solved] PaintEvent being displayed underneath a text label

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 1.7k 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.
  • E Offline
    E Offline
    Endless
    wrote on last edited by
    #1

    When my UI Designer form is instantiated, in the constructor, I start a 1-second timer and connect its timeout signal with the form's update slot. Then, whenever the timer goes off, the paintEvent function of my form is called. In this function, I translate my brush to the proper area on the form, draw a dial and then rotate it depending on the current second count (it basically acts like a second hand on a watch). So far, everything functions fine. I see the dial going around and around on the form.

    What I want to do now is add a picture of a clock to my form. I create a text label and define its pixmap property to the name of a PNG file. It's placed on the form such that the dial I draw in the paintEvent function should show up in the clock face of the picture. When I run the application, I see the picture of the clock, but my dial isn't there (I would assume it's underneath the text label picture). How do I get it to show up on top of the text label picture?

    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