Results 1 to 2 of 2

Thread: Displaying a SVG file.

  1. #1
    Join Date
    Oct 2010
    Posts
    54
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Question Displaying a SVG file.

    Hi all, I have a svg file and was wondering how to output it to my form. Can i use the graphicsview widget and then use:

    Qt Code:
    1. ui->graphicsview-> // something here
    To copy to clipboard, switch view to plain text mode 
    to display it to the screen.

    Thanks for your time and trouble

  2. #2
    Join Date
    Oct 2010
    Posts
    55
    Thanks
    1
    Thanked 11 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    9

    Default Re: Displaying a SVG file.

    I guess it would look something like:

    Qt Code:
    1. ui->setupUi(this);
    2. QGraphicsScene *scene = new QGraphicsScene(this);
    3. ui->graphicsView->setScene(scene);
    4. QGraphicsSvgItem *item = new QGraphicsSvgItem("<path to svg file>");
    5. scene->addItem(item);
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Displaying a eml file in a widget
    By merry in forum Qt Programming
    Replies: 2
    Last Post: 29th August 2013, 17:36
  2. Replies: 0
    Last Post: 30th November 2010, 08:51
  3. Replies: 1
    Last Post: 28th July 2009, 06:58
  4. Replies: 3
    Last Post: 25th May 2007, 07:49
  5. GUI not displaying
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 22nd February 2007, 21:28

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.