Results 1 to 20 of 216

Thread: QCodeEdit

Hybrid View

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

    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

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

    NoobSaibot (19th January 2008)

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

    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

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

    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.

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

    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

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

    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.

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

    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

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

    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?

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

    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

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

    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

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

    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

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

    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

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

    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.

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

    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.

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.