title: Qt font families and styles on Mac OS X
body: <p>I have a GUI application based on Qt (PyQt) running on Mac OS X (and other platforms). It allows the user to select fonts and has check boxes for bold and italic options.</p>
  
  <p>On updating to the new Cocoa-based Qt, a user found the <code>QFontComboBox</code> no longer displays the different font styles (e.g. condensed, oblique, bold...) and just displays the font family name. Under Carbon it showed both. The user also cannot enter the name with the style in the combo box. Furthermore, I cannot construct the same font passing the name into the <code>QFont</code> constructor.</p>
  
  <p><code>QFont</code> doesn't seem to know anything about these missing styles. Confusingly it has another different notion of style. It looks like <code>QFontDatabase</code> has the information about the style variants. It can also construct fonts based on a family, style and point size.</p>
  
  <p>So, are the following changes the correct approach?</p>
  
  <ol>
  <li><p>Rather than have bold and italic buttons, have a combobox filled with the styles from <code>QFontDatabase</code> for the font selected in the <code>QFontComboBox</code>.</p></li>
  <li><p>Store the style in saved documents (as text), rather than bold or italic.</p></li>
  </ol>
  
  <p>So</p>
  
  <ul>
  <li><p>Can I rely on the style being the same on systems with different languages? Can I include it in saved documents?</p></li>
  <li><p>Is a style "Bold Italic" as robust a way of making a <code>QFont</code> with the desired properties, than setting the bold and italic properties of that <code>QFont</code>?</p></li>
  <li><p>If I want to retain bold and italic checkboxes, how can I convert these attributes into the correct style? Can I just guess "Bold", "Italic" or "Bold Italic"?</p></li>
  </ul>