Need help with Qt Creator flaky autocomplete with Pointer issue



  • I have a function that has the following code:
    @NodeShape* shape = new NodeShape()@

    If I attempt to us a function in the freshly created shape, say like this:

    @shape->setName("box");@

    Qt Creators auto complete refuses to suggest the functions available in NodeShape. However, if I do this:

    @NodeShape* shape = NULL;
    shape = new Nodeshape();@

    The auto complete now works! Whats going on here?

    I did a little more poking around. If I do this:

    @NodeShape* shape = new NodeShape;@

    it works as well. I guess those brackets are part of the problem!


  • Lifetime Qt Champion

    Hi,

    Sounds like a bug, you should take a look at the "bug report system":http://bugreports.qt-project.org to see if it's something known


  • Moderators

    Hi,

    [quote author="kloveridge" date="1411505347"]I have a function that has the following code:
    @NodeShape* shape = new NodeShape()@
    [/quote]

    Did you put a semicolon at the end of that line?



  • Yes. My little code snippet above didn't reflect that. But it is in my code.

    This has turned out to be no-biggie. I just won't put parathesis in a new call if I know the object doesn't have any arguments.


Log in to reply
 

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