[Qt-interest] sketcher program

phil prentice philp.cheer at talktalk.net
Fri May 6 22:03:15 CEST 2011


Hi
  Recently I have been looking at an MFC example of a program that lets you 
draw lines, circles, polylines etc in an MDI.  As a little exercise for 
myself I have decided to try to perform the same functionality using Qt.
(I know its probably already been done, but I would like to go through the 
exercise myself to try and learn!!)
I have some very basic questions about the model view architecture.
And I need to read a lot more.
I would eventually like to create a Model view (QStandardItem model or a 
custom model), but to start with I thought that I might try and use the item 
view conveniance classes.

I was thinking of using QListWidget.
I was thinking of deriving an element base class from QListWidgetItem and then 
deriving line, circle etc from the element base(using a virtual draw function 
for each element)

I would then use setItemDelegate for editing/displaying the elements.

Is this a stupid idea?
Would this be very inefficient?

I know that QListWidget is normally used to store text and icons, so if I 
extend it like this its probably not the way to do things?

Thanks




More information about the Qt-interest-old mailing list