Results 1 to 3 of 3

Thread: How to place a QGraphicsPixmapItem in Pyqt mainwindow?

  1. #1
    Join Date
    Jan 2020
    Posts
    1
    Qt products
    Platforms
    Unix/X11

    Default How to place a QGraphicsPixmapItem in Pyqt mainwindow?

    Hi i am trying to place a QGraphicsPixmapItem to a Position of x y in a GraphicsScene. I had used this command

    "self.item.setPos(QtCore.QPointF(20,50))" its not working.


    is there any way to move the QGraphics Item as Qlabel support label.move(x,y)

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to place a QGraphicsPixmapItem in Pyqt mainwindow?

    "self.item.setPos(QtCore.QPointF(20,50))" its not working
    And what isn't working? It is in the wrong position? It doesn't appear at all? What are the dimensions of your QGraphicsScene? Of your QGraphicsView? Is the QGraphicsPixmapItem a top-level item in the scene, or is it a child of another QGraphicsItem?
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to place a QGraphicsPixmapItem in Pyqt mainwindow?

    is there any way to move the QGraphics Item as Qlabel support label.move(x,y)
    Yes. QGraphicsItem::setPos()

Similar Threads

  1. Replies: 4
    Last Post: 11th February 2018, 18:47
  2. Replies: 0
    Last Post: 29th January 2015, 11:55
  3. Replies: 0
    Last Post: 6th November 2011, 10:22
  4. Replies: 1
    Last Post: 12th April 2011, 10:53
  5. Replies: 10
    Last Post: 29th May 2010, 19:42

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.