Results 1 to 20 of 48

Thread: a Text Editor with line numbers...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Winnipeg, MB. Canada
    Posts
    17
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: a Text Editor with line numbers...

    Quote Originally Posted by fullmetalcoder
    Due to the limitations of my wrapper around QTextEdit I started porting QScintilla to Qt4.
    Yea, i played with porting QScintilla to Qt4. Of course if qt3to4 did all the work, it would be too easy, but there is still tons of hand-massaging you have to do. Porting from scratch using Riverbank's code as a guideline might in the end be the best way to go.

  2. #2
    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: a Text Editor with line numbers...

    Quote Originally Posted by rh
    Yea, i played with porting QScintilla to Qt4. Of course if qt3to4 did all the work, it would be too easy, but there is still tons of hand-massaging you have to do. Porting from scratch using Riverbank's code as a guideline might in the end be the best way to go.
    Where to find Riverbak's code? Would be happy to find an easy way!!!
    Current Qt projects : QCodeEdit, RotiDeCode

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

    Default Re: a Text Editor with line numbers...

    QScintilla does not support anything but Latin1 and thus it's unusable for me and many others.

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

    Angry Re: a Text Editor with line numbers...

    I ported QScintilla by hand from Qt3 to Qt4, it compiled without even one warning.
    I then tried to use it in a very simple program and it linked with no problem, the window appeared...
    but not the cursor
    then tryed to copy from another editor... NO WAY!!! but the context menu displayed...
    then tryed to typoe by hand a few words... NO WAY!!! What the fuck is that???
    I spent 4hours porting something that doesn't work!!!
    Current Qt projects : QCodeEdit, RotiDeCode

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

    Default Re: a Text Editor with line numbers...

    Quote Originally Posted by fullmetalcoder
    I ported QScintilla by hand from Qt3 to Qt4, it compiled without even one warning.
    I then tried to use it in a very simple program and it linked with no problem, the window appeared...
    but not the cursor
    then tryed to copy from another editor... NO WAY!!! but the context menu displayed...
    then tryed to typoe by hand a few words... NO WAY!!! What the fuck is that???
    I spent 4hours porting something that doesn't work!!!
    release the code or shut up...

    at last for the first editor!

  6. #6
    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: a Text Editor with line numbers...

    which code??? buggy QScintilla or working QTextEdit???

    QTextEdit based now highlight current line in cyan but there's still a twist:
    no simple way to make it highlight the whole line, as in Dev-C++ for example.
    any ideas on how to do that?

    cheers
    Current Qt projects : QCodeEdit, RotiDeCode

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

    Default Re: a Text Editor with line numbers...

    I would like to see a code based on QTextEdit, because of the reasons I explained before. But that's me

  8. #8
    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: a Text Editor with line numbers...

    I should be able to post it tomorrow.

    No solutions comes to me about current line colouring but I implemented the basis of a breakpoint management system.

    Seems to progress!!!
    Current Qt projects : QCodeEdit, RotiDeCode

  9. #9
    Join Date
    Jan 2006
    Location
    Winnipeg, MB. Canada
    Posts
    17
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: a Text Editor with line numbers...

    If you want to see more information on scintilla implementations, you may want to check out:

    http://www.codeproject.com

    and search for "scintilla". Of course these will be implemented with MFC or in C#, but you might get some ideas.

    P.S. CodeProject's search isn't very good; you'll get more hits googling the CodeProject site.
    Plan? There ain't no plan!

  10. #10
    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: a Text Editor with line numbers...

    sorry rh but I don't think porting QScintilla would be a good way to reach my goal.

    Elcuco, it's your turn to shut up! Have a look at the code and think before giving feedbacks...
    Last edited by fullmetalcoder; 27th January 2006 at 13:19.
    Current Qt projects : QCodeEdit, RotiDeCode

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

    Talking Re: a Text Editor with line numbers...

    Quote Originally Posted by fullmetalcoder
    I should be able to post it tomorrow.

    No solutions comes to me about current line colouring but I implemented the basis of a breakpoint management system.

    Seems to progress!!!
    Original message said:
    You said tomorrow on the 22, now it's 24.

    SHOW ME THE MONEY!
    SHOW ME THE MONEY!
    SHOW ME THE MONEY!

    Now I do see the code...
    comments tomrrow... /me shuts up now.
    Last edited by elcuco; 24th January 2006 at 21:21.

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

    Cool Re: a Text Editor with line numbers...

    Quote Originally Posted by elcuco
    Original message said:
    You said tomorrow on the 22, now it's 24.

    SHOW ME THE MONEY!
    SHOW ME THE MONEY!
    SHOW ME THE MONEY!

    Now I do see the code...
    comments tomrrow... /me shuts up now.
    Who's the best ???
    Just kidding!

    Ok implementation is not that perfect!
    a corrected version is coming soon!
    Current Qt projects : QCodeEdit, RotiDeCode

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

    Default Re: a Text Editor with line numbers...

    meanwhile you is the king... me sux0rz...

    don't worry, this will change over time... you just wait...

  14. #14
    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: a Text Editor with line numbers...

    here is the new version.

    - few bugs fixes
    - line number calculation working fine
    - lines highlighting done inside devhighlighter

    have fun!

    edit : removed attached .zip; copyright notice wasn't correct !
    Last edited by fullmetalcoder; 30th January 2006 at 09:19.
    Current Qt projects : QCodeEdit, RotiDeCode

  15. #15
    Join Date
    Jan 2006
    Location
    Minsk, Brest, Belarus
    Posts
    54
    Thanks
    3
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Question Re: a Text Editor with line numbers...

    Quote Originally Posted by fullmetalcoder
    I should be able to post it tomorrow.

    No solutions comes to me about current line colouring but I implemented the basis of a breakpoint management system.

    Seems to progress!!!
    Hi! And where is the code?
    All of us want to have a look at it...
    Thanks.

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

    Talking Re: a Text Editor with line numbers...

    Quote Originally Posted by Xagen
    Hi! And where is the code?
    All of us want to have a look at it...
    Thanks.
    There was a twist in the copyright notice so I removed all zip files yesterday.

    I used this time to :
    - fix highlighting (handles floats and comments after a preprocessor)
    - fix find & replace
    - add a built-in loading/saving API
    - add a print function
    - add both of these to context menu

    But current line highlighting (and breakpoints/errors as well) is still ugly!!!
    No way making it kepp coloring after last character!!!!

    Have fun and please give feedback (and hints about background coloring) !!!
    Last edited by fullmetalcoder; 10th February 2006 at 15:41.
    Current Qt projects : QCodeEdit, RotiDeCode

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

    Default Re: a Text Editor with line numbers...

    In your pro file, there is a line:
    Qt Code:
    1. TARGET += neweditor
    To copy to clipboard, switch view to plain text mode 

    change it to
    Qt Code:
    1. TARGET = neweditor
    To copy to clipboard, switch view to plain text mode 

    (remove the +). Otherwise it does not compile on my system. The loading is still wayy.... slow... I compared it to my code (which you trashed...) and not that fast ... my code can load much more files (and highlight them properly....), I know for sure it can load C/C++/CSS/XML/Makefile... I need to investigate why it fails on bash/sh... (to the forum, I plan on release it soon, don't worry).

    The issue with the one context menu is interesting... but now with 10 commands, it's hard to find the correct item. You should start using submenus or do a window menu, like people expect.

    Besides this, this is great... nice work!

  18. #18
    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: a Text Editor with line numbers...

    Quote Originally Posted by elcuco
    The loading is still wayy.... slow... I compared it to my code (which you trashed...) and not that fast ... my code can load much more files (and highlight them properly....), I know for sure it can load C/C++/CSS/XML/Makefile... I need to investigate why it fails on bash/sh... (to the forum, I plan on release it soon, don't worry).
    Don't say my editor is slow compared to mine:
    yours take more than 50 seconds to load the qrc_new-editor.cpp file produced by your project (104kb) while mine manage to load it (and highlight it as well) in less than 4 seconds !!!! Impressive isn't it?
    Anyway, apart from that SLOOOOOOOOOOOW loading, your version isn't that bad (and I don't worry about release dates : I'm quite patient).

    [quote=elcuco]
    The issue with the one context menu is interesting... but now with 10 commands, it's hard to find the correct item. You should start using submenus or do a window menu, like people expect.
    [quote]

    It's only a core editor! The IDE is already on rails and it, of course , includes a window menu. Did you try Dev-C++, there's not 10 items but about 20!!
    Current Qt projects : QCodeEdit, RotiDeCode

  19. #19
    Join Date
    Jan 2006
    Posts
    30
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: a Text Editor with line numbers...

    QTextEdit was not really designed to be an editor. The best thing to do to make a good editor is make one from scratch using parts of Qt's code as a baseline That's what I am doing currently

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. QTcpSocket exception.
    By Fastman in forum Qt Programming
    Replies: 9
    Last Post: 29th January 2008, 13:51
  3. Qwizard crashed when created in a slot
    By joshlareau in forum Qt Programming
    Replies: 9
    Last Post: 15th January 2008, 09:16
  4. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  5. QTableView paints too much
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2006, 18:42

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.