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. QtCreator: Use clang code model for refactoring
QtWS25 Last Chance

QtCreator: Use clang code model for refactoring

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
qtcreatorclangcode modelrefactor
1 Posts 1 Posters 1.3k Views
  • 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.
  • A Offline
    A Offline
    a.samii
    wrote on 6 Feb 2016, 18:15 last edited by
    #1

    In qtcreator, is there a way to use clang code model for code refactoring? For example in the following minimal example, I want to change the variable CarData::year to CarData::year1 using the qtcreator refactor so that all_car_data[0].year in the main function also changes to all_car_data[0].year1. But since, std::vector is not recognized by the internal code model of qtcreator, it cannot apply this automatic change as well.

    #include <iostream>
    #include <memory>
    #include <vector>
    
    using namespace std;
    
    struct CarData
    {
      CarData() : year(0), month(0) {}
      CarData(unsigned year_, unsigned month_)
       : year(year_), month(month_) {}
      unsigned year;
      unsigned month;
    };
    
    int main(int argc, char *argv[])
    {
      vector<CarData> all_car_data;
      all_car_data.push_back(CarData(2010, 1));
      std::cout << all_car_data[0].year;
      return 0;
    }
    

    So, does clang code model also supports refactoring?

    1 Reply Last reply
    0

    1/1

    6 Feb 2016, 18:15

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved