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. Qwidget, centering and scaling set of lines

Qwidget, centering and scaling set of lines

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

    Hi everybody, i am trying to create an object able to draw a set of lines.. The main problem is that lines may be very small ( e.g. QLineF(5.209959,3.572545,5.339645,3.531778)), then i want to scale them so that even if they are short they fill the image. I've tried with setWindow() and setViewPort() but i only obtained blank images.. So, assuming to have 4 variables containing the maximum and minimum X and Y calculated on all the lines, which is the magical method that solve my problem?

    Thank in advance,
    pamelona_69

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Sounds like you need to look into using QGraphicsView instead of QWidget.

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pamelona_69
        wrote on last edited by
        #3

        thanks.. i hoped for a not so destructive solution but ok, let's try this way..

        [quote author="Andre" date="1323542595"]Sounds like you need to look into using QGraphicsView instead of QWidget. [/quote]

        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