Results 1 to 3 of 3

Thread: QCursor

  1. #1
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Red face QCursor

    I want to modify what my cursor looks like, but I don't want to use one of the pre-defined cursors. What I want to do is similar to the mouse cursor with the Question Mark next to it, the Qt::WhatsThisCursor. But what I want to do, is instead of a question mark, I want to put a word next to the cursor.

    I have a plot, and when the user moves the mouse inside one of many boxes, I want the cursor to change signifying if they click inside that box something will happen. But there are 3 types of things that can happen and I want to put the word of those three things next to the cursor when they enter the box. So if the user in a menu has Option 2 picked, they enter the box with the cursor to the cursor will add the word "Option 2" or "O2" just to the right of the cursor. Then if they leave the box it goes back to normal. But if the user clicks inside the box, they will know they are going to perform the "O2" code. Thanks for your help!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QCursor

    There is a QCursor constructor that takes a QPixmap as its argument, so you can draw your word on a pixmap and then make that pixmap your new cursor.

  3. The following user says thank you to wysota for this useful post:

    ToddAtWSU (15th October 2007)

  4. #3
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QCursor

    Would this still have the cursor followed by the word, or would I just have the word as the cursor? I just talked with a guy that has done something similar, but in Motif, and he said they had bitmaps for cursors. He is using the same cursors I want to use. So if I have the bitmap, could I just use this for the constructor then? The .h bitmap file #define the width, height, x_hot and y_hot and then in an array of 0xNN bits (N = 0-9,A-F). Thanks!

    Edit: I see it also has a constructor that takes a QBitmap and a mask of the QBitmap and I remember there being two files for the cursors they used in Motif...the main bitmap and a mask bitmap. Now if I can get hold of that guy with those files so I can get the masks....Thanks!
    Last edited by ToddAtWSU; 11th October 2007 at 20:12.

Similar Threads

  1. Why QCursor setPos() dosen't work here?
    By kar98k in forum Qt Programming
    Replies: 8
    Last Post: 1st June 2007, 12:52

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.