Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7432683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:29:48+00:00 2026-05-29T09:29:48+00:00

QPolygonF has methods to union, intersect, and subtract with other QPolygonFs but I need

  • 0

QPolygonF has methods to union, intersect, and subtract with other QPolygonFs but I need to perform an intersection test with a QLineF. This appears to be missing from the API.

I suppose I could do something like this:

if (polygon .containsPoint (line .p1 ()) != polygon .containsPoint (line .p2 ())
    return true;

QPointF a = polygon .back ();
foreach (QPointF b, polygon)
{
    if (QLineF :: BoundedIntersection == line .intersect (QPointF (a, b))
       return true;
    a = b;
}

return false;

There are probably some numerical or edge-case surprises lurking in the above, so I’d rather not.

Is there a provided method somewhere in the Qt API that I can’t see?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:29:50+00:00Added an answer on May 29, 2026 at 9:29 am

    Unfortunately, the answer is “no”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is probably something very obvious, but I have a new to Qt and
This question has been edited: I am working with QML. I have a custom
Having MyClass : QPolygonF I would like to create void bin_write(QDataStream & out )
I'm drawing polygons using the Graphics View framework. I added a polygon to the
I tend to have a class to describe a general concept and subclasses to
I am trying to check collisions between a QPolygon and a QRect by turning
I have a class inheriting from QGraphicsLineItem and as soon as I override the
I am using QPolygon class. Is there any method which gives the edges of
I'm trying to animate a polyline (it have to act like a wave). I've
HI all, The following code: self.painter = QtGui.QPainter(self) self.painter.setRenderHint(QPainter.Antialiasing) self.painter.translate(482,395) self.painter.scale(300,300) self.painter.save() needle =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.