Results 1 to 3 of 3

Thread: Painting program

  1. #1
    Join Date
    Jul 2007
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Painting program

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Paris, France
    Posts
    227
    Thanks
    3
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Painting program

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

    Qt Code:
    1. QApplication::setOverrideCursor( const QCursor& );
    2. QApplication::restoreOverrideCursor();
    To copy to clipboard, switch view to plain text mode 

    More information here:
    http://doc.trolltech.com/4.3/qapplic...OverrideCursor

  3. #3
    Join Date
    Jul 2007
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Painting program

    Thanks a lot. I will use that.

    Ajay

Similar Threads

  1. How do I make a program out of my program?
    By Randulf in forum Newbie
    Replies: 1
    Last Post: 29th May 2007, 11:11
  2. Porting my program to another windows machine !
    By probine in forum Qt Programming
    Replies: 1
    Last Post: 14th March 2007, 06:46
  3. QT Program debug,GDB on Linux
    By darpan in forum General Programming
    Replies: 1
    Last Post: 26th January 2007, 22:02
  4. QT MySQL
    By sabeeshcs in forum Newbie
    Replies: 6
    Last Post: 12th January 2007, 04:19
  5. Release my simple program to other users ?
    By probine in forum Qt Programming
    Replies: 9
    Last Post: 9th July 2006, 23:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.