Results 1 to 6 of 6

Thread: QGraphicsView widget, QGraphicsScene. Default 0.0.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 14 Times in 14 Posts

    Default Re: QGraphicsView widget, QGraphicsScene. Default 0.0.

    You can use QGraphicsScene::setSceneRect(QRectF),. It will set logical coordinates you want.

    Ex : if your scene geomerty is 0,0, width , height
    I think what you can do is :
    Qt Code:
    1. scene->setSceneRect(0, heigh, width, -height);
    To copy to clipboard, switch view to plain text mode 
    Last edited by prasad_N; 4th January 2016 at 05:40.
    Thanks :-)

  2. #2
    Join Date
    Dec 2015
    Posts
    12
    Qt products
    PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicsView widget, QGraphicsScene. Default 0.0.

    Thank you for reply.
    I tried, not working.

    self.ui.graphicsView.scene = QtWidgets.QGraphicsScene()
    self.ui.graphicsView.setScene(self.ui.graphicsView .scene)
    self.ui.graphicsView.scene.setSceneRect(0, 650, 500, -650)
    self.ui.graphicsView.setRenderHints(QPainter.Antia liasing)
    path = QPainterPath()
    path.moveTo(20.0, 20.0)
    path.lineTo(50, 20)
    path.moveTo(20.0, 20.0)
    path.lineTo(20, 50)
    self.ui.graphicsView.scene.addPath(path)
    5.png

  3. #3
    Join Date
    Dec 2015
    Posts
    12
    Qt products
    PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicsView widget, QGraphicsScene. Default 0.0.

    No more ways to do this?

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: QGraphicsView widget, QGraphicsScene. Default 0.0.

    You could try a transformation.

    Translate to the bottom left point and scale with 1/-1

    Cheers,
    _

  5. #5
    Join Date
    Dec 2015
    Posts
    12
    Qt products
    PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicsView widget, QGraphicsScene. Default 0.0.

    Do you have example how to do this?

Similar Threads

  1. QGraphicsscene and QGraphicsview
    By ReasyEasyPeasy in forum Qt Programming
    Replies: 3
    Last Post: 6th October 2015, 15:58
  2. Changing Default QRubberBand in QGraphicsView
    By MSUdom5 in forum Qt Programming
    Replies: 1
    Last Post: 24th May 2013, 19:37
  3. QGraphicsView and QGraphicsScene
    By alisami in forum Qt Programming
    Replies: 8
    Last Post: 4th December 2008, 10:10
  4. QGraphicsScene and QGraphicsView
    By sabeesh in forum Qt Programming
    Replies: 7
    Last Post: 1st August 2007, 06:59
  5. QGraphicsScene and QGraphicsView
    By rossd in forum Qt Programming
    Replies: 2
    Last Post: 25th April 2007, 14:43

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.