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. Drawing lines between points entered on a mouse click.
QtWS25 Last Chance

Drawing lines between points entered on a mouse click.

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

    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      0
      • A Offline
        A Offline
        agabor
        wrote on last edited by
        #3

        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
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved