Page 6 of 11 FirstFirst ... 45678 ... LastLast
Results 101 to 120 of 216

Thread: QCodeEdit

  1. #101
    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 am having trouble writing the syntax file for a language that uses begin/end as the block start/end delimiters, like { and } in C.
    This should work AFAIK :
    Qt Code:
    1. <word format="keyword" parenthesis="be_block:open" indent="1" fold="1">begin</word>
    2. <word format="keyword" parenthesis="be_block:close" indent="1" fold="1">end</word>
    To copy to clipboard, switch view to plain text mode 

    Quote Originally Posted by Usability View Post
    A couple of related but somewhat pedantic questions. There seem to be some gremlins exposed by having begin and end markers on the same line. Try running the example editor, eg

    example/example

    And enter this:

    Qt Code:
    1. if (1) {;} else {
    2.  
    3.  
    4. }
    5. if {
    6.  
    7.  
    8. }
    To copy to clipboard, switch view to plain text mode 

    then collapse the fold starting on the if. For me this produces a corrupt screen showing three if lines. I appreciate that is an ugly example, and I wont be at all surprised if you choose to ignore it.
    I'll look into it. I can't ignore such a bug if I want the syntax engine to trully be generic...

    Quote Originally Posted by Usability View Post
    This one is a more reasonable code style.

    Qt Code:
    1. if (1) {
    2.  
    3.  
    4. } else {
    5.  
    6.  
    7. }
    To copy to clipboard, switch view to plain text mode 

    Here if you fold up the if statement it folds the complete program. I am not sure this is correct. I was expecting the else branch to remain expanded.
    This is correct... As I can place more than one collapse/fold marker per line I decided to fold "whole" blocks... I can try to change that behavior (and possibly make it configurable) but I'm not sure it would be worth the effort. (correct me if I'm wrong).
    Current Qt projects : QCodeEdit, RotiDeCode

  2. #102
    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've corrected all the reported issues so far (or so I believe...)and taken the opportunity to improve the example app a bit.

    I'm waiting for your feedback
    Last edited by fullmetalcoder; 24th November 2007 at 21:49.
    Current Qt projects : QCodeEdit, RotiDeCode

  3. #103
    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
    I've corrected all the reported issues so far (or so I believe...)and taken the opportunity to improve the example app a bit.

    I'm waiting for your feedback
    Thank you, everything looks good.

    Folding works as you say, thanks for the begin/end advice that fixes my problem here.
    I see find in selection working, and from cursor now the default.
    The crash on reload fixed.

    So back to no known defects Cool.

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

    Default Re: QCodeEdit

    Hi Fullmetalcoder.

    I gave a program containing this editor to a college for comments, and got this feedback.

    I'm really getting used to using this editor and growing more fond of it as the days go by, but there are a couple of minor suggestions/irritations:

    1) When scrolling up when the cursor moves up from the top line of the screen it causes an extra line to appear - when scrolling down and the cursor hits the bottom of the screen the next down causes the next page to appear and the cursor is now at the top of this screen. This is extremely irritating!

    2) When using find - what does the green button to the left of the string entry box do? When I click it it appears to do nothing.

    3) There is a tooltip on the close button for the find toolbar, but not on the "green" button or the find forward/reverse buttons

    4) When using the find forward button and then use the find reverse the first hit does not move onto the next match (the line number stays the same, but the column numbers change). The same is true when doing the reverse.

    5) If you do a forward find and then move the cursor to a line above the found string, then hit find forward again it goes to the next match (I would expect that because the line with the cursor is highlighted that the previous match would be highlighted again)

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

    Default Re: QCodeEdit

    Just noticed, prompted find/replace is broken. For example,
    example/example lib/qcodeedit.cpp

    Key ctrl-r, try and replace this with that. The settings I had were, match case, prompt on replace, from cursor.
    I get a box asking "Shall it be replaced?" Clicking yes has no effect (other than to close the QMessageBox).

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

    Default Re: QCodeEdit

    Following up my own post because I noticed the replacement IS made if you answer "No" to the "Shall it be replaced?" question....

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

    Default Re: QCodeEdit

    I find scrolling the editor sometimes makes it lock up when using proportional fonts.

    Here is a way that reproduces the problem every time on my machine at least.

    Change the example to use a proportional font by adding after line 47 of example/window.cpp this line
    m_editControl->editor()->document()->setFont(font());
    rebuild the example, then do this

    example/example lib/qeditor.cpp

    Scroll to the bottom by holding down the page down key. When you get to the bottom, scroll back to the top holding down page up. When the editor returns to the top, it should have locked up.

  8. #108
    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 gave a program containing this editor to a college for comments, and got this feedback.
    Neat!

    1. I'm not sure I understand this... Could you provide me with a screencast or a precise key sequence leading to this bug
    2. It is supposed to "refresh" the search context (see the QDocumentSearch class) but I guess I could remove it and use a couple signals/slots to make sure it (the search context remains up to date)
    3. There should be a tooltip on *all* buttons since the last commit
    4. I'm aware of that and I'll work on a proper fix ASAP
    5. This is a case where the "green button" should prove useful (but a proper signal/slot connection would probably be better... )
    6. About the wrong replacement behavior it will be pretty easy to fix (qdocumentsearch.cpp there is only one call to QMessageBox)
    7. I'll try to reproduce this (and fix it hopefully) ASAP
    Current Qt projects : QCodeEdit, RotiDeCode

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

    Default Re: QCodeEdit

    To clarify point 1. Try using the up/down cursor keys to move the cursor up and down the screen. When you use the down cursor to move to the next line, and you are already on the last line displayed, the editor jumps a complete screen full down the file.

    This is different behaviour than we see with the up cursor. If you move up when you are at the top line displayed, the editor scrolls the viewport up one line to keep the line containing the cursor at the top of the screen.

    We prefer the behaviour of the editor when the text cursor is moved up through the file, and hope you agree and will standardise on that. Certainly up and down should scroll in a consistant way.

  10. #110
    Join Date
    Jun 2007
    Posts
    11
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Hi,
    I got problems with variable width fonts - especially "Times New Roman" (I know you dont like Windows (and probably Windows Fonts), so do I, but it would be nice to be portable as much as possible).

    Bug: When I set font to Times New Roman, black vertical lines are appearing between lines.

    (Using svn 379)
    Attached Images Attached Images
    Last edited by allstar; 28th November 2007 at 18:45.

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

    Default Re: QCodeEdit

    .. lets hijack this thread to announce a pet project of mine...

    I have been working outside of QDevelop to develop another code editor control. It's not as sofisticated as the one beeing discussed here, but it has it's own ideas and strong points. If you still want to see, please visit: http://code.google.com/p/qtedit4/wiki/QsvEditorBeta
    Attached Images Attached Images

  12. #112
    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 allstar
    I got problems with variable width fonts - especially "Times New Roman" (I know you dont like Windows (and probably Windows Fonts), so do I, but it would be nice to be portable as much as possible).

    Bug: When I set font to Times New Roman, black vertical lines are appearing between lines.

    (Using svn 379)
    Unfortunately I can't test under windows so it's hard for me to find proper fixes for such graphical glitches... May you send me the font file so that I can at least try with the most problematic font? BTW does the font size affect the glitches? Try changing font size using CTRL+wheel...

    Quote Originally Posted by elcuco View Post
    .. lets hijack this thread to announce a pet project of mine...

    I have been working outside of QDevelop to develop another code editor control. It's not as sofisticated as the one beeing discussed here, but it has it's own ideas and strong points. If you still want to see, please visit: http://code.google.com/p/qtedit4/wiki/QsvEditorBeta
    Rather unkind of you but as the screenshot looks pretty enough and there are a couple of good ideas exposed on the homepage so I may forgive you .
    Among the important differences that you forgot to mention : the document model used is still QTextDocument (unless you changed your mind recently) hence poor performances and the source are vast and complicated to walk through while they do not offer that much more compared to QCodeEdit or QScintilla...
    Current Qt projects : QCodeEdit, RotiDeCode

  13. #113
    Join Date
    Jun 2007
    Posts
    11
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Ok, I am sending a video of the bug when using Ctrl+Wheel resizing.....
    It is not only Times New Roman also Arial. Some fonts are doing big mess. Others are OK.
    Bug.avi
    font.zip
    (I am not sure if the format used in linux fonts is the same.)

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

    • Fixed inconsitency of cursor moves when cursor left the displayed area
    • Fixed most (if not all) display glitches caused by variable width fonts
    • Fixed replacement prompt to work as expected
    • Fixed "double find" when searching forward and then backward (or the contrary)
    • Added "auto refresh" of search context : changing the position of the cursor while the panel is visible will now affect the start point of the next search.
    • Improved the speed of pageUp/pageDown by a factor 5 approximately by rewriting the related subroutines (may have fixed some bugs found when using these commands...)

    That's all for now (until you report more bugs )
    Current Qt projects : QCodeEdit, RotiDeCode

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

    allstar (4th December 2007)

  16. #115
    Join Date
    Jun 2007
    Posts
    11
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    The new version is much better. QCodeEdit is amazing.

    Unfortunately I found another bug: If you select some text and drag it, but NOT moving the mouse cursor from the selection, the text get copied right behind the selected text, when you release the mouse button. AFAIK this is not "normal" behaviour. The text shouldnt get coped when the mouse cursor is i still under the selected text.

  17. #116
    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 allstar View Post
    AFAIK this is not "normal" behaviour. The text shouldnt get coped when the mouse cursor is i still under the selected text.
    True enough. I'll fix this ASAP (this week end actually)
    Current Qt projects : QCodeEdit, RotiDeCode

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

    Current SVN version of QCodeEdit2 will not compile with MSVC 2005. MSVC 2005 does not support the following kind of construct in DLLs:
    Qt Code:
    1. static int a,b;
    To copy to clipboard, switch view to plain text mode 
    Instead, you have to write it this way:
    Qt Code:
    1. static int a;
    2. static int b;
    To copy to clipboard, switch view to plain text mode 

    Only qdocument_p.h is affected by this, though.

    Also, a little question: Would it be possible to use QCodeEdit with a custom parser and not the one it is shipped with?
    Last edited by Methedrine; 8th December 2007 at 18:58.
    "If you lie to the compiler, it will get its revenge." - Henry Spencer

  19. #118
    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 allstar
    AFAIK this is not "normal" behaviour. The text shouldnt get coped when the mouse cursor is i still under the selected text.
    Fixed.

    Quote Originally Posted by Methedrine View Post
    Current SVN version of QCodeEdit2 will not compile with MSVC 2005.
    [/code]Only qdocument_p.h is affected by this, though.
    Fixed. (I've not tested but applied the suggested patch which I hope will be enough...)

    Quote Originally Posted by Methedrine View Post
    Also, a little question: Would it be possible to use QCodeEdit with a custom parser and not the one it is shipped with?
    What do you mean? That you'd like to use your own syntax engine? Or simply add a hard-coded one? The later is really easy to do but the former is a bit trickier but still doable...
    Current Qt projects : QCodeEdit, RotiDeCode

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

    allstar (9th December 2007)

  21. #119
    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
    Fixed. (I've not tested but applied the suggested patch which I hope will be enough...)
    I just checked - you missed line 331 in qdocument_p.h :-)

    Also, I just spotted a problem when compiling on mac:

    Qt Code:
    1. /Users/dominik/Documents/code/edyuk/3rdparty/qcodeedit2/lib/qeditor.cpp: In member function ‘virtual void QEditor::mousePressEvent(QMouseEvent*)’:
    2. /Users/dominik/Documents/code/edyuk/3rdparty/qcodeedit2/lib/qeditor.cpp:1262: error: no match for ‘operator=’ in ‘((QEditor*)this)->QEditor::m_doubleClick = ((QEditor*)this)->QEditor::cursor’
    3. /Users/dominik/Documents/code/edyuk/3rdparty/qcodeedit2/lib/document/qdocumentcursor.h:79: note: candidates are: QDocumentCursor& QDocumentCursor::operator=(const QDocumentCursor&)
    4. /Users/dominik/Documents/code/edyuk/3rdparty/qcodeedit2/lib/qeditor.cpp: In member function ‘virtual bool QEditor::moveKeyEvent(QDocumentCursor&, QKeyEvent*, bool*)’:
    To copy to clipboard, switch view to plain text mode 

    Quote Originally Posted by fullmetalcoder View Post
    What do you mean? That you'd like to use your own syntax engine? Or simply add a hard-coded one? The later is really easy to do but the former is a bit trickier but still doable...
    I mean using a custom syntax engine. Already noticed that it would not be easily doable :-)
    Last edited by Methedrine; 8th December 2007 at 20:16. Reason: added log for mac compiler error
    "If you lie to the compiler, it will get its revenge." - Henry Spencer

  22. #120
    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 just checked - you missed line 331 in qdocument_p.h :-)

    Also, I just spotted a problem when compiling on mac.

    qeditor.cpp:1262 - you are using an undefined variable there.
    Fixed both.

    Quote Originally Posted by Methedrine View Post
    I mean using a custom syntax engine. Already noticed that it would not be easily doable :-)
    1. Why don't you want to use the default syntax engine? Wouldn't it be simpler and better to extend it rather than creating another one from scratch ?
    2. What exactly do you expect it to do and how much would its internal structure differ from the one of the default syntax engine?
    Answers to these would probably help me to change the syntax engine interface to make room for more than one without changing the existing one...
    Last edited by fullmetalcoder; 8th December 2007 at 20:35.
    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
  •  
Qt is a trademark of The Qt Company.