Qt autocomplete in deep nested structs



  • Hello,

    I really like how in Qt Creator the autocomplete window opens to show which
    attributes are available. In this way I can easily select the correction function,
    variable, enumerate or class.

    I've seen that this stops at a certain depth of the data structure. In example when
    using PCL. I can ask the x-coordinate of a point using:
    @cloud->point[10].x@

    Now the autocompletion helps with all steps.

    But when I place this cloud in another struct or container, the '.x' part won't show
    anymore.

    Does anybody know how to solve this?



  • It may happen if header file for an intermediate member is not included.
    Or you may found a bug in QtCreator.

    Could you post simple example that reproduce the problem.

    For example this code works for me. Each dot triggered an autocomplete.
    @
    struct ExternalCloud
    {
    struct Cloud
    {
    QVector<QWidget> widgets;
    };
    Cloud m_cloud;
    };

    MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    {
    ExternalCloud extCloud;
    extCloud.m_cloud.widgets[1].childAt(10, 10)->cursor().pos().isNull();
    }
    @



  • Thanks for checking it with that example.

    In your example it stops at widgets[1 ]. If I type a dot it doesn't give any autocomplete. I have the same when using a std::vector< >.

    I have Qt Creator 3.1.2, Qt 5.3.1 on Windows 8.1 with msvc2013 x64.



  • It stops on std::vector for me too if I use QtCreator built-in C++ model.
    It works if I use Clang C++ model.

    You can select a C++ Code model in "Options/C++/Code Model"
    But I don't know if Clang model is available on Windows.

    I suggest to open a bug report "Qt Bug Tracker":https://bugreports.qt-project.org/



  • Hi, the Clang model is available. I have tried it before this question on the forum and just tested it again. But it doesn't work.

    Thanks for you help. I will open a bug report.


Log in to reply
 

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