Search code examples
pysidemaya

PySide moving one window to the screen location of another window


I would like to get the screen location of one window, and then take those coordinates and move another window to that location. Thanks.


Solution

  • Just for the position, you can get the position of the first window:

        pos = self.first.pos().toTuple()
    

    and move the second one there:

        self.second.move(*pos)
    

    You can do the same with its size:

        size = self.first.size().toTuple()
        self.second.resize(*size)