Results 1 to 7 of 7

Thread: qtsourceview

  1. #1
    Join Date
    Jan 2006
    Posts
    368
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default qtsourceview

    This is a demo of a syntax highlighter done in C++/Qt.
    The code is extraeamly non optimized, but it does work most of the time.
    The class is very slow, so please don't use it on large files.

    The syntax highlighter definitions are the same ones used by the gtksourceview library
    for gtk. The definitions are passed to a class which does the highligting. This means
    that the engine is not aware of what he is coloring, and adding new languages is as
    trivial as adding new XML to the langs directory.

    The code is very rough, and *slow*, but I am planning in fixing it up until it becomes usable.

    http://kde-apps.org/content/show.php?content=43030

  2. #2
    Join Date
    Jan 2006
    Posts
    368
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qtsourceview

    Version 0.0.2 has been released.

    Better documentation, some speed ups, better code, more hightlights (even a *.pro which I did specially for this release). All the demos are made using the designer, and some I even coded with QIde ;-)

    http://kde-apps.org/content/show.php?content=43030

  3. #3
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Thanks
    76
    Thanked 37 Times in 32 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qtsourceview

    with ref to the previous version
    the highlighting of float does not work correctly

    a float const 0.00001
    will be highlighted as 0. as float
    and 00001 as Hexa
    We can't solve problems by using the same kind of thinking we used when we created them

  4. #4
    Join Date
    Jan 2006
    Posts
    368
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qtsourceview

    Hi,

    Sorry for the late response. Did it work on v0.0.1? on my box (qt42 rsync, suse 10.0) i see the problem in v0.0.1 and v0.0.2.

    BTW, if anyone us using qt4 rsync, here is a patch for those versions. it seems the trolls are deprecating some old functions which I was using.

    Qt Code:
    1. diff -ru qtsource-1/src/qsvlangdeffactory.cpp qtsource-3/src/qsvlangdeffactory.cpp
    2. --- qtsource-1/src/qsvlangdeffactory.cpp 2006-07-22 19:06:06.000000000 +0300
    3. +++ qtsource-3/src/qsvlangdeffactory.cpp 2006-09-02 15:36:49.000000000 +0300
    4. @@ -61,7 +61,7 @@
    5. // if do we recognize the mime type defined in that
    6. // syntax highligh definition, check if matches this file
    7.  
    8. - if ( mimeTypes.find(langMimeType) )
    9. + if ( mimeTypes.contains(langMimeType) )
    10. {
    11. for ( int j=0; j<mimeTypes[langMimeType].count(); j ++ )
    12. {
    To copy to clipboard, switch view to plain text mode 

  5. #5
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Thanks
    76
    Thanked 37 Times in 32 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qtsourceview

    Even in version 0.2 I could find the same problem .
    So I rearranged the regex for the Hexa and floats

    i.e in the lang files i Put the floats after the hexa. so floats gets painted after hexa.

    And the regex fails to detect .001 as float.
    And floats can have 10e-2
    the negetive is omitted in the regex

    In python.lang strings are not detected. something wrong with the regex i believe.
    We can't solve problems by using the same kind of thinking we used when we created them

  6. #6
    Join Date
    Jan 2006
    Posts
    368
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qtsourceview

    Hi,

    The problems are not with the regex, since all of them were borrowed from GtkSourceView. Since the GTK widget displays the syntaxes correctly, the only conclusion is that the bug is in the QtSourceView source - my code.

    The way I am handling the regex in the source is plain stupid. I need to recode that part and using proper contexts. It's on my TODO list, but I am postponding it, and I will handle this re-write in a few weeks.

    If you can fix the non working code, a patch will be cool. You know my email.

  7. #7
    Join Date
    Jan 2006
    Posts
    368
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qtsourceview - v0.0.3

    After more then 5 years since the last release, I am releasing V0.0.3.

    The code now shows a widget for editing text, based on QPlainTextEdit, and two syntax hilighters: the one in version 0.0.2, and a new one base on the source of QtCreator, which is based on the Kate.

    My focus will be from now on to port the qate syntax highlighter to be more usable as a stand alone, embeddable text editor widget.

    Code is available here:
    http://code.google.com/p/qtedit4/wiki/QtSourceView
    http://qtedit4.googlecode.com/files/...w-0.0.3.tar.gz

    The source contains also the Doxygen generated documentation. Feel free to download and comment.
    Attached Images Attached Images

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.