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. QGraphicsScene setSelectionArea Qt::ContainsItemShape
Forum Updated to NodeBB v4.3 + New Features

QGraphicsScene setSelectionArea Qt::ContainsItemShape

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.2k 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.
  • T Offline
    T Offline
    Talei
    wrote on last edited by
    #1

    Hello,
    I want to add irregular selection mechanism to my application.
    Unfortunately passing QPainterPath with path containing only moveTo and lineTo don't select object that are enclosed inside shape that is created by such line (using select with Qt::ContainsItemShape). Adding to that QPainterPath polygon (path.addPolygon(path.toPoylgon()) and setting selection to Qt::IntersectsItemShape results with lines that are outside of selected area so it's not good option also but it do select items. If QPainterPath contains i.e. rectange that is larger then rectangle that I want to select also select object.

    Question:
    How would I go about implementing selection of irregular shape? Or how to convert QPainterPath that do contains moveTo and lineTo to something that can be used with QGraphicsScene setSelectionArea.

    Also I think that tessellation of polygon with conjunction with IntersectsItemShape would solve the problem.

    Example of what I wand to achieve:
    Creating QPainterPath of shape that is on below image "doted" should select 2 rectangles:
    !http://www.pixentral.com/pics/1voHLnAJt5RoyjSFmSFkPVdG2XFwiw.jpg(link)!

    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