Hi guys,
i want to show multi languages(English, HEBREW, Thai, ARABIC, Chinese) as a selection list,
i find something about insert substitution
void QFont::insertSubstitution ( const QString & familyName, const QString & substituteName )
and
void QFont::insertSubstitutions ( const QString & familyName, const QStringList & substituteNames )
but failed , below is my code of loading fonts
first , i'm using the debug message to show the support family, i don't know if this is a proper way to find the support font,
please correct me if it's a wrong solution
Qt Code:
  1. /* output the support font */
  2. qDebug() << qfd.families(QFontDatabase::Hebrew);
  3. qDebug() << qfd.families(QFontDatabase::Arabic);
  4. qDebug() << qfd.families(QFontDatabase::Thai);
  5. qDebug() << qfd.families(QFontDatabase::TraditionalChinese);
To copy to clipboard, switch view to plain text mode 
after get the debug message , i'm using tool "makeqpf" to create qpf2 files such as
wenquanyi_micro_hei(for chinese), sans_serif(for HEBREW, ARABIC), waree(for Thai)
and i need to load all of them to show the correct words, but failed

In this way, i can show the chinese, english, hebrew, arabic but not thai,
Qt Code:
  1. QFont font1("WenQuanYi Micro Hei [prerendered]",14,50,FALSE);
  2. subs << "DejaVu Sans [prerendered]" << "Waree" ;
  3. font1.insertSubstitutions("WenQuanYi Micro Hei [prerendered]", subs);
  4. qApp->setFont(font1);
  5.  
  6. qDebug() << font1.family() ;
  7. QStringList sl = font1.substitutions() ;
  8. qDebug() << sl.isEmpty() ;
  9. qDebug() << sl ;
  10. qDebug() << font1.substitutes("WenQuanYi Micro Hei [prerendered]") ;
To copy to clipboard, switch view to plain text mode 

and i just make another test to change the font family
Qt Code:
  1. QFont font1("DejaVu Sans [prerendered]",14,50,FALSE);
  2. subs << "WenQuanYi Micro Hei [prerendered]" << "Waree" ;
  3. font1.insertSubstitutions("DejaVu Sans [prerendered]", subs);
  4. qApp->setFont(font1);
To copy to clipboard, switch view to plain text mode 
if i insert "DejaVu Sans" first, when i open the multi language page,
the program crashed, i guess it's because the program can't show chinese and crashed,
i just can't figure it out why this happened ,
in my eyes , that two ways above was almost the same, can anyone explain for me?

and the final goal is to show all the language at the same time
so i need load waree and show it correctly, please help
thanks