Results 1 to 2 of 2

Thread: How to set the location of an item in a scene

  1. #1
    Join Date
    May 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to set the location of an item in a scene

    Hello, I have the following code:

    Qt Code:
    1. void MainWindow::on_actionTest_triggered()
    2. {
    3. QImage image("test.JPG");
    4. item = new QGraphicsPixmapItem(QPixmap::fromImage(image));
    5. scene->addItem(item);
    6. ui->graphicsView->setScene(scene);
    7.  
    8. }
    To copy to clipboard, switch view to plain text mode 

    I have no idea how I can set the location for the image.
    Any suggestions would be appreciated.

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to set the location of an item in a scene

    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Replies: 2
    Last Post: 19th October 2010, 07:33
  2. QGraphicsView/Scene/Item Questions
    By SixDegrees in forum Qt Programming
    Replies: 0
    Last Post: 26th August 2010, 00:41
  3. Adding item to scene
    By lni in forum Qt Programming
    Replies: 0
    Last Post: 21st April 2009, 18:28
  4. View, Scene, Item and thread??
    By dungsivn in forum Qt Programming
    Replies: 5
    Last Post: 20th August 2008, 20:21
  5. how to zoom out item in View/Scene
    By nileshsince1980 in forum Qt Programming
    Replies: 7
    Last Post: 28th December 2007, 11:24

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