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. QGraphicsView scaling
Qt 6.11 is out! See what's new in the release blog

QGraphicsView scaling

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 1.2k Views 4 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.
  • J Offline
    J Offline
    jonesabr
    wrote on last edited by
    #1

    I'm developing an application with QGraphicsView and QGraphicsScene. My problem is that when I scale my drawing, increasing its size, the lines get thicker and ticker, that is, it is being scaled as a raster, not vectorial. Is there a way to change that behavior? I'd like the lines kept it's original width.

    raven-worxR 1 Reply Last reply
    0
    • J jonesabr

      I'm developing an application with QGraphicsView and QGraphicsScene. My problem is that when I scale my drawing, increasing its size, the lines get thicker and ticker, that is, it is being scaled as a raster, not vectorial. Is there a way to change that behavior? I'd like the lines kept it's original width.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @jonesabr said in QGraphicsView scaling:

      My problem is that when I scale my drawing, increasing its size, the lines get thicker and ticker, that is, it is being scaled as a raster, not vectorial. Is there a way to change that behavior?

      going a bit more into detail would help a lot.
      What kind of drawing? How they are drawn?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jonesabr
        wrote on last edited by
        #3

        It's a geographic mapping application. I Instantiate QGraphicsEllipseItem, QGraphicsLineItem, etc. and call QGraphicsScene::addItem(QGraphicsItem *item). That's enough, they get drawn.

        Thank you

        raven-worxR 1 Reply Last reply
        0
        • J jonesabr

          It's a geographic mapping application. I Instantiate QGraphicsEllipseItem, QGraphicsLineItem, etc. and call QGraphicsScene::addItem(QGraphicsItem *item). That's enough, they get drawn.

          Thank you

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by raven-worx
          #4

          @jonesabr
          for me it's still no clear what your issue is.

          Maybe the desired behavior you want to achieve can be accomplished with a cosmetic pen?

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          J 1 Reply Last reply
          2
          • A Offline
            A Offline
            Asperamanca
            wrote on last edited by
            #5

            Since Qt5, Pens are non-cosmetic by default (for performance reasons, I believe). That means, their thickness gets scaled just as everything else.
            If you want lines that stay constant in width, use setCosmetic(true) on the pens.
            A word of warning: Anything but a width of 0 or 1 causes a huge performance hit on those.

            1 Reply Last reply
            2
            • raven-worxR raven-worx

              @jonesabr
              for me it's still no clear what your issue is.

              Maybe the desired behavior you want to achieve can be accomplished with a cosmetic pen?

              J Offline
              J Offline
              jonesabr
              wrote on last edited by
              #6

              @raven-worx Yes, you killed it. That's is the solution.
              Thank you once more

              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