I have a QLabel within my Qt Designer-created MainWindow.
However, I would like to add mouse tracking to this QLabel by subclassing QLabel and creating a new class called QLabelWithMouseTracking which will contains re-implementations of the appropriate protected functions: mousePressEvent(), mouseReleaseEvent() etc.
My question is:
How do I perform the subclassing and create a new class given that this QLabel is already created and initialized in the Designer UI header file?
Also, I'm using the multi-inheritance approach. i.e.
Qt Code:
#include "ui_MainWindow.h" { Q_OBJECT public: };To copy to clipboard, switch view to plain text mode
etc.
Thanks in advance to anyone who can steer me in the right direction!
Bookmarks