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. new window cannot direct move
Forum Updated to NodeBB v4.3 + New Features

new window cannot direct move

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 194 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.
  • 0 Offline
    0 Offline
    0ices
    wrote on last edited by
    #1

    I want to drag and drop a new window in the main window. I have created a new window in the mouseMoveEvent of the main window, and I want to continue to drag and drop the new window to place it in the right place without stopping the dragging, but the response to mouseMoveEvent and mouseReleaseEvent after I setFocus() is still the previous main window, what should I do?

    JonBJ 1 Reply Last reply
    0
    • 0 0ices

      I want to drag and drop a new window in the main window. I have created a new window in the mouseMoveEvent of the main window, and I want to continue to drag and drop the new window to place it in the right place without stopping the dragging, but the response to mouseMoveEvent and mouseReleaseEvent after I setFocus() is still the previous main window, what should I do?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @0ices
      Hello and welcome.

      I have not heard of making a window the subject of drag & drop. Nor of creating a new window in a mouseMoveEvent, that would create hundreds of them as the mouse is moved. If anything I would have thought during mousePressEvent.

      It sounds to me as though you are creating this new window while you are in the middle of a mouse drag event on the main window --- you already have the mouse pressed down and you are dragging it? In that situation I do not know that you can/it is easy to "change" the drag which is currently in progress over the main window so that now this new window is focused and receives mouse events.

      The more usual way, it seems to me, would be: create whatever this new window is first, perhaps on main window mouse down, and then initiate a drag and drop event on it.

      1 Reply Last reply
      1

      • Login

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