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. QGraphicsWidget is always drawn over the QGraphicsLineItem irrespective of the z order
Forum Updated to NodeBB v4.3 + New Features

QGraphicsWidget is always drawn over the QGraphicsLineItem irrespective of the z order

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 658 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.
  • sanojsubranS Offline
    sanojsubranS Offline
    sanojsubran
    wrote on last edited by sanojsubran
    #1

    I have a graphics scene which contains a QGraphicsWidget and a QGraphicsLineItem. The
    issue I am facing is that the QGraphicsWidget is getting drawn over the QGraphicsLineItem
    whenever I move the pointer over the QGraphicsWidget, whereas I want the QGraphicsLineItem to
    be on top always in the scene, without being affected by the repaint of QGraphicsWidget.

    I have tried the setZValue() api, but it is not of showing any effect

    These are the elements in the scene with details,

    Scene----------> QGraphicsWidget ----> QGraphicsLinearLayout-----> Array of layout items
    |
    |
    --------> QGraphicsLineItem

    Any help will be much appreciated...

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Asperamanca
      wrote on last edited by
      #2

      Can you show some code? For example, what kind of QGraphicsWidget are we talking about? What does it paint?

      1 Reply Last reply
      0
      • sanojsubranS Offline
        sanojsubranS Offline
        sanojsubran
        wrote on last edited by
        #3

        Hi,

        I was able to fix the issue. The issue was due to the incorrect bounding rect given for the line item.

        Thanks,
        San

        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