Results 1 to 4 of 4

Thread: QFontMetrics not giving proper dimension

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: QFontMetrics not giving proper dimension

    Quote Originally Posted by Gopala Krishna View Post
    Can you enlighten me why this happens ?
    Qt uses some 3rd party libraries to handle fonts and they might require some initialization and this usually happens when you create Q(Core)?Application instance.

    Quote Originally Posted by Gopala Krishna View Post
    What other classes in qt can cause problems when declared static (or global too) ?
    I would suspect these classes and methods:
    • QCoreApplication::application*Path()
    • QApplication::desktop()
    • QApplication::palette()
    • QFont
    • QFontDatabase
    • QLibraryInfo
    • QWidget
    • QX11Info

    There was also some problem with QObject, but AFAIR it was resolved.

    The best way is to avoid global variables and to initialize static variables after the main was invoked.

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

    Gopala Krishna (7th October 2006)

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.