Results 1 to 4 of 4

Thread: [SOLVED] QTextDocument setHtml and HTML Tags/Properties "align=center" problems

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: QTextDocument setHtml and HTML Tags/Properties "align=center" problems

    I can confirm that this code does the right thing under Linux with Qt 5.2.0.

    With MSVC 2010 Qt 5.1.1 the program does the right thing with the "Microsoft XPS Writer" virtual printer.
    Ditto for MingW and Qt5.1.1.
    I do not have Qt 5.2.0 on this machine or a "real" printer attached. I used A4 paper size (otherwise exactly your code).

    Have you tried using "Microsoft XPS Writer" as your printer to eliminate a printer driver curiosity?
    Have you tried an earlier Qt version to eliminate a Qt 5.2-ism?

    BTW: Thank you for taking the time to ask a smart question.

  2. The following user says thank you to ChrisW67 for this useful post:

    jjones11 (20th February 2014)

  3. #2
    Join Date
    Feb 2014
    Posts
    4
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    1

    Default Re: QTextDocument setHtml and HTML Tags/Properties "align=center" problems

    Thank you ChrisW for your informative response. As per your recommendation, I tried printing to Microsoft XPS Writer and got the same left-aligned header instead of being centered. I also tried printing to a second/different printer and got the same result.

    It is interesting that it works fine on your Linux platform. Hopefully, someone with a MSVC 2010/Qt5.2.0 development environment will respond.

    I will try the MingW Kit (that's a good idea) and if that doesn't reveal anything, then I will take your recommendation and bite off an earlier Qt 5.1.1. version.

    Thanks again.
    jjones

  4. #3
    Join Date
    Feb 2014
    Posts
    4
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    1

    Default Re: QTextDocument setHtml and HTML Tags/Properties "align=center" problems

    Thank you ChrisW for the ideas. I tried the MingW Kit and got the same results.

    I upgraded to Qt 5.2.1 (couldn't find 5.1.1) and now it works correctly... and I didn't have to change a thing!

    This problem is a big fat SOLVED! I am greatly relieved.

    Thanks again.
    jjones

    P.S. I don't see a way to add "SOLVED" to the Title because apparently I can't edit the original post. If some Admin would please...
    Last edited by jjones11; 20th February 2014 at 15:19. Reason: Added P.S.

Similar Threads

  1. QTextDocument table wont align
    By asweetroxxi in forum Qt Programming
    Replies: 1
    Last Post: 5th December 2012, 14:57
  2. QTextDocument and HTML tags
    By naga in forum Qt Programming
    Replies: 2
    Last Post: 13th December 2011, 11:22
  3. Replies: 2
    Last Post: 23rd February 2010, 07:52
  4. Matching HTML tags
    By pucara_faa in forum Qt Programming
    Replies: 4
    Last Post: 22nd January 2010, 13:19
  5. How to align list items to the center?
    By zgulser in forum Qt Tools
    Replies: 4
    Last Post: 9th February 2009, 09:52

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
  •  
Qt is a trademark of The Qt Company.