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

QFontDatabase::removeApplicationFont does not remove font on linux

    XMLWordPrintable

Details

    Description

      QFontDatabase::removeApplicationFont returns true which means it's removed. But after that we can see font is still in database. Works fine on Windows.

      Simple test application:

      main.cpp
      #include <QApplication>
      #include <QFontDatabase>
      #include <QDebug>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          int  fontIndex = QFontDatabase::addApplicationFont("Alperton.otf");
          qDebug() << "fontIndex:" << fontIndex;
          if(QFontDatabase::removeApplicationFont(fontIndex))
              qDebug() << "Font successfully removed";
      
          QFontDatabase db;
          foreach (const QString &family, db.families()) {
              if(family.compare("Alperton") == 0 )
                  qDebug() << family << "is still in database!";
          }
          return a.exec();
      }
      

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes