SFML community forums
Help => Window => Topic started by: Tenry on August 26, 2011, 11:56:50 pm
-
Hi, I'm currently writing a level editor, using Qt and SFML 1.6.
I use Qt to change the cursor, e.g. a resize cursor, but always when I'm moving my cursor, it is switching back to default cursor for a very short time, and I found out that it must be SFML's fault.
Is there any way to disable it? Or does SFML 1.6 include a feature to change the cursor?
-
I use Qt and SFML together as well and compiling them for the first time I noticed this "feature" as well. As it may not seem to be pretty I just told sfml to hide the cursor and it pretty much gets the job done for me.
void sf::Window::ShowMouseCursor ( bool Show )
-
I use Qt and SFML together as well and compiling them for the first time I noticed this "feature" as well. As it may not seem to be pretty I just told sfml to hide the cursor and it pretty much gets the job done for me.
void sf::Window::ShowMouseCursor ( bool Show )
That's a good idea. But anyhow, it does not seem to work well if mouse button is down. Then, there just is no cursor.
Do you set the cursor by Qt on every frame, or only when the cursor is moved or needs to be changed?
-
Actually since I don't use different cursors for different states, I just tell Qt when initializing the app to change the default cursor to an image I made and it stays like that the entire time, while the cursor is over the main window and it's elements:
QPixmap curImage("Data/GUI/Images/Cursor.png");
QCursor cur(curImage,0,0);
App->setOverrideCursor(cur);
If something isn't like it is in my application, it might be because I'm using SFML 2.0, but I don't think that might be a problem.
-
Actually since I don't use different cursors for different states, I just tell Qt when initializing the app to change the default cursor to an image I made and it stays like that the entire time, while the cursor is over the main window and it's elements:
QPixmap curImage("Data/GUI/Images/Cursor.png");
QCursor cur(curImage,0,0);
App->setOverrideCursor(cur);
If something isn't like it is in my application, it might be because I'm using SFML 2.0, but I don't think that might be a problem.
Hm, you are using setOverrideCursor() on the Application, whereas I am using setCursor() on my SFML widget. My editor has got other Qt widgets (buttons, inputs, etc) why I'm not overriding the overall cursor.
I don't think either that the SFML version difference is the reason.