Closed oracleyue closed 9 years ago
Updates:
I have found the QT_GUI_EXPORT
is defined in QCore/qglobal.h
. Then I included this header when I included <QApplication>
. Now its completion for class members works well.
Could you update it such that it automatically deals with such Qt keywords (macros)? Or, how can I set QCore/qglobal.h
in .emacs for "emacs-clang-complete-async", such that I don't need to include QCore/qglobal.h
every time in the source files when some keyboards used in class declarations?
And I also found that it only list the members and member functions defined for the class, without members and member functions inherited from the parent class. Probably it is difficult to handle such completions?
It works in the following case (adding QtCore/qglobal.h
header ):
#include <qt4/QtCore/qglobal.h>
#include <qt4/QtGui/QApplication>
#include <qt4/QtGui/QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello, Qt!");
label->show();
return app.exec();
}
It works for std c/c++ library, boost, Eigen, etc., except QT, even for the simplest Qt code. It shows the information of the class, but it fails to show the members or member functions when
.
or->
,::
inserted. Not work even I have added all qt library pathes inac-clang-flags
. (Actually, for boost as an example, I don't need to add specific path/usr/include/boost
intoac-clang-flags
, it still works well.)For instance, when I declear
QApplication app(argc, argv);
and cursor at the end character ofQApplication
, hit auto-complete trigger key, a list of complete shows asQApplication
andQApplicationPrivate
. It works well. However, when I wrote "app.", there is no completion list showing.I think it is due to Qt keywords, like
QT_GUI_EXPORT
in the class declaration in header files. For example,class Q_GUI_EXPORT QApplication : public QCoreApplication
, which is incorrent in C++ grammer if without processing macros ofQ_GUI_EXPORT
. Because in the included heder file"QApplication" (qapplication.h)
, there is no macro forQT_GUI_EXPORT
. Please check it.Thank you very much!