PDA

View Full Version : Code editor



Michiel
14th March 2006, 10:12
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!

fullmetalcoder
14th March 2006, 14:30
* 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!:)




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...:p

Michiel
14th March 2006, 15:55
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.


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...:p

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.

Chicken Blood Machine
14th March 2006, 17:16
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).

Michiel
14th March 2006, 17:20
That's what I thought. :) Thanks. Well, I suppose I'll study the QTextEdit code.