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 to move 2 separated QWidget synchronously by dragging one of them?
Forum Updated to NodeBB v4.3 + New Features

How to move 2 separated QWidget synchronously by dragging one of them?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 912 Views 2 Watching
  • 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.
  • E Offline
    E Offline
    EpicLoyd
    wrote on last edited by
    #1

    How to move 2 separated QWidget synchronously by dragging one of them?

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

      Hi
      How sync would like it to be
      Like they move on same time as glued together
      or first u move the main window and when
      u release the other window will jump in place`?
      For last case you could use the
      http://doc.qt.io/qt-5.5/qmoveevent.html#details
      and then just move the other widget the same.

      E 1 Reply Last reply
      0
      • mrjjM mrjj

        Hi
        How sync would like it to be
        Like they move on same time as glued together
        or first u move the main window and when
        u release the other window will jump in place`?
        For last case you could use the
        http://doc.qt.io/qt-5.5/qmoveevent.html#details
        and then just move the other widget the same.

        E Offline
        E Offline
        EpicLoyd
        wrote on last edited by
        #3

        @mrjj "Like they move on same time as glued together" - i've no idea how to do that(

        kshegunovK 1 Reply Last reply
        0
        • E EpicLoyd

          @mrjj "Like they move on same time as glued together" - i've no idea how to do that(

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by
          #4

          @EpicLoyd
          Hello,
          Probably the most reliable way to do that is to handle each widget's move events (see @mrjj's link) and call QWidget::move() for the other widget. You might want to stop the issuing's widget move events from being processed in the meantime, otherwise you'll probably get terrible "jitter".

          Kind regards.

          Read and abide by the Qt Code of Conduct

          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