Setting pyside window as child for windows application window?



  • I`m trying to set Qt window as a child for another windows application mainwindow. Problem is that if I use windows API SetParent all the keypresses goes straight to parent window instead of my QT app window and also when I close the Qt window, application crashes..

    Is there any method to make this work?



  • Can you explain a little more about your problem??
    Both windows belongs to the same application, aren't they?

    The second Window is a QWidget, QDialog??



  • I`m building add-in for windows application. So what I need is that my Qt window is set as a child for the windows application. For example if you build up some add-in for MS Word, you probably want your add-in window to be child for Word for easier usage.

    Problem is that when I use SetParent API the window goes nicely as a child but if I have for example QLineEdit in my child window and I try to type something to that text field all key presses goes straight to parent app..

    And also when I close the child window it crashes maybe because it is setup as child and should somehow release parent-child relation before closing, but I do not know how.

    For setting the QMainWindow as child I did use:

    @
    hwnd = self.winId() #QMainWindow handle
    handle = parentWindowHWnd #Parent application handle
    ctypes.windll.user32.SetParent(int(hwnd), handle)@


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.