Help getting semantic to work with qt5
"tenspd137 ." <[email protected]> Wed, 16 Dec 2015 00:15:09 -0700
| Newsgroups | gmane.emacs.semantic |
|---|---|
| Message-ID | <CAB=m8wJDLhLG0JwmmZ-qeiYzZXr8Xdqo+UyL5CAEfdQAbeL+vA@mail.gmail.com> |
Hi all -
I can't seem to get semantic to parse qt5 classes.
In my setup, I have
;; CEDET
;; use external CEDET because bundled currently excludes
;; cedet-m3-minor-mode
(setq cedet-root-path (file-name-as-directory "~/projects/cedet/"))
(load-file (concat cedet-root-path "cedet-devel-load.el"))
(add-to-list 'load-path (concat cedet-root-path "contrib"))
(require 'cc-mode)
(require 'semantic)
(require 'eassist)
(require 'semantic/ia)
(require 'semantic/bovine/gcc)
;; submodes to enable
(add-to-list 'semantic-default-submodes 'global-semantic-mru-bookmark-mode)
(add-to-list 'semantic-default-submodes 'global-semanticdb-minor-mode)
(add-to-list 'semantic-default-submodes 'global-semantic-idle-scheduler-mode)
(add-to-list 'semantic-default-submodes 'global-cedet-m3-minor-mode)
(add-to-list 'semantic-default-submodes 'global-semantic-stickyfunc-mode)
(add-to-list 'semantic-default-submodes 'global-semantic-highlight-func-mode)
(add-to-list 'semantic-default-submodes 'global-semanticdb-minor-mode)
;; activate semantic
(semantic-mode 1)
...
;; mode customization
(defun dayd/cedet-hook()
(local-set-key [(control return)] 'semantic-ia-complete-symbol-menu)
(local-set-key "\C-c?" 'semantic-ia-complete-symbol)
;;
(local-set-key "\C-c>" 'semantic-complete-analyze-inline)
(local-set-key "\C-c=" 'semantic-decoration-include-visit)
(local-set-key "\C-cj" 'semantic-ia-fast-jump)
(local-set-key "\C-cq" 'semantic-ia-show-doc)
(local-set-key "\C-cs" 'semantic-ia-show-summary)
(local-set-key "\C-cp" 'semantic-analyze-proto-impl-toggle)
)
(add-hook 'c-mode-common-hook 'dayd/cedet-hook)
(add-hook 'lisp-mode-hook 'dayd/cedet-hook)
(add-hook 'emacs-lisp-mode-hook 'dayd/cedet-hook)
(setq QtDir "/usr/include/qt5/")
;; EDE
(global-ede-mode 1)
(ede-enable-generic-projects)
(ede-cpp-root-project "QtXPS"
:name "QtXPS File Viewer"
:file "~/projects/Qt5/QtXPS/README"
:include-path '("/")
)
(semantic-add-system-include (concat QtDir "/QtConcurrent") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtCore") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtDBus") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtGui") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtLocation") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtNetwork") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtOpenGL") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtPlatformSupport") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtPrintSupport") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtQml") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtQmlDevTools") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtQuick") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtQuickParticles") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtQuickTest") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtSensors") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtSql") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtTest") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtWebKit") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtWebKitWidgets") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtWidgets") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtXml") 'c++-mode)
(semantic-add-system-include (concat QtDir "/QtXmlPatterns") 'c++-mode)
(I have also tried adding to the project system include path using:
;;Qt5 Setup
(defun gather-qt-header-dirs()
(let ((qtf (directory-files "/usr/include/qt5")))
(mapcar (lambda (framework) (concat "/usr/include/qt5/" framework)) qtf)))
)
Anyway, when I have this in my main file:
#include <QtGui/QGuiApplication>
#include "MainWindow.hpp"
int main(int argc, char* argv[])
{
QGuiApplication app(argc, argv);
app.
}
and try to do completion on the app object, it tells me it can't find
types, but it works on the types I have defined in my project.
As I have asked in other posts before, can anyone help me figure out
what I am doing wrong? I have been trying all sorts of different
things I have found using google, and nothing seems to work.
Thanks!
------------------------------------------------------------------------------