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. Setting pyside window as child for windows application window?
Forum Updated to NodeBB v4.3 + New Features

Setting pyside window as child for windows application window?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 4.6k Views 1 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.
  • S Offline
    S Offline
    sniveri
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      diegosarmentero
      wrote on last edited by
      #2

      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??

      Diego Sarmentero
      Blog: http://diegosarmentero.com.ar
      Twitter: http://twitter.com/diegosarmentero

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sniveri
        wrote on last edited by
        #3

        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)@

        1 Reply Last reply
        0
        • J Offline
          J Offline
          johndevid4
          Banned
          wrote on last edited by
          #4
          This post is deleted!
          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