Author Topic: code plugin can't work when i wrok with Qt4.  (Read 4656 times)

Offline linuxping

  • Single posting newcomer
  • *
  • Posts: 3
code plugin can't work when i wrok with Qt4.
« on: October 08, 2008, 05:55:31 pm »
I work with Qt4.
C::B's Codecompletion plugin cann't works!

if I type 'Q', C::B will give some tips.eg. QT_OBJECT,QString,QChar,and so on.  that is good. but C::B can't.

I guess it must change some settings in C::B. but I not find.

help.

Offline RT200

  • Single posting newcomer
  • *
  • Posts: 5
Re: code plugin can't work when i wrok with Qt4.
« Reply #1 on: October 12, 2008, 10:29:42 am »
It is work fine, but you must adjust it.

Since Code::Blocks allows the usage of custom variables around the project, let's use them. If you install a new Qt version you only have to change one thing and the changes will take effect all around Code::Blocks. Navigate to Settings->Global Variables... and insert a new variable naming it as you wish (mine is "qt"), also add a field named "include". The field "base" should point to your current top level Qt installation dir and "include" to dir where include files of Qt is located.

Add the Qt header folders to the parser paths (you need code completion don't you?): Project->Properties->C/C++ parser options and add the following: $(#qt.include) $(#qt.include)/QtCore $(#qt.include)/QtGui You will have to close and reopen the project for the changes to take effect. When you reopen the project try out the code completion of Qt classes.

P.S. Some parts of this manual were taken from QtWorkbench plugin's docs ;)
P.P.S And this topic should be moved to "Using Code::Blocks" board.
« Last Edit: October 12, 2008, 02:33:08 pm by RT200 »

Offline linuxping

  • Single posting newcomer
  • *
  • Posts: 3
Re: code plugin can't work when i wrok with Qt4.
« Reply #2 on: October 13, 2008, 02:33:58 pm »
thanks a lot.