diff --git a/.emacs.d/modes.el b/.emacs.d/modes.el index ee4d6eda..77ea3622 100644 --- a/.emacs.d/modes.el +++ b/.emacs.d/modes.el @@ -642,3 +642,21 @@ properly escaped with double-quotes in case it has spaces." '(progn ;; Change .pdf association directly within the alist (setcdr (assoc "\\.pdf\\'" org-file-apps) "zathura --fork %s"))) + +;;============================================================================== +;; Qt semantic support +;;============================================================================== + +;; Qt base directory, meaning the directory where the 'Qt' directory can be found. +;; Adapt accordingly. +(setq qt4-base-dir "/usr/include/qt4") +(setq qt4-gui-dir (concat qt4-base-dir "/QtGui")) +(semantic-add-system-include qt4-base-dir 'c++-mode) +(semantic-add-system-include qt4-gui-dir 'c++-mode) +(add-to-list 'auto-mode-alist (cons qt4-base-dir 'c++-mode)) +(add-hook + 'c++-mode-hook + (lambda () + (add-to-list 'semantic-lex-c-preprocessor-symbol-file (concat qt4-base-dir "/Qt/qconfig.h")) + (add-to-list 'semantic-lex-c-preprocessor-symbol-file (concat qt4-base-dir "/Qt/qconfig-large.h")) + (add-to-list 'semantic-lex-c-preprocessor-symbol-file (concat qt4-base-dir "/Qt/qglobal.h")))) \ No newline at end of file