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. Run external app without button and border
QtWS25 Last Chance

Run external app without button and border

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 2 Posters 381 Views
  • 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.
  • J Offline
    J Offline
    jhayar
    wrote on last edited by
    #1

    is this possible using QProcess?

    Pl45m4P 1 Reply Last reply
    0
    • J jhayar

      is this possible using QProcess?

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @jhayar said in Run external app without button and border:

      is this possible using QProcess?

      That's what QProcess does...
      but what do you mean by "without button and border"?
      QProcess will start the program as if you would start it manually.
      If it has buttons and borders, they also appear.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      J 1 Reply Last reply
      1
      • Pl45m4P Pl45m4

        @jhayar said in Run external app without button and border:

        is this possible using QProcess?

        That's what QProcess does...
        but what do you mean by "without button and border"?
        QProcess will start the program as if you would start it manually.
        If it has buttons and borders, they also appear.

        J Offline
        J Offline
        jhayar
        wrote on last edited by
        #3

        @Pl45m4 , hi im trying to use the WindowContainer of Qt 6.8.0 , i managed to run the app via QProcess and get its windowID , and now i can position the external app on top of my main app but the problem is , it runs on separate window , it has own frame, and also a button , even setting the window with FramelessBorderHint , it doesnt have effect on the child window .

        Pl45m4P 1 Reply Last reply
        0
        • J jhayar

          @Pl45m4 , hi im trying to use the WindowContainer of Qt 6.8.0 , i managed to run the app via QProcess and get its windowID , and now i can position the external app on top of my main app but the problem is , it runs on separate window , it has own frame, and also a button , even setting the window with FramelessBorderHint , it doesnt have effect on the child window .

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by
          #4

          @jhayar

          I have no idea what you are trying there, but it doesn't sound right...
          For what do you need QProcess and why do you want to include another window without buttons?! You can't change external windows/apps and remove buttons using QWidget::createWindowContainer.


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          J 1 Reply Last reply
          0
          • Pl45m4P Pl45m4

            @jhayar

            I have no idea what you are trying there, but it doesn't sound right...
            For what do you need QProcess and why do you want to include another window without buttons?! You can't change external windows/apps and remove buttons using QWidget::createWindowContainer.

            J Offline
            J Offline
            jhayar
            wrote on last edited by jhayar
            #5

            @Pl45m4 the buttons i was talking about is the one that on the upper right corner of the windows , buttons such as minimize maximize and close ,

            what i want to achieve is to embed a foreign window , just like what the document shows here
            https://www.qt.io/blog/window-embedding-in-qt-quick

            at the bottom of the page it says it possible to embed a foreign window
            1c1e2696-96aa-41f1-acaa-708765209751-image.png

            from the screenshot , there is no window buttons , it appears just like other Qt quick controls

            Pl45m4P 1 Reply Last reply
            0
            • J jhayar

              @Pl45m4 the buttons i was talking about is the one that on the upper right corner of the windows , buttons such as minimize maximize and close ,

              what i want to achieve is to embed a foreign window , just like what the document shows here
              https://www.qt.io/blog/window-embedding-in-qt-quick

              at the bottom of the page it says it possible to embed a foreign window
              1c1e2696-96aa-41f1-acaa-708765209751-image.png

              from the screenshot , there is no window buttons , it appears just like other Qt quick controls

              Pl45m4P Offline
              Pl45m4P Offline
              Pl45m4
              wrote on last edited by
              #6

              @jhayar

              Why you thought it helps to keep these information as secret at first? :D

              Ok, you are using Qt Quick, try to embed a non-Qt app window, but it appears on top of your app and still has the window decorations such has the window frame and the title bar with buttons?!

              But what has QProcess to do with it?!

              You issue is probably related to the parent-child architecture.
              I assume because of the usage of QProcess your third-party window is shown parent-less as on top of your Qt App window.

              As mentioned here

              This closes the loop from earlier on why being able to parent a Window to another item, in this case the window container, is a useful feature.

              you have to re-parent your foreign window.


              If debugging is the process of removing software bugs, then programming must be the process of putting them in.

              ~E. W. Dijkstra

              J 1 Reply Last reply
              0
              • Pl45m4P Pl45m4

                @jhayar

                Why you thought it helps to keep these information as secret at first? :D

                Ok, you are using Qt Quick, try to embed a non-Qt app window, but it appears on top of your app and still has the window decorations such has the window frame and the title bar with buttons?!

                But what has QProcess to do with it?!

                You issue is probably related to the parent-child architecture.
                I assume because of the usage of QProcess your third-party window is shown parent-less as on top of your Qt App window.

                As mentioned here

                This closes the loop from earlier on why being able to parent a Window to another item, in this case the window container, is a useful feature.

                you have to re-parent your foreign window.

                J Offline
                J Offline
                jhayar
                wrote on last edited by jhayar
                #7

                @Pl45m4 ,

                sorry if i did not mention it earlier , because i am losing the option that it is still related on the window container from the QML

                okay this is how i use it

                QProcess run for example the Notepad.exe then the window name is "Notepad"
                so i used HWND childwin = FindWindow(0, reinterpret_cast<LPCTSTR>(QString("Notepad").utf16()));

                to get its handle window

                then assuming i put all those codes on a class SampleNotepad inside a function name runChildWin()

                my main.qml was look like this

                Window{
                id: myMain
                visible: true
                width: 1024
                height: 720
                SampleNotepad{
                id: sn
                }
                WindowContainer{
                window: sn.runChildWin()
                anchors.centerIn: parent

                }
                }

                but it did not work

                can you enlighten me what i missed ? or how to do the re-parent your foreign window thing ?

                thanks :)

                Pl45m4P 1 Reply Last reply
                0
                • J jhayar

                  @Pl45m4 ,

                  sorry if i did not mention it earlier , because i am losing the option that it is still related on the window container from the QML

                  okay this is how i use it

                  QProcess run for example the Notepad.exe then the window name is "Notepad"
                  so i used HWND childwin = FindWindow(0, reinterpret_cast<LPCTSTR>(QString("Notepad").utf16()));

                  to get its handle window

                  then assuming i put all those codes on a class SampleNotepad inside a function name runChildWin()

                  my main.qml was look like this

                  Window{
                  id: myMain
                  visible: true
                  width: 1024
                  height: 720
                  SampleNotepad{
                  id: sn
                  }
                  WindowContainer{
                  window: sn.runChildWin()
                  anchors.centerIn: parent

                  }
                  }

                  but it did not work

                  can you enlighten me what i missed ? or how to do the re-parent your foreign window thing ?

                  thanks :)

                  Pl45m4P Offline
                  Pl45m4P Offline
                  Pl45m4
                  wrote on last edited by
                  #8

                  @jhayar said in Run external app without button and border:

                  can you enlighten me what i missed ? or how to do the re-parent your foreign window thing ?

                  I actually never did this myself, but from your linked blog article:

                  As long as the underlying native platform window type is the same type as Qt expects (NSView, UIView, HWND, xcb_window_t, etc), you can use QWindow::fromWinId() to create a foreign QWindow representing the native window, which can then be embedded the same way as above.

                  Have you tried to obtain the WinId from Notepad instead of getting the handle like

                  HWND childwin = FindWindow(0, reinterpret_cast<LPCTSTR>(QString("Notepad").utf16()));
                  

                  ?

                  What if you add parent to you notepad window?

                  WindowContainer{
                       window: sn.runChildWin()
                       parent: myMain
                       anchors.centerIn: parent
                  
                  }
                  
                  

                  If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                  ~E. W. Dijkstra

                  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