[SOLVED] Why QString no need to include?



  • I can use it without include header file.
    Why I can't use main header instead sub header file? Ex. B inherited from A Why I can't just include A?
    Just curius, hope this not wrong place to ask again lol.

    Thanks.


  • Lifetime Qt Champion

    Hi,

    Your question isn't really clear. But if I understood it correctly: when creating a class B from A and you want to use it somewhere else you must include B's header because A's header will not provide anything for B.

    As for QString, it's a class that's used throughout all of Qt so its header is included frequently in other Qt classes headers.



  • Oh! I see now and I feel like I'm a stupid. lol
    It's just a basic logic.

    Thanks.
    [quote author="SGaist" date="1377802706"]Hi,

    Your question isn't really clear. But if I understood it correctly: when creating a class B from A and you want to use it somewhere else you must include B's header because A's header will not provide anything for B.

    As for QString, it's a class that's used throughout all of Qt so its header is included frequently in other Qt classes headers.
    [/quote]


  • Lifetime Qt Champion

    You're welcome !

    If this answers your question, please update the thread title to solved so other forum users may know :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.