10

フォント ファイルのパスとその拡張子 ("arial.ttf" など) を取得したいと考えています。

QFont :: rawname () メソッドは常に「不明」を返します

フォントの名前と拡張子を取得する別の方法はありますか?

使用するコードは次のとおりです。

    bool ok = true;
    QFont font = QFontDialog::getFont(&ok, this);
    if(ok)
    {
    QString fontpath = "/Library/Fonts/" + font.family()+".ttf";//Using font file path in the application
    }
4

2 に答える 2