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. item's line width also zoomed after zoom QGraphicsView
Forum Updated to NodeBB v4.3 + New Features

item's line width also zoomed after zoom QGraphicsView

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 1.8k 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.
  • joeQJ Offline
    joeQJ Offline
    joeQ
    wrote on last edited by
    #1

    we all know, QGraphicsView, QGraphicsScene is good way to show graphics item.

    In Scene, i add some rect items with QGraphicsRectItem. i set the line width is 2..

    View has the matrix. i use the matrix to zoomin and zoomout.

    when i zoomed. i find the line width also zoomed when you see with your eyes. i don't want this result. i also know that set the line width 0, and the line width always is 1. this is line. but, if i fill rect.

    i want to set the line width or rect area always is fixed in screen when you to see it after zoom view.

    Thank u .Happy Valentine's Day

    Just do it!

    joeQJ 1 Reply Last reply
    0
    • joeQJ joeQ

      we all know, QGraphicsView, QGraphicsScene is good way to show graphics item.

      In Scene, i add some rect items with QGraphicsRectItem. i set the line width is 2..

      View has the matrix. i use the matrix to zoomin and zoomout.

      when i zoomed. i find the line width also zoomed when you see with your eyes. i don't want this result. i also know that set the line width 0, and the line width always is 1. this is line. but, if i fill rect.

      i want to set the line width or rect area always is fixed in screen when you to see it after zoom view.

      Thank u .Happy Valentine's Day

      joeQJ Offline
      joeQJ Offline
      joeQ
      wrote on last edited by joeQ
      #2

      @joeQ

      I think i saved it.

      The item also zoomed after view set matrix. because item is on the scene. the scene is not zoom.
      we just zoom the view when we see the scene from eyes. it just like you to read one book with
      magnifier. the line of character is also can be zoom.

      so, if you don't want to this. i think the better way is to zoom the scene content not the view,
      not use the matrix to zoom view.

      when you want to zoomin:

      1. get the sceneRect, and zoomin the sceneRect's width and height, reset it to scene;
      2. clear all the item in scene, because, you should resize them and readd them to scene;

      zoomout is same with zoomin;

      zoom the content not the view.

      That's all.


      last method was stupid.

      Please to see my another post. maybe good way

      Just do it!

      1 Reply Last reply
      0
      • K Offline
        K Offline
        KapitanPL
        wrote on last edited by
        #3

        To all who finds this as first google result.

        The answer to this question is

        QPen pen;
        pen.setCosmetic(true);

        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