Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-83284

Make all functions in QFontDatabase static

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • P2: Important
    • 6.0
    • 6.0
    • GUI: Font handling
    • None
    • All
    • 76068d0114157c6b59523f3fb032cd8de64e9a63 (qt/qtbase/dev)

    Description

      QFontDatabase API is a mix of static functions and non-static functions which act in a static way (they access a mutex-locked singleton object). This leads to code like:

      QFontDatabase::addApplicationFont("MyFont.ttf");
      QStringList styles = QFontDatabase().styles("MyFont");
      

      Since the database is a singleton, there does not seem to be any practical reason why some functions are not static. In Qt 6, we should try to make them all static for consistency. This shouldn't affect source compatibility as long as we don't make it impossible to create empty objects of the class.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            esabraha Eskil Abrahamsen Blomfeldt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes