Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-11445

Code completion not working properly on mac + cmake

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: Qt Creator 3.0.1
    • Fix Version/s: Qt Creator 3.1.0-beta
    • Component/s: C/C++/Obj-C++ Support
    • Labels:
      None
    • Environment:
      mac osx 10.9
      clang 5.0.0
      cmake 2.8.12.2 (via homebrew)
    • Commits:
      c4ef72dd399bda662b5127b3d3733a0c8c79f054

      Description

      Code completion does not work properly if cmake project is used. The qmake project works correctly, but cmake version miss a few items. And the problem seems to happend on mac + cmake only, the windows version works correctly (mingw).

      Here is the short examples:

      CMakeLists.txt
      cmake_minimum_required(VERSION 2.8.11)
      
      if(APPLE)
          set(CMAKE_MACOSX_BUNDLE ON)
      endif()
      
      project(test)
      
      set(CMAKE_AUTOMOC ON)
      set(CMAKE_INCLUDE_CURRENT_DIR ON)
      
      find_package(Qt5Core REQUIRED)
      
      add_executable(test test.cpp)
      
      target_link_libraries(test Qt5::Core)
      
      test.cpp
      #include <QString>
      #include <QFile>
      #include <QDateTime>
      #include <QtCore/QThreadPool>
      
      struct Test
      {
          QThreadPool pool;
      };
      
      int main()
      {
          QString v;
          // v.toUtf8() is not in the completion popup
      
          QFile f;
          // f.write is not in the completion popup
      
          // QDateTime::currentMSecsSinceEpoch() is not in the completion popup
      
          Test t;
          // t.pool. has no popup
      
          return 0;
      }
      

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            erikv Erik Verbruggen
            Reporter:
            steve.k.chiu Steve K. Chiu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes