Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QFont error
Qt 6.12 LTS is out! See what's new in the release blog

QFont error

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 2.5k 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.
  • NevezN Offline
    NevezN Offline
    Nevez
    wrote on last edited by
    #1

    I have a tableview in which I import data model from database. (I have my own data model class that I subclass QSqlQuery.)
    If I call this model with 5 rows with a query, it does not give a warning message.
    However, if I call more than 5 records, it gives the following warning. So why ? I don't do anything with QFont.

    model->setQuery(select * from users LIMIT 5 )   // no warning
    
    model->setQuery(select * from users LIMIT 10) // warning..
    
    
    

    its gives:
    QFont::fromString: Invalid description '(empty)'

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Can you share the implementation of your custom model ?
      Are you using the number 5 somewhere ?
      Do you get empty values with your query limited to ten results ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • NevezN Offline
        NevezN Offline
        Nevez
        wrote on last edited by
        #3

        @SGaist said in QFont error:

        Do you get empty values with your query limited to ten results ?

        Yes, you are right. This warning has disappeared for now when I fill null cells in the DB.
        Thank you so much

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Good !

          Then please mark the thread as solved using the "Topic Tools" button or the three dotted menu beside the answer you deem correct so that other forum users may know a solution has been found.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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
          • Unsolved