Results 1 to 3 of 3

Thread: QTableView default font and header sizes changes from Qt5.9 to Qt5.12

  1. #1
    Join Date
    Feb 2020
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default QTableView default font and header sizes changes from Qt5.9 to Qt5.12

    Hi everybody!

    I have a problem with QTableWidget fonts. I recently chaged from Qt5.9 to Qt5.12 version. With Qt5.9, the font of the QTableWidget used in my dialogs seems smaller than in Qt5.12. Due this change, lots of dialogs of my program have been deconfigured. I need to find a general solution to solve this, because the configuration of each QTableWidget used in my program could be a very hard work.
    I attach some examples of tables. I can not modify the sizes of Dialogs to allow see the tables bigger. The only solution is reduce the font and header sizes, but preferently with a general solution. The same problem occours with QTreeWidget.

    Thanks in advance.
    Attached Images Attached Images
    Last edited by martakuki; 12th February 2020 at 13:35.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,590
    Thanks
    13
    Thanked 1,586 Times in 1,515 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QTableView default font and header sizes changes from Qt5.9 to Qt5.12

    You should be able to set a stylesheet at the application or top widget level. Perhaps something like:
    Qt Code:
    1. qApp->setStyleSheet("QTableView { font-family: \"Times New Roman\"; font-size: 9pt }");
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Feb 2020
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: QTableView default font and header sizes changes from Qt5.9 to Qt5.12

    Quote Originally Posted by ChrisW67 View Post
    You should be able to set a stylesheet at the application or top widget level. Perhaps something like:
    Qt Code:
    1. qApp->setStyleSheet("QTableView { font-family: \"Times New Roman\"; font-size: 9pt }");
    To copy to clipboard, switch view to plain text mode 
    Thank you!! It works!!

Similar Threads

  1. Globally reset my font sizes to default?
    By scott_hollen in forum Qt Programming
    Replies: 1
    Last Post: 2nd November 2011, 00:26
  2. Title with two different font sizes
    By aloehr in forum Qwt
    Replies: 0
    Last Post: 9th September 2011, 13:25
  3. Default menu sizes
    By KingOfHeart in forum Qt Programming
    Replies: 5
    Last Post: 18th May 2011, 01:10
  4. Font sizes
    By StevenB in forum Qt Programming
    Replies: 1
    Last Post: 5th October 2007, 11:10
  5. qt-config and font sizes
    By hvengel in forum Qt Programming
    Replies: 2
    Last Post: 10th April 2007, 01:31

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.