How to create mouse dragged widget without title?
How to create mouse dragged widget without title?
Reimplement QWidget::mousePressEvent() and QWidget::mouseMoveEvent().
Here's some "pseudo":
Qt Code:
// a frameless window setWindowFlags(Qt::FramelessWindowHint); // member variable QPoint offset; mousePressEvent() { // offset from top left corner offset = event->pos(); } mouseMoveEvent() { // move to mouse pos - calculated offset move(event->globalPos() - offset); }To copy to clipboard, switch view to plain text mode
J-P Nurmi
Thank you!
Bookmarks