Results 1 to 3 of 3

Thread: page.drawText alignment

  1. #1
    Join Date
    Mar 2015
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default page.drawText alignment

    In a QScript module this works
    Qt Code:
    1. page. drawText ( ps. x + fr.col_offset, y, fr.col_width, h, CReportPage.AlignLeft | CReportPage.AlignVCenter, fr.txttoprint );
    To copy to clipboard, switch view to plain text mode 
    However I need to be able to build the alignment requirement sperately, much simplified
    Qt Code:
    1. fr.valign = CReportPage.AlignVCenter;
    2. fr.halign = CReportPage.Alignleft;
    3. page. drawText ( ps. x + fr.col_offset, y, fr.col_width, h, fr.valign | fr.halign, fr.txttoprint );
    To copy to clipboard, switch view to plain text mode 
    and this doesn't work.

    Please can someone advise how I can get it to work.

    Many Thanks

    Allan

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: page.drawText alignment

    Have you checked if the two values are different?

    E.g. make a qDebug() log output in the C++ function that implements drawText()?

    Cheerss
    _

  3. #3
    Join Date
    Mar 2015
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: page.drawText alignment

    Thanks for that offering. I dont have access to the QT project source - just the QScript module, debugging is proving to be a pain.

    Allam


    Added after 38 minutes:


    I fixed it.
    Qt Code:
    1. page. drawText ( ps. x + fr.col_offset, y, fr.col_width, h, parseInt(fr.valign | fr.halign), fr.txttoprint );
    To copy to clipboard, switch view to plain text mode 
    did the job
    Last edited by tsrplatelayer; 8th March 2015 at 15:24.

Similar Threads

  1. Replies: 2
    Last Post: 12th December 2011, 22:29
  2. Load a simple Page after the Main Page.
    By mrhevor in forum Qt Quick
    Replies: 1
    Last Post: 27th September 2011, 11:32
  3. How can I support page up/page down on QTextEdit
    By wesley in forum Qt Programming
    Replies: 7
    Last Post: 14th September 2010, 20:18
  4. QTabWidget remove a page at the page's request
    By thomaspu in forum Qt Programming
    Replies: 2
    Last Post: 29th December 2007, 21:45
  5. DrawText ?
    By whitefurrows in forum Qt Programming
    Replies: 2
    Last Post: 14th February 2007, 22:08

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.