Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Creator auto-complete doesn't recommend anything from the files that haven't been included
Forum Updated to NodeBB v4.3 + New Features

Qt Creator auto-complete doesn't recommend anything from the files that haven't been included

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
qt creator
5 Posts 2 Posters 1.9k Views 3 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hello world,

    it would be really helpful if Qt Creator could recommend items e.g. classes from headers that haven't been included. I'm working on a code base (Assimp) that I haven't worked with before, and not having this kind of feature slows me down quite a bit.

    Let's say I'm creating a new class and I want to have a reference to an instance of BaseProcess class. In NetBeans I'd start writing Base and then press Ctrl+Space. NetBeans then recommends BaseImporter and BaseProcess. I select BaseProcess and then NetBeans includes the correct header. When I try to do the same in Qt Creator, it doesn't give any recommendations.

    I'd like to have this feature in Qt Creator too. I tried Qt Creator 4.0 RC, but couldn't find an option to enable such feature. The project is CMake-based. I tried

    Thanks in advance

    kshegunovK 1 Reply Last reply
    0
    • ? A Former User

      Hello world,

      it would be really helpful if Qt Creator could recommend items e.g. classes from headers that haven't been included. I'm working on a code base (Assimp) that I haven't worked with before, and not having this kind of feature slows me down quite a bit.

      Let's say I'm creating a new class and I want to have a reference to an instance of BaseProcess class. In NetBeans I'd start writing Base and then press Ctrl+Space. NetBeans then recommends BaseImporter and BaseProcess. I select BaseProcess and then NetBeans includes the correct header. When I try to do the same in Qt Creator, it doesn't give any recommendations.

      I'd like to have this feature in Qt Creator too. I tried Qt Creator 4.0 RC, but couldn't find an option to enable such feature. The project is CMake-based. I tried

      Thanks in advance

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      @William-Linna

      Hello,
      Forgive my bluntness, but this doesn't make much sense. You can't call methods of forward declared/undeclared classes anyway. Creator will parse the headers when included, so autocomplete should work as expected in that case.

      Kind regards.

      Read and abide by the Qt Code of Conduct

      ? 1 Reply Last reply
      0
      • kshegunovK kshegunov

        @William-Linna

        Hello,
        Forgive my bluntness, but this doesn't make much sense. You can't call methods of forward declared/undeclared classes anyway. Creator will parse the headers when included, so autocomplete should work as expected in that case.

        Kind regards.

        ? Offline
        ? Offline
        A Former User
        wrote on last edited by A Former User
        #3

        @kshegunov Hello

        I don't think you were blunt, though I think you might have misunderstood the idea.

        I didn't mention anything about autocompleting methods of an instance of a forward declared / undeclared class. I meant that I'd like autocompletion to be able to recommend items e.g. classes from the headers that haven't been included (yet).

        kshegunovK 1 Reply Last reply
        0
        • ? A Former User

          @kshegunov Hello

          I don't think you were blunt, though I think you might have misunderstood the idea.

          I didn't mention anything about autocompleting methods of an instance of a forward declared / undeclared class. I meant that I'd like autocompletion to be able to recommend items e.g. classes from the headers that haven't been included (yet).

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by kshegunov
          #4

          @William-Linna
          Hello,

          I think you might have misunderstood the idea

          No, I got the idea. I was just pointing out that for a code to compile, the class you're using should be at least forward declared, and this is how Qt Creator does it. So the IDE can't really know until it sees a class, method, w/e in the headers/sources (i.e. they're at least forward declared) what might exist in other places, simply because it doesn't index things you're not using. It will, however, index the file names (or dirs) that are passed through INCLUDEPATH in the project files, so you can at least get autocompletion for #includes.
          I don't know of any way of forcing QtCreator to index files that are not in the source tree (or parse headers that are not included), but I'm certainly not a last authority on the subject.

          If you believe this is a good thing to have you could file a feature request on the bugtracker, or perhaps raise the point on the interest mailing list where developers of Qt modules could actually see it (this forum is mostly a user community).

          Kind regards.

          PS.
          You can log in the bugtracker with your forum credentials.

          Read and abide by the Qt Code of Conduct

          ? 1 Reply Last reply
          0
          • kshegunovK kshegunov

            @William-Linna
            Hello,

            I think you might have misunderstood the idea

            No, I got the idea. I was just pointing out that for a code to compile, the class you're using should be at least forward declared, and this is how Qt Creator does it. So the IDE can't really know until it sees a class, method, w/e in the headers/sources (i.e. they're at least forward declared) what might exist in other places, simply because it doesn't index things you're not using. It will, however, index the file names (or dirs) that are passed through INCLUDEPATH in the project files, so you can at least get autocompletion for #includes.
            I don't know of any way of forcing QtCreator to index files that are not in the source tree (or parse headers that are not included), but I'm certainly not a last authority on the subject.

            If you believe this is a good thing to have you could file a feature request on the bugtracker, or perhaps raise the point on the interest mailing list where developers of Qt modules could actually see it (this forum is mostly a user community).

            Kind regards.

            PS.
            You can log in the bugtracker with your forum credentials.

            ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            @kshegunov Hello,

            thanks for your answer again.

            Note that in my example, BaseProcess is used in many other places, just not yet in the file I was working on. Thus, it sees it already. Also, the files are configured in CMake and can be seen in Project-view.

            Thank you for the link. I will do a feature request on the bugtracker at some point.

            Best regards,
            William

            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