Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Chinese
  4. QT自定义QGraphicsItem和QGraphicsScene中鼠标点击事件mousePressEvent问题
Forum Updated to NodeBB v4.3 + New Features

QT自定义QGraphicsItem和QGraphicsScene中鼠标点击事件mousePressEvent问题

Scheduled Pinned Locked Moved Unsolved Chinese
1 Posts 1 Posters 466 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.
  • 5 Offline
    5 Offline
    522333
    wrote on last edited by
    #1

    在我自己重载的scene和view中,自定义了一个item,继承于QGraphicsItem,当我在scene中重载mousePressEvent事件后,遍历鼠标点击位置的所有item,找不到我这个自定义的item,但是我在这个scene的items里能找到这个自定义的item,目前检查了:1.这个自定义的item的Z值是最大的,大于其他的item;2.这个自定义项的大小正常,可以被鼠标点击到;3.这个自定义的item的位置在我鼠标点击的位置下;4.自定义item的鼠标事件开启;5.其他的自定义item正常

    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