Results 1 to 5 of 5

Thread: Code editor

  1. #1
    Join Date
    Mar 2006
    Location
    The Netherlands
    Posts
    300
    Thanks
    9
    Thanked 29 Times in 29 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Code editor

    I need a code editor widget for an application. QTextEdit has way too many features I don't need. And the code editor needs a great deal of features QTextEdit lacks. So I don't think it's a good idea to subclass QTextEdit.

    I suppose I have two options:

    * Is there already another code editor widget I could freely use and subclass for a commercial application?
    * Should I start from scratch?

    In the second case, I'm not quite sure where to begin. Until now, I have only subclassed working QT widgets. Is there a tutorial for this? Creating a widget from scratch (or perhaps only with QWidget as base-class)? Any help would be appreciated.

    Thanks!
    "The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry

  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: Code editor

    Quote Originally Posted by Michiel
    * Is there already another code editor widget I could freely use and subclass for a commercial application?
    * Should I start from scratch?
    The DevQt team, myself included is working on such a widget but, as we're developping an open source app I'm not sure about the possibility of allowing someone to use it in someting commercial. I guess we've got to discuss about that if you're interested in our work!


    Quote Originally Posted by Michiel
    In the second case, I'm not quite sure where to begin. Until now, I have only subclassed working QT widgets. Is there a tutorial for this? Creating a widget from scratch (or perhaps only with QWidget as base-class)? Any help would be appreciated.
    Starting from scrach would be an awfull idea! You'd waste time and probably not produce an efficient code. If you absolutely want to do something on your own I suggest you subclass QAbstractScrollArea and use the QTextEdit code as a start, just throwing away what you don't need and extending it to match your requirements...

    The only problem would be that taking the QTextEdit source is possible only if you use the Open Source version...
    Current Qt projects : QCodeEdit, RotiDeCode

  3. #3
    Join Date
    Mar 2006
    Location
    The Netherlands
    Posts
    300
    Thanks
    9
    Thanked 29 Times in 29 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Code editor

    Quote Originally Posted by fullmetalcoder
    The DevQt team, myself included is working on such a widget but, as we're developping an open source app I'm not sure about the possibility of allowing someone to use it in someting commercial. I guess we've got to discuss about that if you're interested in our work!
    Sure, I'm interested. But maybe it'd be more fun (and more specific to my needs) if I tried to make one myself.

    Quote Originally Posted by fullmetalcoder
    Starting from scrach would be an awfull idea! You'd waste time and probably not produce an efficient code. If you absolutely want to do something on your own I suggest you subclass QAbstractScrollArea and use the QTextEdit code as a start, just throwing away what you don't need and extending it to match your requirements...

    The only problem would be that taking the QTextEdit source is possible only if you use the Open Source version...
    Yes, of course. I'd start a little higher up, like you said. I hadn't even thought about that. But I can't use the source code as inspiration if I'll use the resulting widget in a commercial application? I do have a commercial QT license.
    Last edited by Michiel; 14th March 2006 at 16:25.
    "The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry

  4. #4
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Code editor

    Quote Originally Posted by Michiel
    Yes, of course. I'd start a little higher up, like you said. I hadn't even thought about that. But I can't use the source code as inspiration if I'll use the resulting widget in a commercial application? I do have a commercial QT license.
    Of course you can reuse the code in a closed-source application if you have a commercial license. The commercial license gives you that right! The GPL version also gives you that right, provided your resultant program is GPL'ed (i.e. not closed-source).
    Save yourself some pain. Learn C++ before learning Qt.

  5. #5
    Join Date
    Mar 2006
    Location
    The Netherlands
    Posts
    300
    Thanks
    9
    Thanked 29 Times in 29 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Code editor

    That's what I thought. Thanks. Well, I suppose I'll study the QTextEdit code.
    "The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry

Similar Threads

  1. copyright and gpl
    By janus in forum General Discussion
    Replies: 8
    Last Post: 21st October 2008, 01:13
  2. Creating simple text editor from the eamples code
    By overcast in forum Qt Programming
    Replies: 4
    Last Post: 14th February 2007, 15:46
  3. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15
  4. Give Kdevelop code editor better appearence
    By zlatko in forum KDE Forum
    Replies: 3
    Last Post: 17th January 2006, 17:02

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.