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. [SOLVED] Why QString no need to include?
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Why QString no need to include?

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

    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.

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

      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.

      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
      • A Offline
        A Offline
        Arendell
        wrote on last edited by
        #3

        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]

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

          You're welcome !

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

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