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 a clean line by QGraphicsScene
Forum Updated to NodeBB v4.3 + New Features

Drawing a clean line by QGraphicsScene

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 467 Views 1 Watching
  • 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
    mfaghani
    wrote on last edited by mfaghani
    #1

    Hi there,
    I'm using QGraphicsScene.addLine() to draw some gradient lines. But the drawn lines are not so clear and do not have a flat outline, as the middle one in the picture below, looks like stairs.
    0_1541460138543_1.png
    While the ideal shape for my usage should be something like picture below.
    0_1541460559970_2.png

    K 1 Reply Last reply
    0
    • M mfaghani

      Hi there,
      I'm using QGraphicsScene.addLine() to draw some gradient lines. But the drawn lines are not so clear and do not have a flat outline, as the middle one in the picture below, looks like stairs.
      0_1541460138543_1.png
      While the ideal shape for my usage should be something like picture below.
      0_1541460559970_2.png

      K Offline
      K Offline
      kenchan
      wrote on last edited by
      #2

      @mfaghani
      make its QGraphicsView use antialiasing.
      view.setRenderHints(QPainter::Antialiasing);
      as described here

      M 1 Reply Last reply
      3
      • K kenchan

        @mfaghani
        make its QGraphicsView use antialiasing.
        view.setRenderHints(QPainter::Antialiasing);
        as described here

        M Offline
        M Offline
        mfaghani
        wrote on last edited by
        #3

        @kenchan
        I'm impressed with your answer. I just add that line and it's working very well.
        Thank you very much.

        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