Widget MouseHoverEvent Disable
-
Okay How Can I you said please help me for example code:
ui->pusbutton ? thenk you@alonewolfsemmmy
Example code for what? And we expect you to write the code and ask questions, not just ask others to write it for you. -
No button to disabled so remove the hovering effect How Can I
I don't know how to turn off the button hovering effect
Please help me My friend I need your help -
No button to disabled so remove the hovering effect How Can I
I don't know how to turn off the button hovering effect
Please help me My friend I need your help@alonewolfsemmmy
No, you need to do some reading of the documentation, try some things, and write questions which people can understand, even if English is not your native language. -
Hi
This function
https://doc.qt.io/qt-5/qwidget.html#enabled-prop -
@mrjj please I didn't you said Please tell me example thank you my friend
-
@mrjj please I didn't you said Please tell me example thank you my friend
hi
Its very helpful to be able to use the docs.
anyway, try
ui->buttoname->setEnabled(false);the button should show a bit grey and no hover effect.
-
@mrjj
You said didn't work I want to widget on mousehover disable effect widget
All Right Have you advice CRC-32/MPEG-2 calculate function because When I move on widget form Crc 32 calculate error What Can I fixed -
@mrjj
You said didn't work I want to widget on mousehover disable effect widget
All Right Have you advice CRC-32/MPEG-2 calculate function because When I move on widget form Crc 32 calculate error What Can I fixed@alonewolfsemmmy
Hi
That is hard to guess on as why would a hover eefct break the CRC calculation in first place ?Did you watch your cpu usage ? is it at 100% ?
-
Okay my brother I will try you said cpu usage
-
@mrjj my brother
SerialPort 5 megabit buadrate cpu Usage -
@mrjj my brother
SerialPort 5 megabit buadrate cpu UsageOk so its not using 100% cpu so its not due to the hover disturbs it.
Does it happen every time if you hover something?
Do you use StyleSheets in your app ?
-
@mrjj said in yes it happen every time if you hover something
I dont use stylesheets in my App
-
@mrjj said in yes it happen every time if you hover something
I dont use stylesheets in my App
Ok so its not due to the stylesheet which can be heavy.
And what happened when you disabled the button ?
It went grey looking and no hover effect ? -
@mrj MyBrother
When I disabled the button nothing has changed
-
@mrj MyBrother
When I disabled the button nothing has changed
@alonewolfsemmmy
Not even the button ?
It should be disabled unless something in code turns it on again. -
Okay My brother So how can I disable the mouse thank you
-
Okay My brother So how can I disable the mouse thank you
Hi
you cannot disable the mouse as its belongs to the OS.However you can hide it for your app
QCursor cursor(Qt::BlankCursor);
QApplication::setOverrideCursor(cursor);
QApplication::changeOverrideCursor(cursor); -
My Brother I want to hide mouse event Please help me thank you
-
My Brother I want to hide mouse event Please help me thank you
@alonewolfsemmmy
Well you can take an event using an event filter
https://doc.qt.io/qt-5/eventsandfilters.html#include <QObject> #include <QMouseEvent> #include <QDebug> #include <QCursor> class myEventFilter: public QObject { Q_OBJECT public: myEventFilter() {} ~myEventFilter() { } protected: bool eventFilter(QObject* object, QEvent* event) { if(event->type() == QEvent::MouseMove) { // or what ever event you want return true; } else return false; } }; and to use it ui->thebutton->installEventFilter(new myEventFilter());