Currently I've made a subclass of labels called "clickLabels" that has clicks pass through it.
-This is because I have labels "covering" my buttons
-Which is because the button seems to push an icon image out of it's way if you also have text for the button

Now that I'm done with my first iteration of this design (or close enough); I'm reflecting on what I may have missed as I get up to speed on all things Qt.


My question is "is this functionality redundant?" I could see it being either way. I went this direction because labels seemed to "absorb" clicks no matter what properties I applied to them; so to make them "transparent" (so the button is clicked) I did this:
Qt Code:
  1. void clickLabel::mousePressEvent(QMouseEvent *e)
  2. {
  3. //stop tracking the mouse so it's free to grab. Might be unnecessary.
  4. releaseMouse();
  5. //tell others we've been pressed and hand off the MouseEvent
  6. emit pressed(e);
  7. }
To copy to clipboard, switch view to plain text mode 
and implemented:
Qt Code:
  1. void aniButton::stealMousePress(QMouseEvent *e)
  2. {
  3. //track the mouse cursor
  4. grabMouse();
  5. //deliver the mouse press to ourselves as if it were ours to begin with
  6. mousePressEvent(e);
  7. }
To copy to clipboard, switch view to plain text mode 


(I grab the mouse for other reasons.) The idea should be obvious by now; and now i"m just curious if it was done in error because the functionality already exists. I.E. did I go reinvent the wheel?