Results 1 to 4 of 4

Thread: QFontMetrics not giving proper dimension

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11
    Thanks
    37
    Thanked 53 Times in 40 Posts

    Question QFontMetrics not giving proper dimension

    Hello,
    My problem is that QFontMetrics is not returning proper widths and heights of text in my program. I verified this by printing all text info of word "hello" in sample separate program and main program too.
    The sample works properly and it was manually compiled with g++ while the other doesn't.

    While in the sample , the info read
    Family=Sans Serif, Point Size = 11, Width of hello = 33
    the info from my original app read
    Family=Sans Serif, Point Size = 11, Width of hello = 24

    And also, though I have commented *.setFont() , resize() and other geometry functions ,i still get same problem described above.
    Because of this, my app looks very ugly with truncations and variations in font sizes in all used Qt widgets .

    Is there any chance that the ordering of libs being linked is causing trouble ?

    I tried all programs described above with Qt 4.1, and 2 snapshots of QT 4.2 on my linux system. (g++ 4.0.2)

    Actually i had posted my problem in more vague form before in this thread http://www.qtcentre.org/forum/f-qt-p...ides-3874.html
    Later i really tried hard to figure out the problem and noticed that it was all to do with QFontMetrics.

    Please do help me solve this problem.
    Thanks in advance.
    Last edited by Gopala Krishna; 6th October 2006 at 16:16. Reason: Forgot to add an impt info

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.