Results 1 to 3 of 3

Thread: How can i set the layout of a page to be Landscape in an ODF document?

  1. #1
    Join Date
    Dec 2012
    Posts
    3
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default How can i set the layout of a page to be Landscape in an ODF document?

    Hello everyone,

    I'm trying to figure it out how to set the layout of an ODF doc to landscape instead of portrait, and until now no results.

    Does anyone has any clue on this?

    Regards,

    Coss_cat

    CODE of cpp file(the .h contains all necessary; the code compiles well):
    Qt Code:
    1. m_document = new QTextDocument();
    2. QSizeF size;
    3. size.setHeight(225);
    4. size.setWidth(300);
    5. m_document->setPageSize(size);
    6.  
    7. // Cursor for traversing the document
    8. m_cursor = QTextCursor(m_document);
    9. //use the cursor to write things
    10.  
    11. //blah blah blah
    12.  
    13. QTextDocumentWriter writer;
    14. writer.setFormat("odt");
    15. writer.setFileName(docfilename.toAscii());
    16. writer.write(m_document);
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Oct 2017
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How can i set the layout of a page to be Landscape in an ODF document?

    Hi,
    I wish to know if you have found a way, I am currently trying to do the same thing but I can't manage.

  3. #3
    Join Date
    Oct 2017
    Posts
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: How can i set the layout of a page to be Landscape in an ODF document?

    You can use QPdfWriter or QPrinter to handle pagelayout or orientation.

Similar Threads

  1. Gui management for my device with landscape screen
    By Charvi in forum Qt Programming
    Replies: 0
    Last Post: 28th August 2012, 07:37
  2. Portrait to Landscape
    By raghavendraningoji in forum Newbie
    Replies: 1
    Last Post: 18th August 2011, 13:57
  3. landscape to portrait
    By Kunjal Garach in forum Newbie
    Replies: 3
    Last Post: 16th May 2010, 23:53
  4. Replies: 5
    Last Post: 18th January 2008, 19:52

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.