Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How can we disable Moving QWidget/QDialog from Title-bar?
Forum Update on Monday, May 27th 2025

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

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 1.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TobbY
    wrote on last edited by
    #1

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

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      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.

      1 Reply Last reply
      1
      • T Offline
        T Offline
        TobbY
        wrote on last edited by
        #3

        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.

        mrjjM H 2 Replies Last reply
        0
        • T TobbY

          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.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • T TobbY

            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.

            H Offline
            H Offline
            hbatalha
            wrote on last edited by
            #5

            @TobbY I know this topic is very old but I am facing the same issue and I would like to know how exactly you did that

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved