Page 10 of 11 FirstFirst ... 891011 LastLast
Results 181 to 200 of 216

Thread: QCodeEdit

  1. #181
    Join Date
    Jan 2008
    Posts
    22
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QCodeEdit

    Quote Originally Posted by fullmetalcoder View Post
    • try to synchronize the scrolling with the mouse movement (the mouse often goes out of the rectangle and the end of the scroll is a bit trickier...)
    • allow quick jumps through single (or double, at your option) mouse clicks
    • make it possible to change the width of the panel, through a splitter or a context menu
    1. yes, i know. this is one of the points why i said it is not perfect yet.
    2. i thought about that either.
    3. i didn't make up my mind yet how to do that. i'll tinker with that a bit.

    further more, i'd like to have syntax highlightning and a magnifier in the panel. i hoped you'll do the syntax highlightning stuff

    btw, how to get the linespacing used in the editor?

  2. #182
    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 NoobSaibot View Post
    3. i didn't make up my mind yet how to do that. i'll tinker with that a bit.
    I think the context menu will do. Just add one. A "change width" action would popup an input dialog asking for a width (in pixel most probably) which would be set using setFixedWidth() just like you do in the ctor already.

    Quote Originally Posted by NoobSaibot View Post
    further more, i'd like to have syntax highlightning and a magnifier in the panel. i hoped you'll do the syntax highlightning stuff
    Qt Code:
    1. QDocumentLineHandle::draw()
    To copy to clipboard, switch view to plain text mode 
    will do what you want provided that you fed it with proper parameters. It is part of the private API and thus requires including qdocument_p.h You can find out more about how to use it by reading the code of QDocumentPrivate::draw() in qdocument.cpp
    AFAIK all you'd have to do would be to scale and translate the painter properly to achieve the minimap effect with highlighting.

    Quote Originally Posted by NoobSaibot View Post
    btw, how to get the linespacing used in the editor?
    Qt Code:
    1. QDocument::fontMetrics()
    To copy to clipboard, switch view to plain text mode 
    is a static function which returns a QFontMetrics object initialized with the global font currently used. It should give you all the needed document metrics, including line spacing.
    Current Qt projects : QCodeEdit, RotiDeCode

  3. The following user says thank you to fullmetalcoder for this useful post:

    NoobSaibot (10th February 2008)

  4. #183
    Join Date
    Jan 2008
    Posts
    22
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QCodeEdit

    1. can't use draw function due to uncomplete struct QSmallArray qdocument_p.h is included!

    /edit: nevermind, got it.

    do i have to

    1. create a new QDocumentLineHandle pointer
    2. draw the line
    3. call deref() on this pointer?
    Last edited by NoobSaibot; 10th February 2008 at 18:45.

  5. #184
    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 NoobSaibot View Post
    1. can't use draw function due to uncomplete struct QSmallArray qdocument_p.h is included!
    Proposed fix :
    Qt Code:
    1. #include <QVarLengthArray>
    To copy to clipboard, switch view to plain text mode 
    Actually QSmallArray is just a convenience internal typedef for QVarLengthArray<int, 10>

    do i have to

    1. create a new QDocumentLineHandle pointer
    you can obtain the QDocumentLineHandle pointer through :
    Qt Code:
    1. QDocumentLine::handle()
    To copy to clipboard, switch view to plain text mode 
    Current Qt projects : QCodeEdit, RotiDeCode

  6. #185
    Join Date
    Jan 2008
    Posts
    22
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QCodeEdit

    there you go, version 0.2

    - some minor bugs fixed
    - mouse synced
    - syntax highlightning
    - nicer look

    /edit: i know there's a bug if the content of the document fits completely into the minimap panel. won't fix it today though.
    Attached Files Attached Files
    Last edited by NoobSaibot; 10th February 2008 at 21:36.

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

    Default Re: QCodeEdit

    I just noticed the code folding + and - buttons no longer work.
    I guess this was as a result of my enhancement request to make it easy to select the start of the line... Any chance you could process the fold request, then pass the click to the editor?

    Thanks.

  8. #187
    Join Date
    Jan 2008
    Posts
    22
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QCodeEdit

    here it is, the final -- and hopefully bugfree -- version of the minimappanel v0.4

    - mouse is now synchronised no matter how big the document height is
    - dynamic width of the panel reflects the width of the actual editor window, to show as much text as the actual editor shows.

    have fun
    Attached Files Attached Files

  9. #188
    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 noticed the code folding + and - buttons no longer work.
    I guess this was as a result of my enhancement request to make it easy to select the start of the line... Any chance you could process the fold request, then pass the click to the editor?
    I'll sort this out by next week end.

    @noobsaibot: sounds cool. I'll have a look at it.
    Current Qt projects : QCodeEdit, RotiDeCode

  10. #189
    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 noticed the code folding + and - buttons no longer work.
    I guess this was as a result of my enhancement request to make it easy to select the start of the line... Any chance you could process the fold request, then pass the click to the editor?
    Just checked : it works perfectly for me try updating your working copy and/or rebuilding your app... If it still doesn't work please send me some more details and I'll investigate this.

    @NoobSaibot: I've just tried out the last version. It wroks fine and look cool. One minor bug left : when some blocks of text are collapsed the "visible" square of the panel is "offsetted" somehow while the text displayed remain the same...
    Current Qt projects : QCodeEdit, RotiDeCode

  11. #190
    Join Date
    Jan 2008
    Posts
    22
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QCodeEdit

    try this one
    Attached Files Attached Files

  12. #191
    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
    Just checked : it works perfectly for me try updating your working copy and/or rebuilding your app... If it still doesn't work please send me some more details and I'll investigate this.
    It turns out I broke the folding in the fixes I made to get it to compile on MSVC6, which does not allow void functions to return data. I will have to look at this more carefully, perhaps the correct change would have been to change the declaration of the function.

    Anyway, false alarm. There is no problem with the folding, sorry to waste your time on that.

  13. #192
    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

    Despite the long silence QCodeEdit development has not halted. Actually those of you who tried Edyuk latest releases have seen it at work and probably spotted some of the most noticeable improvements.

    Anyway I got two things to announce right now :

    • QCodeEdit now has a website up and running
    • QCodeEdit 2.1 is available for download

    Hoping you'll like both.
    Current Qt projects : QCodeEdit, RotiDeCode

  14. #193
    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

    I'm still working on QCodeEdit and a new version will be available shortly but I'd like some more testing of the latest feature I've added as it was particularly hard to get it working fine and fast without breaking anything :

    QCodeEdit now has dynamic line wrapping (it does not honor word boundaries but it works)

    Lots of fixes and improvements have been made since last version so you are encouraged to try out the latest SVN version. If no bugs are found a new package will be released soon.

    regards
    Current Qt projects : QCodeEdit, RotiDeCode

  15. #194
    Join Date
    Nov 2008
    Posts
    33
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Hi

    just for information.

    I came across this post while trying to solve a problem with QSyntaxHighlight which does not seem to provide access to the current QTextBlock; at the moment, I'm trying to implement source-highlighting in Qt4 (and also Qt3) text editor by relying on GNU Source-highlight (http://www.gnu.org/software/src-highlite/), since I'm turning it also into a library; GNU Source-highlight uses its own syntax for language definition files (I don't like XML), which is powerful enough to deal with possible nested states.

    I'll take a look at QCodeEdit since it looks like it provides a better QSyntaxHighlighter.

    Do you think using GNU Source-highlight might help your editor too?

  16. #195
    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

    Thanks for the information. I gave a look to GNU source highlight. While I agree that XML may not be the most appropriate language for syntax files I don't like the format used by GNU source highlight (both a matter of taste and implementation related considerations).

    Theoretically it would be possible to either integrate GNU source highlight into QCE or provide support for these syntax definitions using the existing internals I am not willing to do it myself (though I would welcome any such contribution).

    Now some updates about QCodeEdit :

    • dynamic line wrapping works fine now (apart from bugfixes it means that it DOES break at word boundaries whenever possible and that cursor movement became more intuitive within wrapped blocks of text)
    • Lots of API has been added after user requests (there five projects that I know of currently using QCodeEdit )
    • formatting has been improved
    • there have been some significant speed improvements in drawing

    Future plans include:

    • encodings support (WIP)
    • session management API
    • more configuration options (especially GUI for changing formatting)
    • and a couple more exciting things (but in a slightly more distant future )
    Current Qt projects : QCodeEdit, RotiDeCode

  17. #196
    Join Date
    Nov 2008
    Posts
    33
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Quote Originally Posted by fullmetalcoder View Post
    Thanks for the information. I gave a look to GNU source highlight. While I agree that XML may not be the most appropriate language for syntax files I don't like the format used by GNU source highlight (both a matter of taste and implementation related considerations).
    could you expand on this?
    any feedback is more than welcome

  18. #197
    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

    Well, it is not very syntactically consistent (at least it does not look so). Also the syntax looks more script-ish than just descriptive (that is just a matter of taste I suppose). That's about all I can say after quickly reading the C syntax file, hope it helps.
    Current Qt projects : QCodeEdit, RotiDeCode

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

    Default Re: QCodeEdit

    I just pulled the latest revision of this editor and notice that it now detects external changes to the file, which is great.

    Unfortunately its indicating a conflict event even if the file is not changed in qcodeedit2, so there is no conflicting changes.

    In my opinion it should silently reload in this scenario, and save the nice conflict resolution queries it does for the occasions where there are unsaved edits.

  20. #199
    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

    your remark make a lot of sense. I'll make the needed changes ASAP.
    Current Qt projects : QCodeEdit, RotiDeCode

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

    Default Re: QCodeEdit

    Another thing I noticed is some odd interaction between the horizontal scroll bars and the status line. If an editor window is opened on a wide file so that the horizontal scroll bar is needed from the moment the window is created, then the status bar is garbled. See the attached image.

    If the window is then resized a modest amount the problem remains. If its resized to the point where the scroll bar is no longer needed, the status bar is drawn correctly. If the window is then shrunk again so the scroll bar reappears, this time its inserted correctly. So the problem is only there if the scroll bar is needed as the editor is opened.

    The screen shot came from the example editor app invoked like this.

    example/example example/window.cpp

    If you need further help reproducing this let me know. I am using bulid 770 from
    svn checkout http://edyuk.svn.sourceforge.net/svn...rty/qcodeedit2
    Attached Images Attached Images
    • File Type: jpg a.jpg (46.4 KB, 9 views)

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.