PDA

View Full Version : What you see text editor



Wolf900
10th March 2012, 11:42
Hello,

Are there any ready-available examples of this? I want a functionality akin to Photoshop text function.

I'm thinking about subclassing QTextEdit and QGraphicsScene and placing this text object upon pressing a button. Then, when you click on this object, additional text editing tools become available - so you can set parts of text to bold, italic, modify color and not much else. And then you would be able to change the object's position - and I think that's available in QGraphicsScene by default.

Is this a reasonable way to approach this?

Edit:

I want a background picture, as a QBrush, for the background of QGraphicsScene. Let's say I want to add a fancy caption to it or something like that.
So the possible steps would be:
(1) Press the text button. Text editing means appear on QGraphicsScene
(*) Position the text
(*) Edit the text, including font, size, etc.
(2) Once it's done, an easy approach would be to 'finalize' the text and apply it to the background picture. A bit harder one would be to save the state of all the text objects (a layer of sorts) so they could be loaded and edited later.