I have an application that will be running on both a Mac and on Windows, and due to font size differences I've added the following code to override the default settings that come from developing on both OSs.

Qt Code:
  1. //***************************/
  2. //* Windows-only fonts... */
  3. //***************************/
  4. #ifdef Q_OS_WIN
  5. QFont newFont("Lucida Sans", 9, QFont::Normal, false);
  6. QApplication::setFont(newFont);
  7.  
  8. QFont newFont2("Lucida Sans", 8, QFont::Normal, false);
  9. ui->Calc1LB->setFont(newFont2);
  10. ui->Calc2LB->setFont(newFont2);
  11. #else
  12. //***********************/
  13. //* Mac-only fonts... */
  14. //***********************/
  15. QFont newFont("Lucida Grande", 12, QFont::Normal, false);
  16. QApplication::setFont(newFont);
  17.  
  18. QFont newFont2("Lucida Grande", 11, QFont::Normal, false);
  19. ui->Calc1LB->setFont(newFont2);
  20. ui->Calc2LB->setFont(newFont2);
  21. #endif
To copy to clipboard, switch view to plain text mode 

For Windows, this resetting works perfectly for *every* widget but for some reason only works for part of the widgets on my Mac, like line edits and tab headers, but not labels or pushbutton text. I have reset the default fonts just to make sure I hadn't missed any but if that was the case then it wouldn't work on Window.

I can resize the widgets if need be so that my text doesn't get truncated but I'd rather not do that.

Any suggestions? thanks!


-- Kodi