November 23, 2010

HeartJ HeartJ
Lab Rat
9 posts

How to develop a “QtCreator plugin”

 

Hi, I installed the QtCreator 2.0.93 and I saw there was a new choose called “Qt Creator plugin”.

And I found that I can add a new button called “Hello World” in the list which includes “Welcome, Edit, Design, Debug, Projects, Help” lied left in QtCreator. I added it through choosing “Help-about plugins-Hello world”.

Who can tell me how to develop this plugin. And I know FakeVim is also a plugin for QtCreator. I just want to do it.

Please show me some tutorials or some posts.

Thx very much!

11 replies

November 23, 2010

Denis Kormalev Denis Kormalev
Lab Rat
1654 posts

There is some manual here [vcreatelogic.com] (go to Other downloads section and you will find it). But it is a bit outdated. All in all it will help you to find out what source files of creator you should look into to receive answers you will need during plugin development.

November 23, 2010

Tobias Hunger Tobias Hunger
Robot Herder
3387 posts

Check src/plugins in the Qt Creator sources. Almost all the functionality is implemented as a plugin! Just pick some existing functionality that is close to what you want to do and get started:-)

Feel free to stop by in our IRC channel (#qt-creator on freenode.net) if you have questions.

PS: The guide by vcreatelogic is somewhat outdated and in places just plain wrong. Better check the docs found in the Qt Creator sources, we do ship an (also somewhat outdated) guide there, too. We will of course accept merge requests that help us improve the guide:-)

November 24, 2010

HeartJ HeartJ
Lab Rat
9 posts

Thx Denis and Tobias.

December 30, 2010

HeartJ HeartJ
Lab Rat
9 posts

I found there was a new option “Qt Creator plugin” project in QtCreator2.1-rc. But I cann’t build any “Qt Creator plugin” project, such as a project made by the wizard.

And it shows “cann’t find -lAggregation”

So who can show me how I should do.

I download the source “qt-creator-2.1.0-rc1-src” and “qt-creator-win-opensource-2.1.0-rc1.exe”. My OS is windows xp.

The following are my steps(use ):
1. select to create a “Qt Creator plugin” project
2. choose the folder of “qt-creator-2.1.0-rc1-src” for “QtCreator source” and choose the folder of “qtcreator-2.0.94”(where I installed “qt-creator-win-opensource-2.1.0-rc1.exe”) for “QtCreator build”
3. Build the project
And it failed.

(Sorry for my bad english)

December 30, 2010

Vass Vass
Ant Farmer
743 posts

HeartJ,
Try add in your pro file

  1. LIBS += -L$$QTC_BUILD_TREE/lib/qtcreator/

 Signature 


Vasiliy

December 31, 2010

HeartJ HeartJ
Lab Rat
9 posts
Vass wrote:
HeartJ, Try add in your pro file @LIBS += -L$$QTC_BUILD_TREE/lib/qtcreator/ @

I tried as your said, but it doesn’t work.

December 31, 2010

HeartJ HeartJ
Lab Rat
9 posts

My environments are :
1.My OS is windows xp.
2.I installed “qt-win-opensource-4.7.1-mingw.exe”.
3.I also installed “qt-creator-win-opensource-2.1.0-rc1.exe” and the path is “D:\Qt\qtcreator-2.0.94”.
4.I downloaded the source package “qt-creator-2.1.0-rc1-src.tar.gz” and extracted it into “D:\qt-creator-2.1.0-rc1-src”.

Beacuse my new “Qt Creator plugin” project failed as I said above, so I downloaded “todo plugin” for try. I made changes in pro file as the INSTALL file said : 1. Download QtCreator sources. 2. Build QtCreator from sources or download and install binary. 3. Change todoplugin.pro, You need QTC_BUILD_DIR set to your path to qtcreator binary and set QTC_SOURCE_DIR your path to qtcreator source.

I set “D:\Qt\qtcreator-2.0.94” for QTC_BUILD_DIR and “D:\qt-creator-2.1.0-rc1-src” for QTC_SOURCE_DIR. Is there anything wrong?

Build after these using QtCreator(qtcreator-2.0.94), and it showed “cannot find -lAggregation” in Build Issues. In compile output, it showed “d:/qt/qtcreator-2.0.94/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -lAggregation collect2: ld returned 1 exit status mingw32-make1: *** [..\..\Qt\qtcreator-2.0.94\lib\qtcreator\plugins\vsorokin\todo.dll] Error 1 mingw32-make: *** [release] Error 2”

I really wanna learn develop plugin for QtCreator, please help me.

Happy New Year!

December 31, 2010

QtK QtK
Lab Rat
1140 posts

Any idea what library -lAggregation is. Where it is being used?

December 31, 2010

HeartJ HeartJ
Lab Rat
9 posts

It works!!!

I build the source of qtcreator used “Qt 4.7.1 Command Prompt”(run “qmake “CONFIG+=release” and “mingw32-make”) and I got “qtcreator.exe” in “qt-creator-2.1.0-rc1-src\bin”.

And I changed “QTC_BUILD_DIR *” the same as “*QTC_SOURCE_DIR” in pro file. SO it build successfully.

But I found that the “todo.dll” can be used in the qtcreator which I build with source, and it cannot work in the qtcreator which I got form installing “qt-creator-win-opensource-2.1.0-rc1.exe”.
It shows that “*the plugin uses incompatible Qt library. Expected build key “Windows msvc release full-config”, got “Windows mingw release full-config” *”.
What does it mean?

December 31, 2010

HeartJ HeartJ
Lab Rat
9 posts

Another question, I create a new “QtCreator Plugin” project, assigned the source path and the build path. But I build it failed with the same wrong “cann’t find -lAggregation”.

If I changed the project from debug into release, it was built successfully.

Do I build the project release only?

December 31, 2010

Vass Vass
Ant Farmer
743 posts

Please, show your .pro file

 Signature 


Vasiliy

 
  ‹‹ Win-1251 codepage and QIBASE driver      Using lib debug version ››

You must log in to post a reply. Not a member yet? Register here!