Author Topic: QtWorkbench plugin  (Read 231998 times)

fleuba

  • Guest
Re: QtWorkbench plugin
« Reply #90 on: September 11, 2006, 08:42:42 am »
Hello,

that's fine, we will take a look at your source code and see if we can push it forward. I know it is difficult to match together job, private obligation and open source dev done in "free time".
Your job is already a good step, perhaps we can bring it to another level.

We'll keep you informed here.

Good luck for your job, have a nice time.
Fred

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: QtWorkbench plugin
« Reply #91 on: September 11, 2006, 09:19:55 am »
If you have any progress with it please let me know (email, forum whatever). I will give you commit access to the sources so you can work more efficiently. I hope my code isn't too bad (haven't seen it for a while  :?). If I find any time to also work with it I 'll make sure the changes are commited. Thanks for your intrest.

Have a good day,
Yorgos
Life would be so much easier if we could just look at the source code.

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: QtWorkbench plugin
« Reply #92 on: September 16, 2006, 08:45:44 pm »
OK I did manage to take a look at the plugin and it is fixed :) I even added support for virtual targets (scopes in the .pro file) and the resulting Makefile builds nicely from the command line. I do have a show stopper in the compiler plugin in int CompilerGCC::Build(const wxString& target). See below (my comments):
Code: cpp
    //If the target is empty (it is for building the All virtual target), then get the first of the virtual
    //target's actual and set the realTarget to it's name.
    wxString realTarget = !target.IsEmpty() ? target : (m_SelectedTargets.GetCount() ? m_SelectedTargets[0] : _T(""));
    m_BuildSelectedTargets = m_SelectedTargets;
    m_BuildSelectedTargets.RemoveAt(0);

    ProjectBuildTarget* bt = m_Project->GetBuildTarget(realTarget);
    // bt is the first target of the virtual target's members.
if (UseMake(bt))
    {
        // make sure all project files are saved
        if (m_Project && !m_Project->SaveAllFiles())
            Manager::Get()->GetMessageManager()->Log(_("Could not save all files..."));
        // gets the command for the first target of the virtual target
        wxString cmd = GetMakeCommandFor(mcBuild, bt);
        // Fire and forget, only the first target get's build :(
        m_CommandQueue.Add(new CompilerCommand(cmd, wxEmptyString, m_Project, bt));
    }


In short words if you have a project that uses a Makefile and virtual targets then if you try to build any virtual target then only that virtual target's first target "member" gets build. So the outputed Makefile from the plugin is actually correct but then the build command tries to only build one of the targets so you get only the first target built. In all other aspects the plugin is the same as you remember it.
Life would be so much easier if we could just look at the source code.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: QtWorkbench plugin
« Reply #93 on: September 16, 2006, 09:48:02 pm »
Yes, after virtual targets were introduced Makefile-based projects have not been tested because I don't have any  :oops: ...
Be patient!
This bug will be fixed soon...

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: QtWorkbench plugin
« Reply #94 on: September 16, 2006, 10:14:01 pm »
Yeah, I kind of figured that out  :). I know you 'll get there so I don't worry... Anyway the basic funtionality is restored. I just have to get the new API to my head to see what I can do.

Some thoughts:
*New parser using the right tool for the job (no handmade hacks using identifiers :), this has remained since I was using the plugin for myself only and is directly derived from the Makefile generator in the early C::B versions, I 'm sure Yiannis can find some of his code in there ;))
*Remove the menu entry. I think it's better to add an entry in the Build menu that just says "Run QMake" and the user should have the Using Makefiles blah blah enabled.
*Add the QMake options and Edit QMake options in the Project menu.
*Provide some kind of configuration.
Life would be so much easier if we could just look at the source code.

Methedrine

  • Guest
Re: QtWorkbench plugin
« Reply #95 on: September 17, 2006, 05:35:21 pm »
First of all, great work there yop! I really like this integration, it eases managing Qt's .pro files by miles :D

However, I am a bit surprised by the QMAKE_CXXFLAGS put into the Debug.pro from your tool. My compiler settings in Code::Blocks for the Debug target are -g and -Wall, yet the Debug.pro file states the following:

Code
#Code::Blocks Identifier - START
QMAKE_CXXFLAGS+= -fexpensive-optimizations -O3 -w -W -Wall -pg -g -Wall -Wall -g
#Code::Blocks Identifier - END

That does not look quite correct with repeating several flags and expensive optimizations for a debug version :wink:

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: QtWorkbench plugin
« Reply #96 on: September 17, 2006, 09:16:51 pm »
Hi Methedrine thanks for your nice words. I am always surprised by the number of people that found the plugin usefull, I never expected that  :D
Anyway could you please take a look to your codeblocks project file ([project name].cbp) to see if these g++ flags are also there? The plugin takes the flags directly as a wxArrayString from the c::b sdk. The duplicate entries could happen if you have the same flags in your compiler options and the project build options (now that I think about it I can fix that easily, typical case of lazy programmer  :lol:).
Since you 're using the plugin what do you think about my suggestions in my previous post?
« Last Edit: September 17, 2006, 09:20:56 pm by yop »
Life would be so much easier if we could just look at the source code.

Methedrine

  • Guest
Re: QtWorkbench plugin
« Reply #97 on: September 18, 2006, 10:27:56 pm »
Hi yop,

I just had a look at my .cpb file and there are not the symbols written into the .pro file - see for yourself:
Code: xml
<Build>
  <Target title="Debug">
    <Option output="Debug/hashphp.exe" />
    <Option object_output="Debug/" />
    <Option type="0" />
    <Option compiler="gcc" />
    <Compiler>
      <Add option="-Wall" />
      <Add option="-g" />
    </Compiler>
    <MakeCommands>
      <Build command="$make -f $makefile $target" />
      <CompileFile command="$make -f $makefile $file" />
      <Clean command="$make -f $makefile clean$target" />
      <DistClean command="$make -f $makefile distclean$target" />
    </MakeCommands>
  </Target>
  <Target title="Release">
    <Option output="Release/hashphp.exe" />
    <Option object_output="Release/" />
    <Option type="0" />
    <Option compiler="gcc" />
    <Compiler>
      <Add option="-O2" />
    </Compiler>
    <Linker>
      <Add option="-s" />
    </Linker>
  </Target>
</Build>

Personally I'd love to see qtworkbench menu being removed and the usual compiler interface being used instead. It's just due to some lazyness on my side though (I love simply hitting F5 to start compiling and debugging :P)
Also, moving the Qmake options into the project properties dialog is probably the best thing, but moving them into the project menu is definately a good start!

Cesar

  • Guest
Re: QtWorkbench plugin
« Reply #98 on: September 30, 2006, 07:16:53 pm »
Greetings, yop.
First of all I'd like to thank you for this piece of work you've already done to move C::B towards Qt integration!
Unfortunately it couldn't create *.pro file for me because of lack Release and Debug directories in the project tree. But if I create them manually it seems to work :)
Do you accept patches? ;)

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: QtWorkbench plugin
« Reply #99 on: October 01, 2006, 08:34:02 pm »
Do you accept patches? ;)
Hi Cesar, nice to see you here :). I sure do  accept patches :D The proposal to give commit access to the sources still stands to anyone intrested ;)
I am working towards a different integration (see previous posts) that will use some lexical analysis tool (I 'm learning my way with antlr, Takeshi Miya praises it all the time so I thought I 'd give it a try) to parse .pro files and get rid of the identifiers (ugly but it did the trick). This way we could also import Qt projects to code::blocks. Anyway I know you have the will to help towards a Qt friendly IDE and code::blocks is a feature rich IDE but doesn't really like Qt (yet). Untill now I 'm the only one who gave it a shot and the results are far from satisfactory but pretty popular, which means that there are people out there looking for an IDE with Qt integration (I 'd say more on windows as in Linux KDevelop is difficult to beat regarding Qt development). Anyway I 'll be glad to hear from you again.

P.S. Regarding the not creating the .pro issue, the targets in c::b project are not the same thing as qmake targets so I had no choice other than using the qmake approach (SUBDIRS) but that means that for each of your targets you must have the respective directory.
« Last Edit: October 01, 2006, 08:37:53 pm by yop »
Life would be so much easier if we could just look at the source code.

Cesar

  • Guest
Re: QtWorkbench plugin
« Reply #100 on: October 02, 2006, 09:29:53 pm »
I'm glad you recognised me :) I'd be happy to help you improove Qt intergration in C::B.
Recently I've found yet another one IDE with an aim to provide Qt environment and integration. Give it a try, take a look at QIde. Its .pro files handling is amazing! I suppose we could use it, as QIde is GPL-ed as well ;)
Regards, Cesar

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: QtWorkbench plugin
« Reply #101 on: October 03, 2006, 09:04:20 am »
Give it a try, take a look at QIde. Its .pro files handling is amazing! I suppose we could use it, as QIde is GPL-ed as well ;)
I have seen it and it is promising but it is quite imature yet. No doubt it has better handling of .pro files than C::B - QtWorkbench as it is built around them but a) I really need all the goodies that C::B provides and b) I need a generic IDE not a Qt based one. Sure most of my gui programming is around Qt (it's my job) but you also know that qmake / .pro files are restrictive. Right now C::B seems like the only C++ IDE that has the potential to become my main IDE both in linux and windows because it has more than average features (with more and more being added) coupled with its cross platform nature. The drawback is that I can't easily use Qt, but as it is with any oss: if like it and you miss a feature then add it, so that's what I did. This plugin started as strictly personal use but given that meny people were asking for Qt integration I released it and it has reached quite a few downloads (which is honestly surprising considering it's quality). That is what makes me want to improve it. Between wanting and actually doing comes my work and my personal life leaving me very little time to actually finish it. Anyway if you are intrested I 'll pm you my email.
Life would be so much easier if we could just look at the source code.

Cesar

  • Guest
Re: QtWorkbench plugin
« Reply #102 on: October 03, 2006, 09:41:03 am »
I'm not trying to persuade somebody to switch to other IDE.
First of all it is rude to do this on C::B's forum ;) The second reason is that I can't choose myself, which one to use. Both QIde and C::B have pros and cons.
Anyway, I'm going to join the QIde team as soon as it will move to SVN. Anyway I suppose we could merge our efforts in parsing Qt *.pro files. Right now I'm not familiar with C::B and its API so I might study it for some time.
Regards, Cesar

Methedrine

  • Guest
Re: QtWorkbench plugin
« Reply #103 on: October 30, 2006, 08:17:56 pm »
Any update on the plug-in? :-)

Also, if you want some help coding, just tell us what needs to be done.

zithen

  • Guest
Re: QtWorkbench plugin
« Reply #104 on: November 01, 2006, 03:57:35 am »
Hi, I'm pretty new to programming and I would like to learn via Qt and Code::Blocks.
I'm trying to build the files for the Qtworkbench plugin, but I'm getting build errors, where it says that it can't find certain header files, such as
#include <sys/utsname.h>
#endif
#include <wx/tokenzr.h>
#include <sdk.h>

#include <settings.h>
#include <cbproject.h>
#include <compiler.h>
#include <wx/dir.h>

etc.

Sorry, I'm pretty green, but I'd appreciate the help.  What am I doing wrong and how do I config Code::Blocks to load the files?

Thanks

Adam