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. QtCreator: IntelliSense
QtWS25 Last Chance

QtCreator: IntelliSense

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 1.8k 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.
  • A Offline
    A Offline
    amigo421
    wrote on last edited by
    #1

    Hi

    in addition to C++ development, I'm using QtC to edit some C-like scripts.
    these are completely like C code just use not all advanced language features
    and also have a built-in API.
    So, the question is :
    e.g. I'm writing a script like

    @void main() {
    print("bla-bla-bla");
    Table* t;
    t = DB_ExecSql("select * from table where ...");
    DB_ShowTable(t);
    DB_DestroyTable(t);
    }@

    looks like a usual C code,
    and QtC highlights the syntax and builds the structure of variables, functions etc

    however this script uses a lot of functions built into script engine, e.g. DB_ExecSql above.
    I have a header file with prototypes of all these functions but can't add the include at the beginning of the source file like:
    #include "api.h"
    in this case the script won't work correctly. seems like a script engine does this inclusion by itself before execution.

    Is there way , in QtC , to use a headers included into the project but not included into source, to use a definitions from there for parameters tips , navigation etc?
    In Eclipse, was enough to add the headers to project and C parser in IDE used all available prototypes to perform syntax checking

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andrep
      wrote on last edited by
      #2

      In the main toolbar of an editor there's a button labeled with a hash mark ("#"). If you click that, you get a texteditor where you can enter extra code that won't be compiled, but interpreted as normal additional C(++) code for this file, including interpretation of preprocessor directive. You should be able to use that to tweak the code model's view of the world to your liking.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        amigo421
        wrote on last edited by
        #3

        thank you for the idea
        however looks it doesn't work for me

        if I'm adding the line
        #include "my_api.h"
        to file directly it works fine - all types and functions are highlighted and intellisense also works fine with tips for parameters
        but if I'm moving this line to the box of additional preprocessing code
        nothing works

        I suppose that way works for compile time only, right?
        and doens't affect code model at edit time?

        or i'm doing something wrong...

        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