Important: Please read the Qt Code of Conduct -

How can we disable Moving QWidget/QDialog from Title-bar?

  • I wanted to lock window from moving. Are there some kind of flag to disable moving?

  • Lifetime Qt Champion

    There is no such flag, but you can remove the caption
    with Qt::FramelessWindowHint.

    That said, can you explain a bit why you want such window
    as if used as a main window, it would violate most user interface guidelines
    and for me personally its an instant kill and uninstall.

    However, your use case might be special so a bit more information of the overall goal
    would make it easier to suggest a good solution.

  • Thanku @mrjj
    I have solved the issue by using bool nativeEvent(const QByteArray &eventType, void *message, long *result). I need this because i need to lock closing and movement of multiple opened windows. And user can enable and disable this feature.

  • Lifetime Qt Champion

    ok like a grid manager of sorts. fair enough :)

Log in to reply