Hi.
Is QPushButton have SIGNAL leave/enter? I don't see it. If no is some way to repalce leave and enter in eventFilter on Singals and Slots?
Hi.
Is QPushButton have SIGNAL leave/enter? I don't see it. If no is some way to repalce leave and enter in eventFilter on Singals and Slots?
You can either subclass and re implement enterEvent() and leaveEvent() or as you suggested, install and event filter to catch these events,
Fine, where is the problem?I'm using it now but i had to use Signals and Slots.
What exactly don't you understand?I don't know exactly how to do it. Could You explain it on some code?
You do know how to subclass don't you?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
What do You mean writing re implement. Maybe problem is my level of english and i don't understand exactly what You wrote.
well if you don't know what reimplementing means, either in English or in C++, then it will be hard to explain.
Implementing a method is filling it with the actual logic it is supposed to do.
Just like you implemented the eventFilter().
If the event filter works for you, then leave it , its a good way to do it.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
I think "re-implementing" is quite common term in C++ domain. It's related to virtual methods, which you can "re-define" in new class to provide additional / different functionality for this class. Other common word is "override".What do You mean writing re implement.
Could You explain it on some code?Qt Code:
class Base{ public: virtual void method(){ print("method from Base class") } }; class Derived : public Base{ public: void method(){ print("method from Derived class") } // method() is re-implemented in Derived class };To copy to clipboard, switch view to plain text mode
Hi,
Check out my answer in Stackoverflow here and vote it up if you like.
Bookmarks