Results 1 to 3 of 3

Thread: QsqlTableModel: how allow user to change font style and size of text

  1. #1
    Join Date
    Apr 2013
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QsqlTableModel: how allow user to change font style and size of text

    I'm picking up maintenance of an existing QT4 app, I have a request to allow the end user to adjust the font style/size of a popup table. The table is populated via an sql query, the "last" call I see is setQuery() and the thread disappears into the Qt ether! Based on my reading of other threads I may need to re-implement QsqlTableModel and implement some additional methods. Can I get recommendations on the easiest path?

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

    Default Re: QsqlTableModel: how allow user to change font style and size of text

    QIdentityProxyModel or QAbstractProxyModel (depending on exactly which Qt4 version) between the existing model and the view. Provide a version of data() that returns desired values for the Qt::FontRole (and perhaps others) and the default for everything else.

  3. The following user says thank you to ChrisW67 for this useful post:

    dtkerns (28th April 2013)

  4. #3
    Join Date
    Apr 2013
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QsqlTableModel: how allow user to change font style and size of text

    thanks for the info, hopefully I'll get back to this to try it out today, I'll be back with a "thanks" or more details!

Similar Threads

  1. Replies: 1
    Last Post: 30th March 2012, 17:46
  2. Font size of lcdnumber does not change
    By Niamita in forum Qt Programming
    Replies: 0
    Last Post: 27th January 2012, 08:55
  3. Widgets: Let the user change the size
    By Donner in forum Qt Programming
    Replies: 2
    Last Post: 14th November 2010, 21:13
  4. Change font in a text file
    By viciv919 in forum Newbie
    Replies: 1
    Last Post: 16th March 2010, 12:53
  5. change font size and button size of QMessageBox
    By nass in forum Qt Programming
    Replies: 6
    Last Post: 13th September 2006, 20:16

Tags for this Thread

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.