[Interest] Why QLabel block mouseReleaseEvent when holds rich text?

Thiago Macieira thiago.macieira at intel.com
Wed Sep 11 16:50:03 CEST 2013


On quarta-feira, 11 de setembro de 2013 19:08:35, nate.yuan at gmail.com wrote:
>  Hi guys,
> 
>         I have a frameless dialog and implement the title bar by myself. I
> implement the mousePressEvent, mouseReleaseEvent and mouseMoveEvent of the
> dialog, so users can drag the dialog. Every thing works fine until I put a
> QLabel, which holds rich text,  on the title bar. The QLabel blocks the
> mouseReleaseEvent, so the dialog's mouseReleaseEvent() will never be
> called. When I use plain text in the QLabel, every thing works fine.
> 
>         Is this a bug of QLabel?  Or do I miss something?

Probably not a bug. Do you get the mousePressEvent? The release event is 
always sent to the same widget that accepted the mouse release. And QLabel 
with rich text might contain links, so it may need to handle mouse presses.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130911/7851683d/attachment.sig>


More information about the Interest mailing list