Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt autocomplete in deep nested structs
Forum Updated to NodeBB v4.3 + New Features

Qt autocomplete in deep nested structs

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.4k 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.
  • D Offline
    D Offline
    Deepfreeze
    wrote on last edited by
    #1

    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?

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

      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();
      }
      @

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Deepfreeze
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andreyc
          wrote on last edited by
          #4

          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/

          1 Reply Last reply
          0
          • D Offline
            D Offline
            Deepfreeze
            wrote on last edited by
            #5

            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.

            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