Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Drawing lines between points entered on a mouse click.

    General and Desktop
    3
    3
    2591
    Loading More Posts
    • 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.
    • S
      shahd last edited by

      Hi,

      I’m working on a qt project. The user should input points to a screen on a mouse click. These points are braille dots, I want to translate these points to real characters. I'm thinking of a way to do that but I'm a beginner in qt and I need help.
      Braille dots are arranged in 2 columns and 3 rows I'm thinking of drawing lines between braille dots then a shape will be produced some dots will create a horizontal line, vertical line, angles, diagonal lines, rectangles and diagonal polygon. Can I do that in qt ? (how can I draw lines between points on a mouse click? how can I recognize each shape after drawing ?) and If I can what functions should I use.

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        "QGraphicsPathItem":http://doc.qt.io/qt-5/qgraphicspathitem.html comes to mind with "QPainterPath":http://doc.qt.io/qt-5/qpainterpath.html

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • A
          agabor last edited by

          Hi,

          You will need to create a custom widget for this. Subclass the QWidget class, and override the paintEvent method. Then you can paint whatever you want :)

          Read this:
          http://qt-project.org/doc/qt-4.8/qwidget.html#paintEvent

          1 Reply Last reply Reply Quote 0
          • First post
            Last post