Page 2 of 11 FirstFirst 1234 ... LastLast
Results 21 to 40 of 216

Thread: QCodeEdit

  1. #21
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    The new version of QCodeEdit bringing a new approach on generic definitions is now available. The spec has evolved a lot :
    • Each syntax element is represented by an "entity", which can be of various type
    • Entity have a name which correspond to the tag name of an XML element
    • There are no built-in entities... Entities implementation (actually they are private components) are loaded from plugins
    • The syntactic rules and formatting data are now split into two XML files
    • Formats can be inherited. i.e if an entity do not specify a format key it automatically grabs one from its first parent that supply one.
    The entities are of two types. "Primitives" which, just like in gfx, are small elements that perform "real" tasks and "complex" which combines several "primitives" according to predefined rules.

    Available "primitive" standards entities are :
    • Sequence entity (<sequence> tag) : match a character sequence
    • Word entity (<word> tag) : match a word i.e. a sequence of word characters delimited by non words characters
    • Special entity (<special> tag) : match a special character (e.g an end-of-line)
    Available "primitive" standards entities are :
    • Context entity (<context> tag) : the most interesting one. match a start entity (if any specified) then processes children until a stop entity (if any) is matched. Supports two other handy special children : escape and jump. The first one should be self explanatory. The second corresponds to an entity that MUST be matched in order to span over several lines if stop entity is valid but did not match in the current line.
    • List entity (<list> tag) : a list of entities among which one must match (i.e it's basically a convinient OR). In addition it supports prefix and suffix which may or may not be mandatory
    Along with these (already sufficient to craft a syntax definition for most (if not all) existing programming languages) come another that can't be classified easily :
    • Href entity (<href> tag) : all entities can have an id attribute and this entity allow reducing code duplication by referencing an existing entity through its id. For more flexibility the href can be resolved either on build or on first call to one of its method or every time a method is called.
    The code available on SVN already handle highlighting very well but do not yet perform any of the other generic tasks (parenthesis matching, text indenting and code folding) thus, due to some internal dependencies, completion is no longer working but don't worry... it'll come back soon (maybe next monday if I find enough time to hack it back )

    Note : the plugin system used by QCodeEdit generic components is very flexible and light-weight. For convinience I did not put it directly inside QCodeEdit but as another Edyuk 3rdparty module. You can grab it this way :
    $ svn checkout http://edyuk.svn.sourceforge.net/svn.../qpluginsystem qpluginsystem
    Also note that for compilation to succeed, qpluginsystem and qcodeedit dirs grabbed from SVN must be at the same level i.e. a dir tree might look like this :
    prog
    |-- qcodeedit
    |-- qpluginsystem
    |-- etc..
    Current Qt projects : QCodeEdit, RotiDeCode

  2. #22
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    QCodeEdit 2 is on the road!

    This new version bring speed and lower memory usage by dropping QTextDocument. Yet, it keeps most (if not all) it non-rich-text-related features (i.e. bidi rendering, smart cursors, ...). This is achieved by mixing a homemade rendering and QTextLayout, the latter being summoned only when really needed which helps preserving the performance and memory gains for anyone who don't need such fancy features (are there much coders that write anything but english in their sources anyway???).

    Other important progress have been made since my last report here :
    • the panel system evolved quite a lot and those enjoying the firefox-like search panels should be happy enough
    • the highlighting engine also evolved a great deal. The use of NFAs, discussed in another thread, made it way faster than it ever had been and also a lot more flexible
    • the API become simpler and the code lighter

    The code is available, through SVN, here : https://edyuk.svn.sf.net/svnroot/edy...ty/qcodeedit2/

    I'd be glad to get as much feedback as possible to improve it and make it a solid codebase for text editing applications. Feedback about bidi handling would be especially valued since I can't really know how good it is being an evil Westerner which only uses Latin-1 charset.
    Current Qt projects : QCodeEdit, RotiDeCode

  3. #23
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    After having a quick glance at QCodeEdit 2, elcuco urged me to do some benchmarks since I claimed my newborn to be MUCH better than QTextDocument, QTextEdit and co.

    Even without considering everything what comes build in in QCodeEdit (line numbers, line marks, folding, generic highlighting definition, foundations for completion, ...) and lacks in the concurrent, these results should be enough to assert the advantage of using QCodeEdit (or at least something that does not rely on QTextDocument ).

    Notes :
    • The archive holds a spreadsheet which sums up the benchmarks result but also the benchmarks output files from which it has been filled...
    • The full code for the benchmarking tool and the files used to benchmark are available in the "benchmark" subdir of the SVN repository mentioned in my previous post
    Current Qt projects : QCodeEdit, RotiDeCode

  4. #24
    Join Date
    Feb 2007
    Location
    Philadelphia, USA
    Posts
    255
    Thanks
    43
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QCodeEdit

    Looks promising... When will QCodeEdit 2 be available for use? I tried downloading from svn using below address but was unable to connect.

  5. #25
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Quote Originally Posted by magland View Post
    I tried downloading from svn using below address but was unable to connect.
    You can't "download" from SVN but, provided you have a Subversion client installed, you can "checkout" the content of a repository... The code is already available through SVN but no package will be issued before at least a week...
    Current Qt projects : QCodeEdit, RotiDeCode

  6. #26
    Join Date
    May 2006
    Location
    Germany
    Posts
    108
    Thanks
    2
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    I have a little trouble getting QCodeEdit2 to compile on Ubuntu Feisty, see this log:
    daehlith@nurse:~/projects/edyuk/edyuk/trunk/3rdparty/qcodeedit2$ qmake -v
    QMake version 2.01a
    Using Qt version 4.3.0 in /usr/lib
    daehlith@nurse:~/projects/edyuk/edyuk/trunk/3rdparty/qcodeedit2$ qmake
    daehlith@nurse:~/projects/edyuk/edyuk/trunk/3rdparty/qcodeedit2$ make
    cd lib/ && make -f Makefile
    make[1]: Betrete Verzeichnis '/home/daehlith/projects/edyuk/edyuk/trunk/3rdparty/qcodeedit2/lib'
    g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQNFA_BUILD -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtXml -I/usr/include/qt4 -I. -Idocument -Ilanguage -Iwidgets -Iqxs -Iqnfa -I../../qpluginsystem -I.build -I.build -o .build/qsearchreplacepanel.o widgets/qsearchreplacepanel.cpp
    .build/ui_searchreplace.h: In member function »void Ui_SearchReplace::setupUi(QWidget*)«:
    .build/ui_searchreplace.h:56: Fehler: »class QVBoxLayout« hat kein Element namens »setLeftMargin«
    .build/ui_searchreplace.h:57: Fehler: »class QVBoxLayout« hat kein Element namens »setTopMargin«
    .build/ui_searchreplace.h:58: Fehler: »class QVBoxLayout« hat kein Element namens »setRightMargin«
    .build/ui_searchreplace.h:59: Fehler: »class QVBoxLayout« hat kein Element namens »setBottomMargin«
    .build/ui_searchreplace.h:73: Fehler: »class QHBoxLayout« hat kein Element namens »setLeftMargin«
    .build/ui_searchreplace.h:74: Fehler: »class QHBoxLayout« hat kein Element namens »setTopMargin«
    .build/ui_searchreplace.h:75: Fehler: »class QHBoxLayout« hat kein Element namens »setRightMargin«
    .build/ui_searchreplace.h:76: Fehler: »class QHBoxLayout« hat kein Element namens »setBottomMargin«
    .build/ui_searchreplace.h:169: Fehler: »class QHBoxLayout« hat kein Element namens »setLeftMargin«
    .build/ui_searchreplace.h:170: Fehler: »class QHBoxLayout« hat kein Element namens »setTopMargin«
    .build/ui_searchreplace.h:171: Fehler: »class QHBoxLayout« hat kein Element namens »setRightMargin«
    .build/ui_searchreplace.h:172: Fehler: »class QHBoxLayout« hat kein Element namens »setBottomMargin«
    make[1]: *** [.build/qsearchreplacepanel.o] Fehler 1
    make[1]: Verlasse Verzeichnis '/home/daehlith/projects/edyuk/edyuk/trunk/3rdparty/qcodeedit2/lib'
    make: *** [sub-lib-make_default] Fehler 2
    daehlith@nurse:~/projects/edyuk/edyuk/trunk/3rdparty/qcodeedit2$
    Sorry that these error message are german, but its just the compiler complaining about missing functions. Solution?
    Last edited by jacek; 30th July 2007 at 21:47. Reason: changed [code] to [quote]
    "If you lie to the compiler, it will get its revenge." - Henry Spencer

  7. #27
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Quote Originally Posted by Methedrine View Post
    Sorry that these error message are german, but its just the compiler complaining about missing functions. Solution?
    This has been discussed in Edyuk thread already : Qt Designer from Qt 4.3.0 generates ui files that uic from Qt 4.2 can not turn into proper code since margin managements of layout has changed... There are several ways to get rid of this :
    • switch to Qt 4.3.0 (obvious but not always affordable)
    • modify ui files (either by hand or, possibly, through designer from Qt 4.2) to replace new properties by old, backward compatible ones
    • wait for the Trolls to fix this (I've submitted a bug report, just wait and see...)
    Current Qt projects : QCodeEdit, RotiDeCode

  8. #28
    Join Date
    May 2006
    Location
    Germany
    Posts
    108
    Thanks
    2
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Quote Originally Posted by fullmetalcoder View Post
    This has been discussed in Edyuk thread already : Qt Designer from Qt 4.3.0 generates ui files that uic from Qt 4.2 can not turn into proper code since margin managements of layout has changed... There are several ways to get rid of this :
    • switch to Qt 4.3.0 (obvious but not always affordable)
    • modify ui files (either by hand or, possibly, through designer from Qt 4.2) to replace new properties by old, backward compatible ones
    • wait for the Trolls to fix this (I've submitted a bug report, just wait and see...)
    I am using Qt 4.3.0 obviously. Guess I have to edit it by hand then.
    "If you lie to the compiler, it will get its revenge." - Henry Spencer

  9. #29
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Quote Originally Posted by Methedrine View Post
    I am using Qt 4.3.0 obviously.
    I did not even spot that... It's much weirder then... try out re-generating the header file from the ui (make distclean && qmake && make OR "dummy edit" in the .ui)

    Quote Originally Posted by Methedrine View Post
    Guess I have to edit it by hand then.
    Try a dummy edit first, to see if your uic version still generates a faulty code and feed me back... The bug submitted to TT might prove broader than expected...
    Current Qt projects : QCodeEdit, RotiDeCode

  10. #30
    Join Date
    May 2006
    Location
    Germany
    Posts
    108
    Thanks
    2
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Quote Originally Posted by fullmetalcoder View Post
    I did not even spot that... It's much weirder then... try out re-generating the header file from the ui (make distclean && qmake && make OR "dummy edit" in the .ui)
    Thank you, make distclean solved the issue. Should have checked that myself first, actually. Anyway, worked now
    "If you lie to the compiler, it will get its revenge." - Henry Spencer

  11. #31
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Quote Originally Posted by Methedrine View Post
    Anyway, worked now
    Nice to hear! Please feed me back. All suggestions, feelings and bug reports are relevant. QCodeEdit is meant to be usable and useful (i.e. to fulfil both users and coders need )

    Time for fun has just come. Here's the last eye-candy : the generic highlighting definition for XML being displayed to test itself. I'm quite proud of the efficiency of it, especially relatively to its small size and human-readability!

    BTW if you feel like creating new syntax definitions please do it. The 5 existing ones are far from being complete, though sufficient for Edyuk until now (C++, Doxygen, Python, C# and XML)
    Attached Images Attached Images
    Current Qt projects : QCodeEdit, RotiDeCode

  12. #32
    Join Date
    May 2006
    Location
    Germany
    Posts
    108
    Thanks
    2
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Hey,

    is there any update on the QCodeEdit / QCodeModel 2 development? :-)

    The framework looked fairly impressive the last time I checked it out.
    "If you lie to the compiler, it will get its revenge." - Henry Spencer

  13. #33
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Quote Originally Posted by Methedrine View Post
    is there any update on the QCodeEdit / QCodeModel 2 development? :-)

    The framework looked fairly impressive the last time I checked it out.
    There have loads of improvements since I last talked about it here but since I did not get much feedback I stopped reporting progress.... The code is still available through in Edyuk SVN trunk and be tested both independently (a minimal example is provided) and within Edyuk. QCodeModel 2 is fairly mature (try out Edyuk completion... ) and QCodeEdit 2 works pretty well but it will need more testing/polishing before I can release anything (the search functionnalities are quite limited ATM for instance).
    Current Qt projects : QCodeEdit, RotiDeCode

  14. #34
    Join Date
    May 2007
    Location
    England
    Posts
    56
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    This editor looks like it could be very useful to me. In particular I like the ability to extend the syntax highlighting just with XML, as I have a couple of obscure languages I want to support.

    I have it starting up inside my application, but cannot figure out how to make it go to a chosen line number. I need this for locating items in the source when the user clicks on them in my structure view.

    Is this possible?
    I am using the version from Edyuk beta 3.

    Thanks in advance.

  15. #35
    Join Date
    May 2007
    Location
    England
    Posts
    56
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    And another thing...
    Does it work on your machine with a variable width font? Here, unless I go for the default fixed with font, selecting part of a line causes corruption of the text. For example, choose a proportional font, and select a the word in the middle of a line and let me know if the line is still readable for you.

  16. #36
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Quote Originally Posted by Usability View Post
    And another thing...
    Does it work on your machine with a variable width font? Here, unless I go for the default fixed with font, selecting part of a line causes corruption of the text. For example, choose a proportional font, and select a the word in the middle of a line and let me know if the line is still readable for you.
    As it was meant to be a code editor I decided, to make it both simpler to code and faster to run, to restrict the fonts to fixed width... With some slight modifications in a few spots it could be adapted to support variable width fonts but do you really need this???

    As for going to a given line it is extremely simple :
    Qt Code:
    1. // editor being of type QEditor*
    2. editor->setCursor(editor->document()->cursor(line, colum));
    To copy to clipboard, switch view to plain text mode 


    If you want to use bleeding edge QCodeEdit you can get it from Edyuk SVN repository...

    P.S : if you bring support for new languages (or improve the existing ones) please consider sending me the new syntax definition files
    Current Qt projects : QCodeEdit, RotiDeCode

  17. #37
    Join Date
    May 2007
    Location
    England
    Posts
    56
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Quote Originally Posted by fullmetalcoder View Post
    As it was meant to be a code editor I decided, to make it both simpler to code and faster to run, to restrict the fonts to fixed width... With some slight modifications in a few spots it could be adapted to support variable width fonts but do you really need this???
    I am trying to make this interface as attractive as possible, and would be reluctant to restrict the users choice of fonts so harshly.

    Quote Originally Posted by fullmetalcoder View Post
    As for going to a given line it is extremely simple :
    Qt Code:
    1. // editor being of type QEditor*
    2. editor->setCursor(editor->document()->cursor(line, colum));
    To copy to clipboard, switch view to plain text mode 
    This worked a treat, thanks!

    Quote Originally Posted by fullmetalcoder View Post
    P.S : if you bring support for new languages (or improve the existing ones) please consider sending me the new syntax definition files
    The plan is that the application I am writing will one day be released commercially. So my use of this editor assumes that you are willing to release the code with a commercial license. Obviously you would expect something in return, so we could pay you or contribute all the language templates we create. Do you have a price for commercial use?

  18. #38
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Quote Originally Posted by Usability View Post
    The plan is that the application I am writing will one day be released commercially. So my use of this editor assumes that you are willing to release the code with a commercial license. Obviously you would expect something in return, so we could pay you or contribute all the language templates we create. Do you have a price for commercial use?
    I have nothing against releasing my code under a commercial license and I'm sure we could find an agreement on the "price" (the word is way softer when it's something you get than when you have to pay it ) if it were legally possible... What I mean is simple : I wrote QCodeEdit using Qt Open Source Edition and I'll probably never be able to use a Commercial Edition so I don't know if I am allowed to release my code under a commercial license, even if you DO have a Qt Commercial Edition... I guess we'd need to discuss this with Trolltech...
    Last edited by fullmetalcoder; 21st October 2007 at 16:52. Reason: spelling error
    Current Qt projects : QCodeEdit, RotiDeCode

  19. #39
    Join Date
    May 2007
    Location
    England
    Posts
    56
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    I just started creating a new language file, and have a quick question.
    The language I am creating is not case sensitive, i.e. Begin, BEGIN, begin, bEGIN etc are all keywords, indeed all the same keyword.
    Is there some tag I can insert into a .qnfa file to instruct it do case insensitive comparisons?

    Thanks in advance.

  20. #40
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Quote Originally Posted by Usability View Post
    I just started creating a new language file, and have a quick question.
    The language I am creating is not case sensitive, i.e. Begin, BEGIN, begin, bEGIN etc are all keywords, indeed all the same keyword.
    Is there some tag I can insert into a .qnfa file to instruct it do case insensitive comparisons?
    There's no such tag ATM but I'll add it ASAP... Keep an eye on the SVN...
    Current Qt projects : QCodeEdit, RotiDeCode

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.