Did you know? Qt is the best C++ framework fro writing cross-platform application.
As I promised, this report will be mainly about Project Compilation in WHC IDE. When i said about it on previous post, I didn’t think that it won’t be that complicated.
First of all I didn’t know anything about how to run a program inside of another program (some sort of inception, i know ) , but Qt helped me a lot by providing a really useful thing: QProcess – class for running shell commands and executables.
And here comes the first big challenge: Running make inside of my program made my application simply freeze, until make is done. Here i learned a lot about running QProcess in synchronous mode and and asynchronous mode. Asynchronous mode is a little bit tricky, and requested me to make a “ring” of 3 methods: configureTask, makeTask, nextTask.
It worked really nice and even porting it to windows wasn’t that hard, only replaced make with nmake and set some specific options for each OS.
Second big challenge was to fix, or maybe to re-implement ProjectTree. It didn’t provide some options and after operating some changes on project tree, i must reload the project. Building a big tree over and over again isn’t reasonable if you have a lot of source files and since i didn’t manage to fix the old one, i build my own ProjectTree. With the old one even deleting files ran in O(n lg n)- because i was forced to find that files. Now all operations Add Task/ Add File/ Delete File/ work in O(lg n), where n is the number of files.
The third and the last big challenge: Setting cmake paths for Windows. Well Then i tested last week, WHC IDE was build using cl(Visual Studio Compiler in QtCreator) and everything worked just fine, but when I tried to compile it with minGW, cmake wasn’t able to configure because “cl” was not found. So I started to add environment variables to QProcess. I wasn’t able to find out what variables are requested and after few fails I added all extra 16(!) from Visial Studio Command line … after successful configuration, i was able to reduce their number to 9. Everything that work so nice and well on Linux, end up in the worst way on Windows.
But I’ve managed to do all of this and I’m happy.
So, WHC IDE got these new options:
- Build all task in a separate build folder
- Clean all
- Faster and better Add Task/ Add File/Delete Selected options for project management
Next weeks, I’ll work on Diagram View, part that let the user configure tasks and assign inputs and outputs, according to my mentor’s opinion, this is the most difficult part and it will require some time to make it. Hope Qt will help me one more time and provide some useful classes so i wouldn’t need to implement all by myself.
My colleague Cosmin, also want to tell you something:
Hello, in this report I will write about saving project and some problems that occurred during highlighting the code.
Basically, for saving project I had to create a listener which activates a method whenever someone tries to close a tab, or the main window. Those methods act like triggers, also as explicit save button.Then I iterate through unclosed tabs and save the ones that are not saved.
The problem with text highlight is that Windows 7 does not always support the actual implementation, for example on my computer it doesn’t work, but on my colleague’s it does, I also read on some forums about that and it seems that the OS is the problem.
Another problem was that some libraries were included in .cpp files, when I tried to move them I received an error completely irrelevant(; missing), the solution was to declare the prototype of some classes at the beginning of the .h file.
There is also the problem that currently the program does not load in memory the highlight rules but load them every time a tab is opened, that causes a little bit of delay especially for languages with a large number of keywords(OpenCL).
I hope that I will finish the other projects that I’m working on soon and implement the things that I have in mind, one of them is swap files, the other is to complete highlight(load the highlight rules in memory) and a interface for editor.
See you on next report, I hope with better results