Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
QtWorkbench plugin
yop:
What is it?
A plugin that adds support for Qt to the Code::Blocks IDE
How?
Using qmake, Trolltech's makefile generator, included in every Qt installation. The plugin generates input files (.pro files) for qmake and then runs it to generate a makefile. Using the internal Code::Blocks support for Makefiles you can build your project and have all the features that C::B provides available.
More information in: http://code.google.com/p/qtworkbench/
Get the sources using svn (be carefull of wrapping):
svn checkout http://qtworkbench.googlecode.com/svn/trunk/ [C::B sources dir]/src/plugins/contrib/qtworkbench
Binaries: http://code.google.com/p/qtworkbench/downloads/list
mandrav:
Nice job :)
--- Quote ---And the best way would be to trigger somehow a makefile build. The only way I can see that being possible is to get the makefile build process out of the compiler plugin and into the core.
--- End quote ---
If you automatically set the project to use a custom makefile, then the following is sufficient:
--- Code: (cpp) ---// find compiler plugin
PluginsArray arr = Manager::Get()->GetPluginManager()->GetCompilerOffers();
if (arr.GetCount() == 0)
return;
cbCompilerPlugin* compiler = static_cast<cbCompilerPlugin*>(arr[0]);
if (compiler)
{
// we have our compiler!
// start building
compiler->Build(targetName); // use <target_name> or leave <empty> for project build
// wait for compiler to finish
while (compiler->IsRunning())
{
// if you want to abort the build, ucomment the following:
//compiler->KillProcess();
wxMilliSleep(10);
Manager::Yield();
}
int exitCode = compiler->GetExitCode();
// ta-da!
}
--- End code ---
HTH.
yop:
Well I've also created my plugin as a compiler plugin, are we sure that the compilergcc plugin will be in arr[0]? Now that I think about it my plugin doesn't have to be a compiler plugin at all... Let me see what I can figure out. And yes you 've helped a lot
mandrav:
--- Quote from: yop on February 05, 2006, 12:21:19 am ---Well I've also created my plugin as a compiler plugin, are we sure that the compilergcc plugin will be in arr[0]? Now that I think about it my plugin doesn't have to be a compiler plugin at all... Let me see what I can figure out. And yes you 've helped a lot
--- End quote ---
I see you get the point ;)
Really, there is no reason for more than one compiler plugin loaded at the same time.
yop:
And ta da it is :D
Those 10 something lines of code made all the difference. I'll strip my code from all these obsolete stuff now (message log, calls to make, ...), that is a relief...
Navigation
[0] Message Index
[#] Next page
Go to full version