Results 1 to 2 of 2

Thread: Looking for ideas for QLineF objects

  1. #1
    Join Date
    May 2007
    Qt products
    Unix/X11 Windows

    Lightbulb Looking for ideas for QLineF objects

    hi everyone,

    i am currently working on a line segmentation project. i already have a working framework that segments all lines of an image and passes the detected lines to the GUI.
    the lines are stored as QLineF objects in a QList and drawn on a QWidget using QPainter. furthermore it is possible to select a line by pressing and moving the mouse over it. this is performed by drawing a QRubberband and test for an intersection between every line in the QList and the diagonals of the selected rubber band. additional, i have to implement a test whether a line's start or end point is within the selection because otherwise it would be possible that a line is in the selection but does not intersect with the diagonals (directly, not unbounded intersection).

    this is what i have got so far:

    my problems:
    1. everything works fine for my test example, but what about an image containing 500 lines? if the user makes a selection, there will be 2 test if either the start or end point of any of the lines is within the selection and 2 test if one of the diagonals intersects with any of the lines. resulting in 1000 intersection test and 1000 point test...
      is there a better way to do this (without dividing the image in regions) ?
    2. isn't it possible to highlight a line whenever the mouse is hovered over it?
    3. after selecting a line it should be possible to auto-select (simply show or highlight) any other line within the picture that has:
      • nearly the same length +/- x -> easy (x = user's choice)
      • nearly the same direction with a variation of max. y degree -> i see quite a problem here because i haven't found anything useful in the documentation (y = user's choice)
    4. after selecting two lines, i want to compute and show the 2 pairs of angles in the widget(only for bounded intersection). the user should now be able to choose and select one of the four angels by clicking on it (i wonder how i' m going to realize that...). On top of that, i would like to show any other angle in the GUI with almost the same amplitude, again user's choice. any ideas how to realize this in an efficient way?

    right now i'm looking for any ideas or improvements. a discussion is also welcome, thanks in advance for any answer in this thread

  2. #2
    Join Date
    Jan 2006
    Warsaw, Poland
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits

    Default Re: Looking for ideas for QLineF objects

    I suggest you use QGraphicsView instead of a plain widget. It has many features you can use (including rubberband selection, hovering, etc.).


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.