Not receiving moveEvent from parent?
I have a widget (QLineEdit), I reimplemented its moveEvent to meet something that I want to, now, when I use that widget as the mainwindow (not a child of anything...) everything works like a charm, when that widget is a child o开发者_如何学Cf another QWidget, that event occurs only once, when that widget is created, am I missing something here?
thanks,
A widget receives a move event when changes its position. The position of a child widget is relevant to its parent.
When your QLineEdit has no parent & you drag it around it changes it position, because its position is relevant to the desktop.
When your QLineEdit is a child widget & you drag around the the parent widget, the position of your QLineEdit is not changing, it is relevant to its parent and only parent's position is changing. Except this one time - after its creation.
精彩评论