PDA

View Full Version : QCursor



ToddAtWSU
11th October 2007, 18:43
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!

wysota
11th October 2007, 19:16
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.

ToddAtWSU
11th October 2007, 19:57
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!