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. What might be causing the errors reported here?
Qt 6.11 is out! See what's new in the release blog

What might be causing the errors reported here?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 732 Views
  • 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.
  • C Offline
    C Offline
    Carlos Delfino
    wrote on last edited by
    #1

    I was making some adjustments, in another subproject, when I suddenly noticed that the subproject that involves UI development started to crash without me even messing with anything in it.

    I created a new project from scratch to check if there was any relationship with my project settings, and even the new project also has the same error:

    teste.h:12:5: error: incomplete result type 'QString' in function definition
    qobjectdefs.h:182:5: note: expanded from macro 'Q_OBJECT'
    qobjectdefs.h:140:27: note: expanded from macro 'QT_TR_FUNCTIONS'
    qglobal.h:768:7: note: forward declaration of 'QString'
    
    teste.h:12:5: error: calling 'tr' with incomplete return type 'QString'
    qobjectdefs.h:182:5: note: expanded from macro 'Q_OBJECT'
    qobjectdefs.h:141:35: note: expanded from macro 'QT_TR_FUNCTIONS'
    qobjectdefs.h:348:13: note: 'tr' declared here
    qglobal.h:768:7: note: forward declaration of 'QString'
    
    teste.h:12:5: error: incomplete result type 'QString' in function definition
    qobjectdefs.h:182:5: note: expanded from macro 'Q_OBJECT'
    qobjectdefs.h:142:41: note: expanded from macro 'QT_TR_FUNCTIONS'
    qglobal.h:768:7: note: forward declaration of 'QString'
    
    teste.h:12:5: error: incomplete result type 'QString' in function definition
    qobjectdefs.h:182:5: note: expanded from macro 'Q_OBJECT'
    qobjectdefs.h:142:41: note: expanded from macro 'QT_TR_FUNCTIONS'
    qglobal.h:768:7: note: forward declaration of 'QString'
    
    teste.h:12:5: error: calling 'tr' with incomplete return type 'QString'
    qobjectdefs.h:182:5: note: expanded from macro 'Q_OBJECT'
    qobjectdefs.h:143:35: note: expanded from macro 'QT_TR_FUNCTIONS'
    qobjectdefs.h:348:13: note: 'tr' declared here
    qglobal.h:768:7: note: forward declaration of 'QString'
    

    How to fix such problem?

    JonBJ 1 Reply Last reply
    0
    • C Carlos Delfino

      I was making some adjustments, in another subproject, when I suddenly noticed that the subproject that involves UI development started to crash without me even messing with anything in it.

      I created a new project from scratch to check if there was any relationship with my project settings, and even the new project also has the same error:

      teste.h:12:5: error: incomplete result type 'QString' in function definition
      qobjectdefs.h:182:5: note: expanded from macro 'Q_OBJECT'
      qobjectdefs.h:140:27: note: expanded from macro 'QT_TR_FUNCTIONS'
      qglobal.h:768:7: note: forward declaration of 'QString'
      
      teste.h:12:5: error: calling 'tr' with incomplete return type 'QString'
      qobjectdefs.h:182:5: note: expanded from macro 'Q_OBJECT'
      qobjectdefs.h:141:35: note: expanded from macro 'QT_TR_FUNCTIONS'
      qobjectdefs.h:348:13: note: 'tr' declared here
      qglobal.h:768:7: note: forward declaration of 'QString'
      
      teste.h:12:5: error: incomplete result type 'QString' in function definition
      qobjectdefs.h:182:5: note: expanded from macro 'Q_OBJECT'
      qobjectdefs.h:142:41: note: expanded from macro 'QT_TR_FUNCTIONS'
      qglobal.h:768:7: note: forward declaration of 'QString'
      
      teste.h:12:5: error: incomplete result type 'QString' in function definition
      qobjectdefs.h:182:5: note: expanded from macro 'Q_OBJECT'
      qobjectdefs.h:142:41: note: expanded from macro 'QT_TR_FUNCTIONS'
      qglobal.h:768:7: note: forward declaration of 'QString'
      
      teste.h:12:5: error: calling 'tr' with incomplete return type 'QString'
      qobjectdefs.h:182:5: note: expanded from macro 'Q_OBJECT'
      qobjectdefs.h:143:35: note: expanded from macro 'QT_TR_FUNCTIONS'
      qobjectdefs.h:348:13: note: 'tr' declared here
      qglobal.h:768:7: note: forward declaration of 'QString'
      

      How to fix such problem?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Carlos-Delfino said in What might be causing the errors reported here?:

      teste.h:12:5: error: incomplete result type 'QString' in function definition

      Show at least up to line #12 of teste.h where this error comes from. We should see what lines precede it. I believe teste.h is your own file, not Qt's? We also need to see where you include teste.h into your .cpp/.hfile, again to see the lines which precede it. Looks like you have included <QString> where it's needed.

      1 Reply Last reply
      0
      • JoeCFDJ Offline
        JoeCFDJ Offline
        JoeCFD
        wrote on last edited by
        #3

        add
        #include <QString>
        in test.h

        1 Reply Last reply
        1

        • Login

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