Qt World Summit: Submit your Presentation

Field '_var' has incomplete type

  • Hello, I got I library inwich I have another class as a QPointer
    QPointer<Other_Class> _var;

    I use this somewhere else, and it works fine.
    Then I created another class,
    Lib_Class * _libClass;
    and suddenly it wont work with the message:
    field '_var' has incomplete type.

    I don not use forward declarations or structs here (most of web searches complain about structs or forwarddeclarations)
    I dont know what else to do??

    I appreciate any help and thnx in advance


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Did you check your includes in order to use Other_Class ?

  • @SGaist Oh man exactly they forgot to include the
    #include <QPointer>

    Thnx for that help!