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. QPaintEvent over QLabel
Forum Updated to NodeBB v4.3 + New Features

QPaintEvent over QLabel

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 385 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.
  • FranckynosF Offline
    FranckynosF Offline
    Franckynos
    wrote on last edited by
    #1

    Hi everyone,

    Is it possible to draw with paintevent of QWidget(A)
    Over this child(A)

    I have some QLabel child of QWidget(A) i use paintevent in A to draw something, but it appers behind the QLabels... :(

    thx for help.

    raven-worxR 1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      just call the base class implementation (QWidget::paintEvent) before doing your painting

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      1
      • FranckynosF Franckynos

        Hi everyone,

        Is it possible to draw with paintevent of QWidget(A)
        Over this child(A)

        I have some QLabel child of QWidget(A) i use paintevent in A to draw something, but it appers behind the QLabels... :(

        thx for help.

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by
        #3

        @Franckynos said in QPaintEvent over QLabel:

        I have some QLabel child of QWidget(A) i use paintevent in A to draw something, but it appers behind the QLabels... :(

        child widgets are always drawn above the parent widgets, due to their stacking order

        Why do you really need to draw over a child widget?

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        1

        • Login

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