Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Draw vertical line at mouse position
Qt 6.12 LTS is out! See what's new in the release blog

Draw vertical line at mouse position

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 538 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.
  • M Offline
    M Offline
    marcelnitan
    wrote on last edited by
    #1

    How can I create a line at the mouse position when I press left click?

    I'm trying to figure out how does ponter.DrawLine works but I don't manage to do it and I'm getting a lot of shapes but not what I want.

    jsulmJ 1 Reply Last reply
    0
    • M marcelnitan

      How can I create a line at the mouse position when I press left click?

      I'm trying to figure out how does ponter.DrawLine works but I don't manage to do it and I'm getting a lot of shapes but not what I want.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @marcelnitan said in Draw vertical line at mouse position:

      ponter.DrawLine

      What is that?
      To paint on widgets subclass needed Qt widget class and overrid paintEvent and use https://doc.qt.io/qt-6/qpainter.html for painting. To draw a line use https://doc.qt.io/qt-6/qpainter.html#drawLine-2

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3

      • Login

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