Results 1 to 2 of 2

Thread: Unable to get QSvgGenerator to write to a device

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2017
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Unable to get QSvgGenerator to write to a device

    I am trying to get the output of QSvgGenerator into a string for use in-line in HTML. I can use the .setFileName(...) method, and get output as a file, but .setOutputDevice(&qbuffer) doesn't add anything to the qbuffer (and I can use qbuffer.write(...); to write strings into the buffer before and after the scene.render( &painter ); rendering operation gets called on the QSvgGenerator.

    I've attached a complete stand-alone command-line app (.cpp, .h and .pro) to demonstrate the problem, though I'm experiencing this in a full GUI app. Running this application with no arguments should dump an SVG containing a rectangle to the console. Running the application with an argument writes the SVG file to the first argument (this works).
    Attached Files Attached Files

Similar Threads

  1. Replies: 1
    Last Post: 24th October 2016, 21:15
  2. Unable to write in QTextEdit
    By dikku in forum Newbie
    Replies: 4
    Last Post: 30th December 2015, 08:53
  3. Replies: 5
    Last Post: 17th April 2015, 07:09
  4. Circular reference ... Unable to write forwarding
    By tonnot in forum General Programming
    Replies: 6
    Last Post: 27th June 2011, 11:26
  5. Unable to write to file QFile
    By cuter in forum Qt Programming
    Replies: 4
    Last Post: 15th July 2009, 11:19

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.