QCursor: Cannot create bitmap cursor; invalid bitmap(s)
-
wrote on 18 Dec 2019, 08:05 last edited by
I'm trying to change the cursor Image but I got the following error:
QCursor: Cannot create bitmap cursor; invalid bitmap(s)I tried both:
QCursor(QBitmap("qrc:/cursorTarget.bmp"));
QCursor(QPixmap("qrc:/cursorTarget.png"));
Please help me
Thanks -
Do the files actually exist? Please check with QFile::exists() before trying to create a cursor
-
I'm trying to change the cursor Image but I got the following error:
QCursor: Cannot create bitmap cursor; invalid bitmap(s)I tried both:
QCursor(QBitmap("qrc:/cursorTarget.bmp"));
QCursor(QPixmap("qrc:/cursorTarget.png"));
Please help me
Thanks@Delavega77 said in QCursor: Cannot create bitmap cursor; invalid bitmap(s):
qrc:/cursorTarget.bmp
Does it exist and contains valid bitmap?
What doesqDebug() << QBitmap("qrc:/cursorTarget.bmp").isNul();
return?
-
@Delavega77 said in QCursor: Cannot create bitmap cursor; invalid bitmap(s):
qrc:/cursorTarget.bmp
Does it exist and contains valid bitmap?
What doesqDebug() << QBitmap("qrc:/cursorTarget.bmp").isNul();
return?
wrote on 20 Dec 2019, 06:13 last edited by@jsulm Thank your for your reply.
Yes the file exists . -
@jsulm Thank your for your reply.
Yes the file exists .@Delavega77 So, isNull() returns false?
-
@Delavega77 So, isNull() returns false?
wrote on 20 Dec 2019, 06:34 last edited by@jsulm file.exists( ) return true;
qDebug() << QBitmap("qrc:/cursorTarget.bmp").isNull(); return false;
but when i try to create the cursor i get that error -
Can you upload the bitmap so we can try out by ourself?
-
Can you upload the bitmap so we can try out by ourself?
wrote on 20 Dec 2019, 06:54 last edited by@Christian-Ehrlicher it was my fault; now i dont' get any error when creates the cursor but when i set the cursor to a quickItem in c++ i doesn't have any effect.
QCursor jackpotCursor= QCursor(QPixmap(":/cursorTarget.png"));
window->setCursor(jackpotCursor); -
Can you try out with a QWidget first, if it works try to create a minimal testcase for a QQuickWhatever
-
Can you try out with a QWidget first, if it works try to create a minimal testcase for a QQuickWhatever
wrote on 20 Dec 2019, 07:33 last edited by@Christian-Ehrlicher I tried with a QWidget and it works fine...
-
Then you should create a small testcase and create a bug report (and post the link here)
1/11