Page 9 of 11 FirstFirst ... 7891011 LastLast
Results 161 to 180 of 216

Thread: QCodeEdit

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

    Default Re: QCodeEdit

    Quote Originally Posted by fullmetalcoder View Post
    AFAIK, and I should know quite welll , the drawing of folding rects isn't done in qdocument.cpp but in qfoldpanel.cpp
    Anyway, I think I should add a way to change the look of fold indicators.
    nahh, i mean the dotted rectangle in the text document which appears when you activate the folding. and yes, the +/- rectangles are drawn in the foldpanel -- i wrote my own fold panel ( which is actually a copy of your qfoldpanel with minor modifications ).

    thanks for fixing!! continue the great work.

    if you could provide me the information where i get the current syntax used. i don't seem to be able to figure that one out

  2. #162
    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
    nahh, i mean the dotted rectangle in the text document which appears when you activate the folding.
    OK. Did you replace it with something nicer or just removed it?

    Quote Originally Posted by NoobSaibot View Post
    and yes, the +/- rectangles are drawn in the foldpanel -- i wrote my own fold panel ( which is actually a copy of your qfoldpanel with minor modifications ).
    Are you using images or hardcoded drawing code? Maybe we could make this configurable and keep a single fold panel class...

    Quote Originally Posted by NoobSaibot View Post
    if you could provide me the information where i get the current syntax used. i don't seem to be able to figure that one out
    The current design makes this a bit tricky... I got plans to improve this but I'd like to make this version as stable as possible before making API changes... Anyway you should be able to get this information using something like :
    Qt Code:
    1. editor->highlighter()->definition()->language();
    To copy to clipboard, switch view to plain text mode 
    where "editor" is a QEditor*
    This will give you the language used as a QString as it appears in the qnfa file.
    note : you'd better check for the existence of an highlighter before proceeding, unless you forced one to be set on all your editors...
    Current Qt projects : QCodeEdit, RotiDeCode

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

    NoobSaibot (19th January 2008)

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

    Default Re: QCodeEdit

    Quote Originally Posted by fullmetalcoder View Post
    OK. Did you replace it with something nicer or just removed it?
    you didn't see the attached images i posted? i replaced the dotted lines with an image, which is placed right after the last nonspace character.

    it'd be wonderful if there'd be a way to define own theme! it ain't that urgent though snippets are my #1 feature request. did you take a look at textmate manual/screencasts?

    /edit: wonderful, now i know which highlighter is used

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

    Default Re: QCodeEdit

    if you consider to make qcodeedit themable, consider the following:

    for constructions like imbedded php/ruby/java in html it should be possible to define the background color for such areas. thus -- generally speaking -- something like that should be possible:
    <background ... image="" color="" id="text.html code.java" />

    might be hard to implement , but as you love challenges there you go!
    Last edited by NoobSaibot; 19th January 2008 at 11:43.

  6. #165
    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
    you didn't see the attached images i posted? i replaced the dotted lines with an image, which is placed right after the last nonspace character.
    I didn't pay attention to this... The first time I viewed your attachement I only noticed the new icons in the panel.

    Quote Originally Posted by NoobSaibot View Post
    snippets are my #1 feature request. did you take a look at textmate manual/screencasts?
    I gave it a quick look but din't started writing anything... As I said already I have very little time and I'm currently focusing on bugfixing/polishing to make this version stable. As soon as I'll reach this state and have more spare time I'll start playing around with new stuff, including snippets, but this day has not come yet...

    Quote Originally Posted by NoobSaibot View Post
    /edit: wonderful, now i know which highlighter is used
    Good. Just curious : what do you do with this information? You display some additional text in a status panel or something like that?

    Quote Originally Posted by NoobSaibot View Post
    for constructions like imbedded php/ruby/java in html it should be possible to define the background color for such areas. thus -- generally speaking -- something like that should be possible:
    <background ... image="" color="" id="text.html code.java" />

    might be hard to implement , but as you love challenges there you go
    The use of a background color isn't difficult in itself... The only challenge is in finding the right paradigm to make this configurable... I'll think about it.
    Current Qt projects : QCodeEdit, RotiDeCode

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

    Default Re: QCodeEdit

    Quote Originally Posted by fullmetalcoder View Post
    Good. Just curious : what do you do with this information? You display some additional text in a status panel or something like that?
    i plan to have a dropdown in status panel, where i/the user can switch between the languages.

    Quote Originally Posted by fullmetalcoder View Post
    The use of a background color isn't difficult in itself... The only challenge is in finding the right paradigm to make this configurable... I'll think about it.
    well, again. textmate is *the* reference. take a language bundle ( c/c++ for instance ) and look at the files and the structure used there.

  8. #167
    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
    well, again. textmate is *the* reference. take a language bundle ( c/c++ for instance ) and look at the files and the structure used there.
    Well, I was considering the internal design, not user-configuration side...
    Current Qt projects : QCodeEdit, RotiDeCode

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

    Default Re: QCodeEdit

    in order to provide the information about the current highlighter, i added a signal to QEditor::setHighlighter(), highlighterChanged(). consider to make that change in your trunk.

    you fixed missing lines? :thumbs up: i encountered some file corruptions as i was using edyuk. some lines got swollowed. is that what you've fixed?

  10. #169
    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
    in order to provide the information about the current highlighter, i added a signal to QEditor::setHighlighter(), highlighterChanged(). consider to make that change in your trunk.
    I'll see to this. Does your signal have some parameters?

    Quote Originally Posted by NoobSaibot View Post
    you fixed missing lines? :thumbs up: i encountered some file corruptions as i was using edyuk. some lines got swollowed. is that what you've fixed?
    Yes. It appears that the fix for Qt 4.4 compat (atomic counters API changes) ended up removing some crucial init code by error which caused random line deletion during document loading... Hopefully I've been able to fix it straight after Usability reported it.
    Current Qt projects : QCodeEdit, RotiDeCode

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

    Default Re: QCodeEdit

    Quote Originally Posted by fullmetalcoder View Post
    I'll see to this. Does your signal have some parameters?
    At the moment it doesn't have any parameters. As i rely fully on the language() String -- which is not my preferable approach. i'd rather rely on some uid or something; which would be the parameter of this signal.
    Quote Originally Posted by fullmetalcoder View Post
    Yes. It appears that the fix for Qt 4.4 compat (atomic counters API changes) ended up removing some crucial init code by error which caused random line deletion during document loading... Hopefully I've been able to fix it straight after Usability reported it.
    outstanding!

    an offtopic question. did you ever try eclipse c++ & mylyn? a very nice combination if you ask me

  12. #171
    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
    an offtopic question. did you ever try eclipse c++ & mylyn? a very nice combination if you ask me
    I tried Eclispe monthes ago and found it extremly slow and memory consuming. Besides, at that time it din't have Qt support so I did not spend more than an hour using it... What's mylyn anyway?
    Current Qt projects : QCodeEdit, RotiDeCode

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

    Default Re: QCodeEdit

    Quote Originally Posted by fullmetalcoder View Post
    I tried Eclispe monthes ago and found it extremly slow and memory consuming. Besides, at that time it din't have Qt support so I did not spend more than an hour using it... What's mylyn anyway?
    well, i must admit its code completion is nowhere near edyuks speed! and yes, it is a memory monster. however, mylyn is a very nice integration of bugzilla/jira/track into eclipse; which goes actually beyond the pure integration of those.

    you better read it for yourself. mylyn

    just a hint to a possible plugin for edyuk

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

    Default Re: QCodeEdit

    there's no way to get the config file name/path for a certain lanuage (C++, XML, ...) from the QCodeFactory. There should be a possibility to get the language or its config file name/path by index/uid. For example:

    Qt Code:
    1. QString languageName( int index );
    2. QString languageConfigFile( int index );
    To copy to clipboard, switch view to plain text mode 

    or something along the lines.

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

    Default Re: QCodeEdit

    I may be being spectacularly dense here, but I cannot see how the example modifies the context menu. Its somehow added controls to turn on/off the various panels (line numbers, fold marks etc) and I cannot see how this happens.

    Can anyone tell me where this is done?

    Thanks.

  16. #175
    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
    Can anyone tell me where this is done?
    Well, it's a bit of a trick : did you notice the boolean parameter in the addPanel() method calls used in window.cpp? They inform QCodeEdit to add the proper actions to the context menu. What's nice though is that you can add actions the exact same way through
    Qt Code:
    1. QEditor::addAction(QAction*, QString, QString)
    To copy to clipboard, switch view to plain text mode 
    The two string params indicate menu and toolbar labels which are useful only when you use QCodeEdit in combination with qmdilib. To further tune the context menu you can use the two "standard methods" available with ever widgets : reimplementing the contextMenuEvent() method in a subclass or using the customContextMenuRequested signal (after having the context menu policy set properly...).
    Current Qt projects : QCodeEdit, RotiDeCode

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

    Default Re: QCodeEdit

    Thanks for the pointer.

    I have this working now, and for the record, the first string parameter is necessary, its the menu text. Without it you get no menu.

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

    Default Re: QCodeEdit

    Hi FullMetalCoder. I compiled on Windows again using VisualC 6 and got a lot of grief about your favourite coding style.

    ..\src\qcodeedit2\lib\qlinemarksinfocenter.cpp(508 ) : error C2562: 'cursorMoved' : 'void' function returning a value
    ..\src\qcodeedit2\lib\qlinemarksinfocenter.h(171) : see declaration of 'cursorMoved'
    NMAKE : fatal error U1077: 'cl' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\VC98\bin\NMAKE.EXE"' : return code '0x2'
    Stop.

    I changed
    508: return cursorMoved(e);

    to
    508: cursorMoved(e);
    509: return;

    Then did the same thing to fix all of these:

    ..\src\qcodeedit2\lib\widgets\qpanel.cpp(224) : error C2562: 'mouseMoveEvent' : 'void' function returning a value
    ..\src\qcodeedit2\lib\widgets\qpanel.h(67) : see declaration of 'mouseMoveEvent'
    ..\src\qcodeedit2\lib\widgets\qpanel.cpp(238) : error C2562: 'mousePressEvent' : 'void' function returning a value
    ..\src\qcodeedit2\lib\widgets\qpanel.h(68) : see declaration of 'mousePressEvent'
    ..\src\qcodeedit2\lib\widgets\qpanel.cpp(252) : error C2562: 'mouseReleaseEvent' : 'void' function returning a value
    ..\src\qcodeedit2\lib\widgets\qpanel.h(69) : see declaration of 'mouseReleaseEvent'
    qlinenumberpanel.cpp
    qlinemarkpanel.cpp
    ..\src\qcodeedit2\lib\widgets\qlinemarkpanel.cpp(1 65) : error C2562: 'mousePressEvent' : 'void' function returning a va
    ue
    ..\src\qcodeedit2\lib\widgets\qlinemarkpanel.h(47) : see declaration of 'mousePressEvent'
    ..\src\qcodeedit2\lib\widgets\qlinemarkpanel.cpp(1 75) : error C2562: 'mouseReleaseEvent' : 'void' function returning a
    alue
    ..\src\qcodeedit2\lib\widgets\qlinemarkpanel.h(48) : see declaration of 'mouseReleaseEvent'
    ..\src\qcodeedit2\lib\widgets\qlinemarkpanel.cpp(1 94) : error C2562: 'mouseReleaseEvent' : 'void' function returning a
    alue
    ..\src\qcodeedit2\lib\widgets\qlinemarkpanel.h(48) : see declaration of 'mouseReleaseEvent'
    qlinechangepanel.cpp
    qfoldpanel.cpp
    ..\src\qcodeedit2\lib\widgets\qfoldpanel.cpp(74) : error C2562: 'mousePressEvent' : 'void' function returning a value
    ..\src\qcodeedit2\lib\widgets\qfoldpanel.h(43) : see declaration of 'mousePressEvent'
    ..\src\qcodeedit2\lib\widgets\qfoldpanel.cpp(97) : error C2562: 'mousePressEvent' : 'void' function returning a value
    ..\src\qcodeedit2\lib\widgets\qfoldpanel.h(43) : see declaration of 'mousePressEvent'
    qstatuspanel.cpp

  19. #178
    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
    Hi FullMetalCoder. I compiled on Windows again using VisualC 6 and got a lot of grief about your favourite coding style.
    Jeez... When will it take return types into account before throwing such errors? all those functions where void so the error does not make any sense as far as ANSI C and ISO C++ are concerned (or did I miss something?) but I'll have this fixed by saturday anyway.
    Current Qt projects : QCodeEdit, RotiDeCode

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

    Default Re: QCodeEdit

    @fullmetalcoder:

    Here's a minimap panel i wrote. it's not perfect yet. but you'll get the general idea. feel free to use and improve it.
    Attached Files Attached Files

  21. #180
    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
    Here's a minimap panel i wrote. it's not perfect yet. but you'll get the general idea. feel free to use and improve it.
    Looks great! There are a couple of details I think could be improved but even as it is now it rocks!
    Here are my suggestions, hoping you won't find them too hard to implement :
    • 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
    As a side note I have fixed the MSVC build issues reported by Usability.
    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.