PDA

View Full Version : Handcoder's IDE for Qt



magland
21st July 2007, 14:34
Handcoder's IDE for Qt (HiQt)

Are you like me in that you like to manage all the files in your project, but want the conveniences of an IDE? If so, please read on...
Inspired by QDevelop and Visual Studio, and motivated by the need to create a stable Qt IDE for Windows, HiQt is already a fully functional development environment. It features:

* Class and file browser with perfect project file parsing, because it actually uses qmake to extract the project data - open source is beautiful!
* Code completion - fast, robust, and quite pleasant - completes local project code as well as Qt keywords (Qt source is efficiently parsed as needed), and can handle concatenations such as "QString::number(123).length()".
* Interface to designer - preview your forms, or edit them in designer with just a single click of a button. HiQt will automatically detect changes to forms (or any project files) made outside of the IDE.
* Syntax highlighting - very nice, with some extra very useful tag highlighting that you'll come to depend on
* Navigation - (1) Easy switch between header/source files... (2) double click any word to get a list of where that function or type was defined/implemented... (3) navigation window listing all the tags in the current file or current class - double click tags for easy navigation
* Help - launch assistant or use the online documentation browser - press F1 on a keyword to get help
* Stable - Designed with avoiding crashes in mind. It's very stable on my machine, I'm eager to get feedback
* Others - other nice friendly (non-intrusive) features that you will discover

(there is no debugger at this point -- that's where I'll need help because I never use gdb.)
(also the class browser does not yet distinguish between private/protected/public methods)

The most important aspect of HiQt is that it DOES NOT MANAGE YOUR PROJECT -- it just shows you your project, and helps you in every non-intrusive way that it can. For example, if you want to add a file to your project, HiQt will absolutely not do it for you. But it's very easy (if you know what you are doing). Just (a) double click the project from the project manager (that will bring up the .pro text file) (b) manually add your file to the HEADERS, SOURCES, or whatever (c) upon saving the text file, HiQt will automatically detect the change, and update the file/class browsers accordingly. Now was that so hard?... a small inconvenience to pay for complete control over your project!

HiQt also stands for Harmless IDE for Qt, because it will never write anything to your files. In fact, it won't even write any additional files to your project directory. Open your projects without fear!

Well you get the idea. Attached is the source as well as Windows binary. Enjoy, and please send your feedback....

For windows binary, run bin\HiQt.exe -- it was compiled using MinGW and Qt 4.3.0
I think it works on Linux, but only tested a couple times.

HiQt-source.zip (http://www.math.upenn.edu/~jfm/HiQt-source.zip)
HiQt-win-binary.zip (http://www.math.upenn.edu/~jfm/HiQt-win-binary.zip)

elcuco
21st July 2007, 17:02
1) To make it work on Linux I had to modify the src/src.pro file.


TEMPLATE = app
CONFIG += uitools qt console release assistant
QT+=xml # <- this line
DESTDIR = ../bin
TARGET = HiQt


2) Documentation is not working. See this patch:


elcuco@pinky:~/src/qt4/HiQt/src$ diff -u HiQtDocBrowser.h{.orig,}
--- HiQtDocBrowser.h.orig 2007-07-21 17:38:11.000000000 +0300
+++ HiQtDocBrowser.h 2007-07-21 17:46:22.000000000 +0300
@@ -3,6 +3,7 @@

#include "ui_HiQtDocBrowser.h"
#include <QUrl>
+#include <QLibraryInfo>
#include <QMainWindow>
#include <QToolBar>
#include <QFileInfo>
@@ -15,7 +16,9 @@
HiQtDocBrowser(QWidget *parent=0) : QWidget(parent) {
ui.setupUi(this);

- ui.browser->setSearchPaths(QStringList(QString(getenv("QTDIR"))+"/doc/html"));
+ QStringList l;
+ l << QLibraryInfo::location(QLibraryInfo::Documentation Path) + "/html";
+ ui.browser->setSearchPaths(l);

connect(ui.previous_button,SIGNAL(clicked()),ui.br owser,SLOT(backward()));
connect(ui.next_button,SIGNAL(clicked()),ui.browse r,SLOT(forward()));
@@ -26,7 +29,7 @@
ui.browser->setSource(QUrl("index.html"));
}
void open_keyword(QString word) {
- if (QFileInfo(QString(getenv("QTDIR"))+"/doc/html/"+word.toLower()+".html").exists())
+ if (QFileInfo( QLibraryInfo::location(QLibraryInfo::Documentation Path) + "/" + word.toLower()+".html").exists())
ui.browser->setSource(QUrl(word.toLower()+".html"));
}
public slots:


3) When I loaded a project based on subdirs, I get this message saying that my projects has no targets, and thus I cannot execute it.

4) Look into Issue 155 of QDevelop, it affects your application as well. http://code.google.com/p/qdevelop/issues/detail?id=155

A few suggestions:
5) Get rid of all the margins in the GUI. Qt4 uses a HUGE margin for layout, it wastes a lot of space in your application (which is very concentrated anyway). Remove the frames from the editors as well. No need for 3-5 margins. Qt4's problem I know, but you have to deal with it.

6) You use 2 tab bars. Bar usability Idea. Wastes a lot of space. Search for a better solution.

7) Open UI's in an external designer. I don't care that they are XML. I don't want to see the XML.

8) The source zip file - put a version on it. Also on the directory inside it.

fullmetalcoder
22nd July 2007, 15:14
**** qmake-HiQt ****
Error opening file for reading
**** qmake-HiQt ****
Error opening file for reading
**** qmake-HiQt ****
Error opening file for reading
That's a bit disappointing...

Besides, for once (believe me that's quite rare ;)), I tend to agree with elcuco : the GUI needs a lot of work (not that it's hard or long to do...) : there are huge useless margins, some dialogs do not even use layouts while resizing is still enabled, ...

edit : Just tried making completion work but got no luck... Path to ctags was set by default to /usr/bin/ctags (which indicated "found") but I didn't get anything so I changed it to just "ctags" (yeah Linux rocks : no path troubles... :)). I did not get anything that looked like completion but some debug output might tell you why (I must admit I don't know anything about ctags CLI switches and I don't feel like learning anyway...):

ctags: unrecognized option `--fields=afiKmsSzn'
Try `ctags --help' for a complete list of options.
ctags: unrecognized option `--fields=afiKmsSzn'
Try `ctags --help' for a complete list of options.
ctags: unrecognized option `--fields=afiKmsSzn'
Try `ctags --help' for a complete list of options.
ctags: unrecognized option `--fields=afiKmsSzn'
Try `ctags --help' for a complete list of options.
ctags: unrecognized option `--fields=afiKmsSzn'
Try `ctags --help' for a complete list of options.
ctags: unrecognized option `--fields=afiKmsSzn'
Try `ctags --help' for a complete list of options.
ctags: unrecognized option `--fields=afiKmsSzn'
Try `ctags --help' for a complete list of options.
ctags: unrecognized option `--fields=afiKmsSzn'
Try `ctags --help' for a complete list of options.
ctags: unrecognized option `--fields=afiKmsSzn'
Try `ctags --help' for a complete list of options.
ctags: unrecognized option `--fields=afiKmsSzn'
Try `ctags --help' for a complete list of options.
ctags: unrecognized option `--fields=afiKmsSzn'
Try `ctags --help' for a complete list of options.
ctags: unrecognized option `--fields=afiKmsSzn'
Try `ctags --help' for a complete list of options.
ctags: unrecognized option `--fields=afiKmsSzn'
Try `ctags --help' for a complete list of options.
ctags: unrecognized option `--fields=afiKmsSzn'
Try `ctags --help' for a complete list of options.
ctags: unrecognized option `--fields=afiKmsSzn'
Try `ctags --help' for a complete list of options.

magland
23rd July 2007, 01:04
I'm now working on the 8 points mentioned by elcuco (thanks for the feedback)... please be patient everyone for a few days and I'll put out a much cleaner version. :)

+ magland

P.S. - the project is less than one month old, so judge it wisely - i.e. by it's trajectory!

fullmetalcoder
23rd July 2007, 19:18
judge it wisely
Talking about wisdom : I deem it's particularly unwise to create a new file using a modified version of qmake to then read it from your app. A much smarter way (though maybe a little more complicated at first) would be to embed qmake's sources and to create a new entry point to it (i.e. drop the main() since you can't have two main() in a single app and also because it's not a very convenient interface within an app... for instance replace argc and argv by a QStringList and instead of writing to a file return the data through a custom memory structure (possibly even from the already setup QMakeProject object...)

As for the completion it appears that the problem with --fields comes from the bin shipped with my distro which appears to be etags actually and has a slightly different CLI... I'll try to install a proper version and check if it is really as fast as you claim ;)

elcuco
23rd July 2007, 19:37
I think that the best solution would be to understand the problems caused by etags. In QDevelop we already seen people running MacOS which had problems with the ctags binary available on their system. There must be a commont ground for all those applications.

About speed? No speed. The crapiest parameters of all these "IDE"s we are seeing in the last year is the syntax highlighter. On all it just stinks, and it's slow as hell.

fullmetalcoder
23rd July 2007, 19:44
I think that the best solution would be to understand the problems caused by etags. In QDevelop we already seen people running MacOS which had problems with the ctags binary available on their system. There must be a commont ground for all those applications.
as far as I can see it just use a completely different CLI to filter tags type so you'd better handle both and use the version switch to figure out which syntax should be used. (Makes me feel a lot more satisfied of having build my own solution from scratch : I had hard times but it's now both quite efficient and fully mastered... :))


About speed? No speed. The crapiest parameters of all these "IDE"s we are seeing in the last year is the syntax highlighter. On all it just stinks, and it's slow as hell.
True enough. But you won't be able to get rid of it as long as you cling to QTextDocument... This class does a great job rendering rich text but it sucks when it comes to complying with the need of coders : speed, small memory usage, loading big files, highlighting ... That's why I'm working on a new version of QCodeEdit which already offers a working (I did not say "usable" yet!) alternative to QTextDocument and fulfils all the aforementioned requirement. You might also be interested in QScintilla port to Qt 4 but beware it has a really crappy API...

magland
23rd July 2007, 19:50
Thanks for your feedback fullmetalcoder, but perhaps you could discuss your IDE on a separate thread... My hope here is to get some feedback from potential users of HiQt - I'm guessing that you don't fit into that category.

elcuco, I really appreciate your specific feedback points, and I'm about to release the next version addressing all those issues....

Cheers,
JM

elcuco
23rd July 2007, 20:01
Lets move this discussion to:
http://www.qtcentre.org/forum/f-qt-programming-2/t-qtextdocument-stinks-8186-post43671.html

fullmetalcoder
23rd July 2007, 20:33
perhaps you could discuss your IDE on a separate thread...
Sure! But see, it was not quite about my IDE but the editing layer which is an independent module anyone can use (or could if it were already mature ;) )... Let's move along anyway...

magland
23rd July 2007, 20:34
A new version of HiQt is now available:

http://www.qt-apps.org/content/show.php/Handcoder%27s+IDE+for+Qt?content=62825

I've fixed/addressed the bugs/suggestions mentioned by elcuco - (except for the one about opening .ui files - I have reason for keeping it this way for now).

In addition, you can now get help for all indexed Qt keywords (not just class names).
Furthermore, I fixed a major bug in loading subprojects (I had overlooked that fact that the .pro file doesn't have to have the same name as it's directory).

There seems to be a bug in QTextEdit that slows things down significantly - I'm going to bring that up in a different thread. Nevertheless, it's usable at this point -- so try it out and tell me what you like :)

fullmetalcoder
23rd July 2007, 20:38
Just a little note about completion : installing ctags and setting proper path solved it but it is way too slow as far as I'm concerned... In case you'd like to make it work with etags as well here comes the CLI info :

Usage: ctags [options] [[regex-option ...] file-name] ...

These are the options accepted by ctags.
You may use unambiguous abbreviations for the long option names.
A - as file name means read names from stdin (one per line).
Absolute names are stored in the output file as they are.
Relative ones are stored relative to the output file's directory.

-a, --append
Append tag entries to existing tags file.
--packages-only
For Ada files, only generate tags for packages.
-B, --backward-search
Write the search commands for the tag entries using '?', the
backward-search command instead of '/', the forward-search command.
--declarations
In C and derived languages, create tags for function declarations,
and create tags for extern variables if --globals is used.
-d, --defines
Create tag entries for C #define constants and enum constants, too.
-l LANG, --language=LANG
Force the following files to be considered as written in the
named language up to the next --language=LANG option.
--globals
Create tag entries for global variables in some languages.
--no-members
Do not create tag entries for members of structures
in some languages.
-r REGEXP, --regex=REGEXP or --regex=@regexfile
Make a tag for each line matching a regular expression pattern
in the following files. {LANGUAGE}REGEXP uses REGEXP for LANGUAGE
files only. REGEXFILE is a file containing one REGEXP per line.
REGEXP takes the form /TAGREGEXP/TAGNAME/MODS, where TAGNAME/ is
optional. The TAGREGEXP pattern is anchored (as if preceded by ^).
If TAGNAME/ is present, the tags created are named.
For example Tcl named tags can be created with:
--regex="/proc[ \t]+\([^ \t]+\)/\1/.".
MODS are optional one-letter modifiers: `i' means to ignore case,
`m' means to allow multi-line matches, `s' implies `m' and
causes dot to match any character, including newline.
-R, --no-regex
Don't create tags from regexps for the following files.
-I, --ignore-indentation
In C and C++ do not assume that a closing brace in the first
column is the final brace of a function or structure definition.
-o FILE, --output=FILE
Write the tags to FILE.
--parse-stdin=NAME
Read from standard input and record tags as belonging to file NAME.
-t, --typedefs
Generate tag entries for C and Ada typedefs.
-T, --typedefs-and-c++
Generate tag entries for C typedefs, C struct/enum/union tags,
and C++ member functions.
-u, --update
Update the tag entries for the given files, leaving tag
entries for other files in place. Currently, this is
implemented by deleting the existing entries for the given
files and then rewriting the new entries at the end of the
tags file. It is often faster to simply rebuild the entire
tag file than to use this.
-v, --vgrind
Print on the standard output an index of items intended for
human consumption, similar to the output of vgrind. The index
is sorted, and gives the page number of each item.
-x, --cxref
Like --vgrind, but in the style of cxref, rather than vgrind.
The output uses line numbers instead of page numbers, but
beyond that the differences are cosmetic; try both to see
which you like.
-V, --version
Print the version of the program.
-h, --help
Print this help message.
Followed by one or more `--language' options prints detailed
help about tag generation for the specified languages.

These are the currently supported languages, along with the
default file names and dot suffixes:
ada .ads .adb .ada
asm .a .asm .def .inc .ins .s .sa .S .src
c .c .h
c++ .C .c++ .cc .cpp .cxx .H .h++ .hh .hpp .hxx .M .pdb
c* .cs .hs
cobol .COB .cob
erlang .erl .hrl
forth .fth .tok
fortran .F .f .f90 .for
html .htm .html .shtml
java .java
lisp .cl .clisp .el .l .lisp .LSP .lsp .ml
lua .lua .LUA
makefile Makefile makefile GNUMakefile Makefile.in Makefile.am
objc .lm .m
pascal .p .pas
perl .pl .pm
php .php .php3 .php4
postscript .ps .psw
proc .pc
prolog .prolog
python .py
scheme .oak .sch .scheme .SCM .scm .SM .sm .ss .t
tex .bib .clo .cls .ltx .sty .TeX .tex
texinfo .texi .texinfo .txi
yacc .y .y++ .ym .yxx .yy
auto
none
where `auto' means use default language for files based on file
name suffix, and `none' means only do regexp processing on files.
If no language is specified and no matching suffix is found,
the first line of the file is read for a sharp-bang (#!) sequence
followed by the name of an interpreter. If no such sequence is found,
Fortran is tried first; if no tags are found, C is tried next.
When parsing any C file, a "class" or "template" keyword
switches to C++.
Compressed files are supported using gzip and bzip2.

For detailed help on a given language use, for example,
etags --help --lang=ada.

Report bugs to bug-gnu-emacs@gnu.org

magland
23rd July 2007, 20:55
Thanks for the info. I realize that it's somewhat slow for now... what's important to me is that it's robust and reliable (i.e. no bugs or crashes)... I'll make it faster in the future. Most people I think are willing to wait a second or so for completion to kick in if it really works... and I can assure that future versions will be lightning fast ;)

http://www.qt-apps.org/content/show....?content=62825


Just a little note about completion : installing ctags and setting proper path solved it but it is way too slow as far as I'm concerned... In case you'd like to make it work with etags as well here comes the CLI info :

elcuco
23rd July 2007, 21:29
are you re-painting after 5 seconds, with the functions been bold? that's sweet!

I fail to understand how the help browser works, but it's kinda handy when you zoom it down 2-3 times. I prefear having the text in a small font, and then get more info on the page - so i can have more space for the text editor itself. I would recommend you to work more on the help viewer - it's a killer feature for me.

BTW,
My sub-projetcs demos are not working on this new version as well.

magland
23rd July 2007, 21:46
are you re-painting after 5 seconds, with the functions been bold? that's sweet!

Yes, it's very useful to quickly see if there was a misspelling or something... or if you forgot a #include, because it only bolds keywords that are visible from the current file.


I fail to understand how the help browser works,

Could you explain... do you mean that it doesn't work properly when you press F1 over a keyword, or do you mean that you don't understand how it's coded...?


but it's kinda handy when you zoom it down 2-3 times. I prefear having the text in a small font, and then get more info on the page - so i can have more space for the text editor itself. I would recommend you to work more on the help viewer - it's a killer feature for me.

Sure, perhaps I'll add a zoom feature (is that built in to QTextBrowser?)



BTW,
My sub-projetcs demos are not working on this new version as well.

Funny... I tried the project attached to QDevelop issue #155 and that seemed to load correctly... could you send me your test project?

BTW I still have not resolved the "code completion losing input focus on Linux issue"... but I'm working on it.

Many thanks,
Jeremy

elcuco
23rd July 2007, 22:22
I don't care about the code. Only the functionality, I am a user of your application, not a developer.

My text cursor is in a word "QString", when I press F1, the help browser is opened on index.html and not qstring.html.

The zoom is built in, you will find it. My suggestion is: zoom out by 2-3 by default.

Another rant, the buttons on the left are a good idea. However they are not intuetive enough. It's hard for me to understand what each one of them does. Nice idea tough, maybe reducing the count, and adding some text will help.

magland
24th July 2007, 04:55
My text cursor is in a word "QString", when I press F1, the help browser is opened on index.html and not qstring.html.

Oh yes... it's a case-sensitivity issue, just change "/html/Qt.dcf" to "/html/qt.dcf" in HiQtDocBrowser.h, and that should do it... or you can just wait for the next version.


Another rant, the buttons on the left are a good idea. However they are not intuetive enough. It's hard for me to understand what each one of them does. Nice idea tough, maybe reducing the count, and adding some text will help.

Yes, I agree, and I'm working on it.

magland
24th July 2007, 17:34
Here's a new version
HiQt-0.1.6 (http://www.qt-apps.org/content/show.php/Handcoder%27s+IDE+for+Qt?content=62825)

Feedback appreciated...

New Features since 0.1.5:

Documentation browser
fixed Linux bug - so docs are now available
keyword searches no longer need to be exact matches
"copy" (Ctrl+C) text now works
Zoom in and zoom out
Name of current doc file is displayed in current doc bar

Main Window
improved tool button layout, menu options, and shortcuts
Templates
Able to create new project and main source file from template - handy for testing quick programs

Editor
Significantly sped up editor using a workaround to a Qt bug in QTextEdit (separate thread)
Better (more continuous) syntax highlighting
Multi-line indentation using [Tab] and un-indentation using [Shift+Tab]
Improved auto-indenting

magland
27th July 2007, 05:29
Here's a new tool in HiQt that you don't see in other IDE's...
it's a menu option for generating the file and class dependency
graphs for the currently active project. Within seconds, you
can see the big picture for your project, and double click on
a file node (or a class node) to go straight to the source.
Below are graphs for the elegant qmake.pro.

http://www.math.upenn.edu/~jfm/qmake_file_hierarchy.jpg

http://www.math.upenn.edu/~jfm/qmake_class_hierarchy.jpg
Graphs are generated using GraphViz (http://www.graphviz.org/) --
which I include with the Windows binary distribution.
Usually output of Graphviz is .png or .ps, but in this case
I show the nodes as QGraphicsItem's in a QGraphicsScene
so there are a lot of possibilities...
for now you can just double click the nodes to go the the source.

A note to Linux users... I realize that HiQt
is quite unpleasant on Linux -- i.e. there are several
things that for whatever reason don't port nicely
from Windows. The most severe problem is the
loss of input focus during code completion -- another
thing is the ctags/etags issue. I'll work on these things,
but for now I have very limited access to a Linux box
with 4.3.0 (I need latest version since there are unworkable
bugs in 4.2).

To Windows developers... I believe that the program
is stable, and in my opinion your best bet if you want
to manage your own .pro files. You need Qt 4.3.0 to use it.
Please try it and tell me if it is not getting to be even more
of a useful tool than microsoft studio.

Also, latest version has much faster code completion than a few days ago. :)

magland
28th July 2007, 15:20
I fixed the code completion issue on Linux, so it should be usable on Linux now. As mentioned by fullmetalcoder, you need to make sure you have the latest ctags installed.

http://www.qt-apps.org/content/show.php/Handcoder%27s+IDE+for+Qt+%28HiQt%29?content=62825

magland
30th July 2007, 21:22
Interface to Doxygen

Many programmers have discovered the value of documenting C++ source code using Doxygen-style tags. In fact, I believe that the creator of Doxygen was trying to replicate the Qt documentation system (but somebody can correct me on this). Anyway, I don't use Doxytagging as much as I should for the following reasons 1. I'm lazy 2. It takes some effort to manage the Doxyfile (ensuring that it includes all of my project files, but not any extras) 3. it takes some effort to generate the docs and view them and keep track of them.

To remedy this, I have added an option in HiQt which allows user to
(a) One-click generation of Doxygen documentation on the currently active project
(b) Viewing that documentation within the IDE (like the Qt reference doc browser)
(c) Press F1 on a keyword to go to the Qt docs, Press F2 on a (project) keyword to go to the project docs
(d) Browse the docs, and then navigate back to the corresponding source code

(Remember, Handcoder's IDE never writes anything to your project directory...)

Now I will use Doxygen tags a lot more -- because I can see the benefits instantly... and I hope you will try it too :) -- (especially if you use windows because it will work out of the box with 4.3.0, Linux should work too I am guessing)

http://www.qt-apps.org/content/show.php/Handcoder%27s+IDE+for+Qt+%28HiQt%29?content=62825

http://www.math.upenn.edu/~jfm/HiQt_screenshot_doxygen.JPG

magland
1st August 2007, 20:24
Code completion is now much faster (and better) than QDevelop and (for practical purposes) comparable to Edyuk.

There is also an interface to QObjectBrowser... so you can view a tree of all of your objects/signals/slots/properties during run time! (Use the "build with runtime utilities" command")

Also, as I mentioned earlier, there is built-in Qt docs plus project-specific docs using Doxygen.

Think about it... there must be something good about the IDE I am using if I can add these features so quickly... If you like it, post positive feedback, because that will tell others to try it if on the fence.

Also, if you like the approach, consider joining the dev team. Hoping to generate interest so the project can take on a life apart from me... then we all benefit. :)

http://www.qt-apps.org/content/show.php/Handcoder%27s+IDE+for+Qt+%28HiQt%29?content=62825

sunil.thaha
2nd August 2007, 09:20
First of all,
Kudos to you for the great work.
I was able to install the application flawlessly :-)
Compiling and debugging is great

The explorer, pro file handling is really harmless !!

Bugs:
But the code completion has some bugs.

You type in QLa(Ctrl + Space )
You will not file QLabel ??

or

Type QMou( Ctrl + Space ) you will get the QMouseEvent highlighted.

Delete the "ou" of the QMou and type ai for the QMainWindow
Again ?? you won't find QMainWindow in the completion list :eek:

magland
2nd August 2007, 11:27
First of all,
Kudos to you for the great work.
I was able to install the application flawlessly :-)
Compiling and debugging is great

The explorer, pro file handling is really harmless !!

Thanks for those words... it'll keep getting better. Have you discovered that you can double click on a keyword to get a list of tags for that word... then double click a list item to navigate... I find this very useful, and soon there will be a "back" button.



Bugs:
But the code completion has some bugs.

You type in QLa(Ctrl + Space )
You will not file QLabel ??

or

Type QMou( Ctrl + Space ) you will get the QMouseEvent highlighted.

Delete the "ou" of the QMou and type ai for the QMainWindow
Again ?? you won't find QMainWindow in the completion list :eek:


Check to see that you have #include <QLabel> and <QMainWindow> at the top of your file (wait a few seconds until the change is detected). If you already had those things (or if that doesn't fix it), let me know what system you are on and I'll try to reproduce. This completion works fine for me on Windows...

Incidentally, there are other issues with code completion that I am aware of and will be addressing, (such as local variable declarations with comma-separated variables).

Cheers

sunil.thaha
2nd August 2007, 11:41
Have you discovered that you can double click on a keyword to get a list of tags for that word... then double click a list item to navigate... I find this very useful, and soon there will be a "back" button.

Keyword : You mean if, else, do, while ... ?

Well I tried double clicking on everyword i could find but did not find anything happening :confused:. Can you make it clearer :-)



Check to see that you have #include <QLabel> and <QMainWindow> at the top of your file (wait a few seconds until the change is detected). If you already had those things (or if that doesn't fix it), let me know what system you are on and I'll try to reproduce. This completion works fine for me on Windows...


That worked !! Maybe, I hadn't given enough time.
But ... Even without including the header files, wouldn't you like to have the completion working? Anyway a work around for that is to include QtGui and later comment it out :rolleyes:

elcuco
2nd August 2007, 12:11
I downloaded and compiled 0.1.14, and found some problems.

* I see no icons. Only the close button.
* The doxygen documentation gets borked, since it uses an external css. Which QTextBrowser does not load. There are work arounds, I hope you find them.
* I am not sure why, but the doxygen documentation I see on the Project Reference tab is not the same I get when I run the doxygen command.
* Some sub projects are not loaded.

I used qmdilib for my test, it's available on qt-apps.org.

Looks sweet, great ideas. Implementation is kinda flawky, but this will get fixed in a version or two.

magland
2nd August 2007, 12:15
Keyword : You mean if, else, do, while ... ?

Well I tried double clicking on everyword i could find but did not find anything happening :confused:. Can you make it clearer :-)


Sorry about that, I didn't mean "keyword" I meant "tagword"... try double clicking on a word that is the name of one of your project's classes or functions... this should bring up the navigation window with a list showing where that tagword was declared and/or defined. The tag words should actually be highlighted bold in your code.



That worked !! Maybe, I hadn't given enough time.
But ... Even without including the header files, wouldn't you like to have the completion working? Anyway a work around for that is to include QtGui and later comment it out :rolleyes:

Now that you mention it, globals, such as "QMainWindow", should appear always, regardless of #includes, -- can you double check that -- perhaps you just need to wait until tags are done being updated - see status bar. It's the non-globals, e.g. QMainWindow::addToolBar() that depend on the #includes.

I can certainly add an option to complete everything regardless of whether or not it's visible from the current file... that would actually be easier than current functionality. However, I like using it the way it is because it reminds you to add the #includes when the code completion is not working... also it's better in the sense that code-completion will always work the same for the given file, independent of which other files have been opened.

magland
2nd August 2007, 12:26
I downloaded and compiled 0.1.14, and found some problems.

* I see no icons. Only the close button.


I had this problem also on Linux. To fix this go to src and run rcc on HiQt.qrc to re-generate qrc_HiQt.cpp -- not sure why it's not getting auto-generated during make. I'll look into it.



* The doxygen documentation gets borked, since it uses an external css. Which QTextBrowser does not load. There are work arounds, I hope you find them.


I'll look into it.



* I am not sure why, but the doxygen documentation I see on the Project Reference tab is not the same I get when I run the doxygen command.


I use the Doxyfile in the src/templates/Doxyfile, which you can configure to your needs. I suppose I should give the user the option to select an alternate Doxyfile. Just be aware that HiQt will modify certain key Doxy-parameters, such as INPUT.



* Some sub projects are not loaded.
I used qmdilib for my test, it's available on qt-apps.org.


I'll take a look.



Looks sweet, great ideas. Implementation is kinda flawky, but this will get fixed in a version or two.

Thanks, and hang in there. Your feedback is invaluable ;)

elcuco
2nd August 2007, 12:51
A few other questiosn/suggestions:
* Another tip for doxygen: If in the root directory of the project, there is a "Doxyfile", use that instead of your template.
* The dependency viewer - make it a dock window. This way I can put it on the GUI and still look at the source. (great idea BTW)
* The help dock is way to wide. It takes up too much space, cannot br shrinked, and it steals space from the code editor.
* The code editor has way to much "bold". Just a rant, feel free to ignore it.
* I don't understand what does the "build with runtime tools" does.
* I would like to have an option to modify the tab width (you set it to 2, and I like it 8 or 4)
* Incremental search is a must. Poping dialogs just distracts me from the text. Move on, it's 2007, not 1997.
* dot was not found on my system by default. Just writing "dot" was enough for me to get it working.
* I would like to have the option to export the dependency graphs as images (to send people email with text like this "look, you project sucks bug time, look at this").

sunil.thaha
2nd August 2007, 13:05
I can certainly add an option to complete everything regardless of whether or not it's visible from the current file... that would actually be easier than current functionality. However, I like using it the way it is because it reminds you to add the #includes when the code completion is not working... also it's better in the sense that code-completion will always work the same for the given file, independent of which other files have been opened.

Well I use the classes and compile the project, When i get errors I include the headers.
If I use HiQt I will see if the methods get auto-completed if not, I have to include them...
That is fine. I don't know how others use it. :-)


Feature Requests:

1. Code folding and unfolding
2. Line numbers & Goto Line number
3. When the default intend mode is using space; lets say 4 spaces, then when I am at 4th column; pressing backspace needs to delete the 4 spaces and get me back to the first column. this is exactly what Kdevelop does and is quite intuitive

Exactly like what kdevelop does.

magland
2nd August 2007, 13:26
Thanks, great suggestions.... Regarding "build with runtime tools", that allows you to see a tree of objects/widgets in your project via QObjectBrowser. I forgot to check for this, but to use it, you must set as your active project a project of type "template=app".



* dot was not found on my system by default. Just writing "dot" was enough for me to get it working.

Do you mean that "dot" WAS found on your system, or not?



A few other questiosn/suggestions:
* Another tip for doxygen: If in the root directory of the project, there is a "Doxyfile", use that instead of your template.
* The dependency viewer - make it a dock window. This way I can put it on the GUI and still look at the source. (great idea BTW)
* The help dock is way to wide. It takes up too much space, cannot br shrinked, and it steals space from the code editor.
* The code editor has way to much "bold". Just a rant, feel free to ignore it.
* I don't understand what does the "build with runtime tools" does.
* I would like to have an option to modify the tab width (you set it to 2, and I like it 8 or 4)
* Incremental search is a must. Poping dialogs just distracts me from the text. Move on, it's 2007, not 1997.
* dot was not found on my system by default. Just writing "dot" was enough for me to get it working.
* I would like to have the option to export the dependency graphs as images (to send people email with text like this "look, you project sucks bug time, look at this").

magland
2nd August 2007, 17:39
You can track the progress on the suggestions for HiQt here:

http://www.math.upenn.edu/~jfm/todo.html
(temporary site)

Send more feedback/requests, and I'll add to the list.

magland
4th August 2007, 14:08
Pleased to announce:
HiQt Version 0.1.15.c (http://www.qt-apps.org/content/show.php/Handcoder%27s+IDE+for+Qt+%28HiQt%29?content=62825)

Lots of new features and improvements.
One in particular is improved code navigation... a very useful "back" button, you'll have to see it in action.

Pepe
4th August 2007, 15:22
I know that HiQt requires Qt 4.3 to run, but can it be used to develop applications that use a lower version of Qt?

I have installed Qt 4.2.3, but I copied the Qt 4.3 dlls to the HiQt bin directory, so HiQt runs. Now I set the paths to Qt 4.2.3 directories (qmake, designer...) but the class browser doesn't work, even the path to ctags is correct.

I see this warning in console:


Unable to open documentation file: "C:\Qt\4.3.0\doc/html/qt.dcf"
Error reading documentation file: "C:\Qt\4.3.0\doc/html/qt.dcf"
QTextBrowser: Cannot open 'index.html' for reading
QTextBrowser: No document for index.html


I don't see any option to set the documentation path.

elcuco
4th August 2007, 16:02
That is because the GUI uses the path of the library to determinate the location of the docs. Funny, I never tought of your problem.

magland
4th August 2007, 16:05
I know that HiQt requires Qt 4.3 to run, but can it be used to develop applications that use a lower version of Qt?

I have installed Qt 4.2.3, but I copied the Qt 4.3 dlls to the HiQt bin directory, so HiQt runs. Now I set the paths to Qt 4.2.3 directories (qmake, designer...) but the class browser doesn't work, even the path to ctags is correct.

I see this warning in console:


I don't see any option to set the documentation path.

Thanks Pepe I'll fix that problem.

elcuco
4th August 2007, 16:18
Another configuration path, with default to the path of the Qt librarry running...?

magland
4th August 2007, 17:47
Edit: see next post*

Pepe, I reproduced your problem on my system, and I will fix it as elcuco suggests. However I am confused when you say "the class browser doesn't work"... it seems to work fine on my system even when using 4.2.1. Could you explain... do the classes just not appear? ... and are you using HiQt 0.1.15.c?



I know that HiQt requires Qt 4.3 to run, but can it be used to develop applications that use a lower version of Qt?

I have installed Qt 4.2.3, but I copied the Qt 4.3 dlls to the HiQt bin directory, so HiQt runs. Now I set the paths to Qt 4.2.3 directories (qmake, designer...) but the class browser doesn't work, even the path to ctags is correct.

I see this warning in console:


I don't see any option to set the documentation path.

magland
4th August 2007, 20:29
Pepe, disregard my last reply... I was able to reproduce the problem with Qt 4.2.x... no class/file browser... . This has to do with the "qmake-HiQt" component. The problem is that qmake-HiQt.exe is seeing your 4.3.0 .dlls as well...

I'll have this fixed in the next release (2-3 days).

Thanks for bringing it to my attention!

magland
5th August 2007, 07:49
Okay Pepe, here's the workaround for now:

Simply copy your mkspecs and doc directories from c:\Qt\4.2.3 to directories called c:\Qt\4.3.0\mkspecs and c:\Qt\4.3.0\doc. This should do the trick and work perfectly.

Let me know...


I know that HiQt requires Qt 4.3 to run, but can it be used to develop applications that use a lower version of Qt?

I have installed Qt 4.2.3, but I copied the Qt 4.3 dlls to the HiQt bin directory, so HiQt runs. Now I set the paths to Qt 4.2.3 directories (qmake, designer...) but the class browser doesn't work, even the path to ctags is correct.

I see this warning in console:


I don't see any option to set the documentation path.

Pepe
5th August 2007, 10:14
Simply copy your mkspecs and doc directories from c:\Qt\4.2.3 to directories called c:\Qt\4.3.0\mkspecs and c:\Qt\4.3.0\doc. This should do the trick and work perfectly.

Yes, that works, thanks.

Anyway I hope you can fix it the right way. Otherwise this problem could arise if you later decide to distribute a stand-alone binary package (with Qt dlls or statically linked).

I have other suggestions, for the settings dialog (Tools->Settings):
- it would be nice if you add some "select..." buttons so the user could choose the paths in a file dialog, instead of having to type the paths.

- as it seems that ctags.exe, doxygen.exe and dot.exe are included in your package, I think the default path for them should be relative instead of absolute. This way the paths will be correct after an update.

I explain: you install HiQt 0.1.14 in c:\HiQt-win-0.1.14 and run it for the first time. HiQt creates default paths for that programs (which are right). But then you upgrade to 0.1.15 installing it in c:\HiQt-win-0.1.15 (and delete the folder with the previous version). Now the paths for ctag.exe and others are wrong. They point to the old folder, so the user has to change them manually.
If the default paths were "..\3rdparty\ctags\ctags.exe" and so on, that wouldn't happen, they will keep working between upgrades.

I have another problem: I can't compile anything. It says that it can't find g++ :( (it's not in the path)

And one question: where are the files created by doxygen saved?

magland
5th August 2007, 14:55
Thanks for the comments and suggestions. I'll make those changes for 0.1.16, couple days. Regarding finding g++, you need to add MinGw\bin to your path... but I think I should make some kind of configuration option for this as well. Overall the configuration dialog will be improved.


Yes, that works, thanks.

Anyway I hope you can fix it the right way. Otherwise this problem could arise if you later decide to distribute a stand-alone binary package (with Qt dlls or statically linked).

I have other suggestions, for the settings dialog (Tools->Settings):
- it would be nice if you add some "select..." buttons so the user could choose the paths in a file dialog, instead of having to type the paths.

- as it seems that ctags.exe, doxygen.exe and dot.exe are included in your package, I think the default path for them should be relative instead of absolute. This way the paths will be correct after an update.

I explain: you install HiQt 0.1.14 in c:\HiQt-win-0.1.14 and run it for the first time. HiQt creates default paths for that programs (which are right). But then you upgrade to 0.1.15 installing it in c:\HiQt-win-0.1.15 (and delete the folder with the previous version). Now the paths for ctag.exe and others are wrong. They point to the old folder, so the user has to change them manually.
If the default paths were "..\3rdparty\ctags\ctags.exe" and so on, that wouldn't happen, they will keep working between upgrades.

I have another problem: I can't compile anything. It says that it can't find g++ :( (it's not in the path)

And one question: where are the files created by doxygen saved?

magland
6th August 2007, 17:52
Version 0.1.16: http://www.qt-apps.org/content/show.php/Handcoder%27s+IDE+for+Qt+%28HiQt%29?content=62825

* Support for developing with previous versions of Qt. (Pepe, see readme.html.)
* Improved configuration dialog.
* Save Doxygen-generated documentation to file.
* Significantly reduced compilation time (qmake-HiQt trimmed way down)
* Others...

Pepe
7th August 2007, 11:03
Hi, I've just downloaded this new version.

After doing what the readme.html says, yes it works with Qt 4.2.3 :) The class browser works, the documentation view shows the docs, compilation also works (althought Build->Run does not).

But there's a problem. For some reason now the code completion doesn't work.

I type:


logo = new QLabel(this);
logo->


Nothing happens. In the previous version a list with functions appeared.

Suggestion: the new configuration dialog, it says that some of the fields are not testable (like assistant or designer) but I think at least you could check if the binary exists in that path.

Update: no, compilation doesn't work :( It worked before 'cos I ran HiQt from a Qt Command prompt, where C:\MinGW\bin is in the path, but if I run HiQt by double clicking in its icon then compilation doesn't work, can't find g++

magland
7th August 2007, 12:52
Pepe, I can see why code completion is not working for you, and I'll fix that for the next release. But for now, here's the temporary work-around: copy your c:\qt\4.2.1\include to c:\qt\4.3.0\include.

Edit: also you'll need to copy c:\qt\4.2.1\src over as well :).

Regarding c:\mingw\bin being in your path... I intend to make a configuration option to add such things to the path. However, why don't you just add it to your system path environment variable: Control Panel->Settings->Environment variables ?

I will also make "designer" and "assistant" testable as you suggest.

Regards

Pepe
7th August 2007, 14:43
Regarding c:\mingw\bin being in your path... I intend to make a configuration option to add such things to the path. However, why don't you just add it to your system path environment variable: Control Panel->Settings->Environment variables ?

Sorry but I can't find that option.

(My system is in Spanish and I don't know which icon is for "settings", anyway I tried some of them and none has any option to add environment variables).

Edit: I finally found it (explained here (http://support.microsoft.com/kb/310519)). Now compilation works ok.

BTW, I experienced some crashes when moving the doc view to another dock area. These are the latest lines in the log (I don't know if they will useful or not):


check_for_files_modified_outside_editor(); begin
check_for_files_modified_outside_editor(); end
check_for_reload_projects(); begin
check_for_reload_projects(); end
update_navigation_window_if_visible(); begin
update_navigation_window_if_visible(); end
update_visible_files(); begin
update_visible_files(); end
check_for_files_modified_outside_editor(); begin
check_for_files_modified_outside_editor(); end
check_for_reload_projects(); begin
check_for_reload_projects(); end
update_navigation_window_if_visible(); begin
update_navigation_window_if_visible(); end
perhaps update_classmodel; begin
perhaps update_classmodel; end
check_for_files_modified_outside_editor(); begin
check_for_files_modified_outside_editor(); end
check_for_reload_projects(); begin
check_for_reload_projects(); end
update_navigation_window_if_visible(); begin
update_navigation_window_if_visible(); end
update_current_window_highlighting(); begin
update_current_window_highlighting(); end

magland
7th August 2007, 17:58
BTW, I experienced some crashes when moving the doc view to another dock area. These are the latest lines in the log (I don't know if they will useful or not):

I was able to reproduce that crash on my system and will look into it... thanks for the report!

Update: Crash fixed and uploaded new version: 0.1.17

Pepe
9th August 2007, 22:55
I tested version 0.1.17. This version has fixed almost all problems: the class browser works, code completion works, even some kind of tooltip appears to reminds you the parameters of the function, which I find extremely useful.

Anyway there's still something that doesn't work: Build->Run. Even I have added C:\Qt\4.2.3\bin to the path nothing happens when I select that option. There's a message in the console saying that it's running the executable (the path that appears is right).

magland
10th August 2007, 02:26
I tested version 0.1.17. This version has fixed almost all problems: the class browser works, code completion works, even some kind of tooltip appears to reminds you the parameters of the function, which I find extremely useful.

Anyway there's still something that doesn't work: Build->Run. Even I have added C:\Qt\4.2.3\bin to the path nothing happens when I select that option. There's a message in the console saying that it's running the executable (the path that appears is right).

Pepe, I believe this is a subtle problem having to do with your program somehow seeing the 4.3.0 libraries instead of the 4.2.3 when it is launched from within HiQt.... (I assume the program works fine when you launch it from, say, windows explorer?) Can you please confirm whether this is the same behavior when you compile and run a simple Qt example program, say from the 4.2.3 examples?

I have an idea of how to fix, and I may just send you a patched version of 0.1.17 once you respond regarding above points.

BTW, so you saw the "qt_include_path" configuration parameter I assume?

Hang in, because next release will have option of QScintilla editor.

Cheers

Pepe
10th August 2007, 08:39
(I assume the program works fine when you launch it from, say, windows explorer?)

Yes.


Can you please confirm whether this is the same behavior when you compile and run a simple Qt example program, say from the 4.2.3 examples?

I think the problem could be related to paths with spaces.

I tried with one of the Qt examples (C:\Qt\4.2.3\examples\mainwindows\application) and Build->Run works. But if I copy it to C:\Documents and Settings\Pepe\My Documents (compile it again) then Build->Run does not work.


BTW, so you saw the "qt_include_path" configuration parameter I assume?

Yes.

magland
10th August 2007, 13:50
I think the problem could be related to paths with spaces.
I tried with one of the Qt examples (C:\Qt\4.2.3\examples\mainwindows\application) and Build->Run works. But if I copy it to C:\Documents and Settings\Pepe\My Documents (compile it again) then Build->Run does not work.

So, if you move your non-qt-example program to a path without spaces does it run? If so, your problem is solved for now, - just don't develop within "documents and settings" and the like.

I will try to fix this problem for next release. Does anybody know the best way to use QProcess::start with a program with spaces in the path?

Pepe
10th August 2007, 22:59
I changed line 957 in HiQtMainWindow.cpp:


process->start(targetpath);


with



process->start("\""+targetpath+"\"");


and now it works.

QTmplayer
31st August 2007, 00:35
Hello
First of all: Great work. Especially when in version 0.2.0 there will be line numbers etc...

But what I would like to suggest is one improvement/change concerning the code completion. Let's say there are two functions funcOne and funcTwo. Let's assume they are member functions of some class X and when I have an object obj of X and I write:

obj->funcO
the right item funcOne is selected. So far so good.

Now it would be really nice if when I type 'funcO' and then '(' it would be the same as pressing enter, i.e. after the '(' the completion would insert:

obj->funcOne(

I hope this is possible, as it would imho improve the workflow.

Regards

magland
31st August 2007, 02:13
Hello
First of all: Great work. Especially when in version 0.2.0 there will be line numbers etc...

Thanks, I think you will like 0.2.0... :)



But what I would like to suggest is one improvement/change concerning the code completion. Let's say there are two functions funcOne and funcTwo. Let's assume they are member functions of some class X and when I have an object obj of X and I write:

obj->funcO
the right item funcOne is selected. So far so good.

Now it would be really nice if when I type 'funcO' and then '(' it would be the same as pressing enter, i.e. after the '(' the completion would insert:
[CODE]obj->funcOne([/CODE

I hope this is possible, as it would imho improve the workflow.

Regards

Actually, QTmplayer, that functionality was in the original versions, but I took it out for the following reason: Suppose the code completions was not 100% accurate, and it missed some funky function called , say "funcO" to go a along with your example. Then I would like to override the completion list and just type funcO(, but that of course would give the undesired result.

Nevertheless, it's easy enough to put in a check box in the preferences called "Complete code on open parenthesis". so I'll make a note to put it in for 0.2.0 :)

magland
5th September 2007, 14:28
HaiQ 0.2.0 for Windows released! (http://www.qt-apps.org/content/show.php/Handcoder%27s+IDE+for+Qt+%28HiQt%29?content=62825)

Lots of changes... hope you like it.

magland
7th September 2007, 16:09
This thread will be closed, and the discussion will continue in a separate thread.