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. Releasing window from other window (Qt)?

Releasing window from other window (Qt)?

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

    I work with Qt on VS2012. Part of my code contains intercepting other window (other app) that is working. I managed with intercepting, but when I want to release that window, I can't. Also when I shut down my app the other window should release and continue to work as a independent app (like it was before intercepting). Now that app is still working (in window task manager the process is still working) but there is no window visible.

    Part of my code that allows to intercept other window:

    @
    void MyApp::setWindow(const QString& name)
    {
    WId windowId = (WId) ::FindWindow(0, (TCHAR*)name.utf16());
    if(windowId != NULL)
    {
    childWindow = QWindow::fromWinId(windowId); //QWindow* childWindow
    childWidget = QWidget::createWindowContainer(childWindow); //QWidget* childWidget
    childWidget->setParent(mainWidget); //QWidget* mainwidget = ui.mainWidget;
    childWidget->show();
    }
    }
    @

    I have tried release it by setting parent as 0:

    @
    childWidget->setParent(0);
    @

    but it didn't work.

    Any idea how to do that?

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi,

      Unfortunately there are multiple issues with capturing windows in Windows. See https://bugreports.qt-project.org/browse/QTBUG-40320

      Anyway, try childWindow->setParent(0) and then using the Windows API to set some more flags (see the workarounds in the link I gave)

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      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