PDA

View Full Version : Painting program



g123sk
9th July 2007, 05:40
Hi all

I am new to Qt programming. I am trying to program a drawing program like MS paint. I have a list of toolbutton with basic shapes. when I click them, I will create a symbol for that shape. I would like to know how to attach that symbol to the mouse and make it move with the mouse until the user clicks on the canvas?

Thanks in advance for your suggestions
Ajay

guilugi
9th July 2007, 08:33
Hi,

You have a QCursor class, that allows to create your own cursors, and override the default ones.

You'll just have to implement your own, and set a pixmap on it ;-)

http://doc.trolltech.com/4.3/qcursor.html#pixmap

To override default cursor, call these methods...


QApplication::setOverrideCursor( const QCursor& );
QApplication::restoreOverrideCursor();

More information here:
http://doc.trolltech.com/4.3/qapplication.html#setOverrideCursor

g123sk
9th July 2007, 14:15
Thanks a lot. I will use that.

Ajay