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

Refactoring: "include header file" includes wrong file and can be repeated

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • Qt Creator 3.3.0-beta1
    • Qt Creator 2.8.0-rc
    • C/C++/Obj-C++ Support
    • None
    • Windows 7, 64bit, Qt 4.8.4

      I want to use the nice refactoring tool: "include Header File" while typing my source.

      classa.h
      #ifndef CLASSA_H
      #define CLASSA_H
      
      class ClassA
         {
         public:
            ClassA();
         };
      
      #endif // CLASSA_H
      
      classa.cpp
      #include "classa.h"
      
      ClassA::ClassA()
         {
         QVector<double> d;
         }
      

      When pressing ALT+Enter with my curser in QVector in classa.cpp nothing is offered.

      When adding the forward declaration

      class QVector;
      

      in the header file, ATL+Enter offers: "include Header File".

      But it includes <qvector.h> instead of <QVector>.

      And I can repeat "include Header File" to add again a <qvector.h>.

      Resulting in:

      classa.h
      #ifndef CLASSA_H
      #define CLASSA_H
      
      class QVector;
      
      class ClassA
         {
         public:
            ClassA();
         };
      
      #endif // CLASSA_H
      
      classa.cpp
      #include "classa.h"
      
      #include <qvector.h>
      #include <qvector.h>
      
      ClassA::ClassA()
         {
         QVector<double> d;
         }
      

      This should be more nice.

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

            kosjar Nikolai Kosjar
            moellney Michael Möllney
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: