Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Reformulated: labels and buttons don't inherit font properties on Mac
Forum Updated to NodeBB v4.3 + New Features

Reformulated: labels and buttons don't inherit font properties on Mac

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 2.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    floatingWoods
    wrote on last edited by
    #1

    Hello,

    While porting my Windows application to Mac, I notices an inconsistent behaviour:

    While I can change the font size on Windows for my whole application with

    qApplication->setFont(newFont);

    this doesn't work for label and button widgets on Mac (but works fine for checkboxes for instance). I am wondering if this might be a bug or a feature?

    I of course made sure that all widgets have default parameters for the font in their properties.

    Thanks!

    1 Reply Last reply
    0
    • F Offline
      F Offline
      floatingWoods
      wrote on last edited by
      #2

      If anyone is interested:

      I solved my problem with following line of code:
      @
      qApplication->setStyleSheet("QPushButton { font: 10px} QLabel { font: 10px} QLineEdit { font: 10px} QCheckBox { font: 10px} QGroupBox { font: 10px} QComboBox { font: 10px} QListWidget { font: 10px} QRadioButton { font: 10px}");
      @
      (Globally setting the font size ( qApplication->setFont(newFont) )would not affect all the widget types on Mac)

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved