PDA

View Full Version : Considerations for a GUI with rich text?



hackerNovitiate
2nd April 2010, 06:24
Hi all,

I'm making a to-do list desktop application. So far, I have a user-input class, model class, and hard disk IO class. I want to make my view class next, but am not sure what approach I should take.

Eventually I'll have different views for the user to choose from, but for the first one I wanted to have:

A simple list of (sortable) task names, without bullets
The ability to have different font sizes and colours for different list entries
The ability to select and copy the list text
The ability to edit the task name (inline editor) when left-clicking on a list entry
The ability to edit the task properties (popup dialog) when double-clicking on a list entry


The options that I'm aware of are QPainter and QTextEdit. I have used basic aspects of QPainter before and haven't used QTextEdit before. From my quick research, QPainter doesn't let me implement (3) and QTextEdit doesn't let me implement (4), (5). Is this correct? Are there other existing classes that I should consider for my app view? Is there any other advice you'd give me?

Thanks!

Lykurg
2nd April 2010, 06:39
If you have already a model, then use a QListView. With it you can realize all points. A little bit more complex but more flexible: You can use QGraphicsView and arrange all yourself.