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. Code completion and static code analysis gets things wrong
Qt 6.11 is out! See what's new in the release blog

Code completion and static code analysis gets things wrong

Scheduled Pinned Locked Moved Qt Creator and other tools
1 Posts 1 Posters 684 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.
  • H Offline
    H Offline
    halfgaar
    wrote on last edited by
    #1

    I have some issues with the static code analysis of Qt Creator not always showing me the correct data, and when I press F2 (follow symbol), I end up at the wrong place.

    For example, I have this code:

    @template<typename T> T GetMax(int a, int b)
    {
    T result;
    result = (a>b)? a : b;
    return (result);
    }

    template<typename T> T GetMax(int a, int b, int c)
    {
    T result;
    result = (a>b)? a : b;
    return (result);

    }

    int main()
    {
    int a = GetMax<int>(3, 4);
    cout << a;

    return 0;
    

    }@

    The on-mouse-over popup on the call to GetMax shows the second function signature. In fact, it always shows the last one (if I switch them around, it shows the proper one). The F2 (follow symbol) feature jumps to the wrong function as well.

    I did find "this bug":https://bugreports.qt-project.org/browse/QTCREATORBUG-10295. Is that the same problem?

    (edit: actually, it doesn't autocomplete the template functions, I can see now). -Also, the code completer don't always show the function signature of all functions. I'm working with the ODB framework now, and when I call "db->", -only some methods show the function signature on selecting it. I haven't been able to figure out the pattern to when it does, and when it doesn't. Is this possibly related to the above problem?-

    I'm using QtCreator 2.8.1, using a non Qt project.

    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