Run external app without button and border
-
@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. -
@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.@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 .
-
@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 .
I have no idea what you are trying there, but it doesn't sound right...
For what do you needQProcess
and why do you want to include another window without buttons?! You can't change external windows/apps and remove buttons usingQWidget::createWindowContainer
. -
I have no idea what you are trying there, but it doesn't sound right...
For what do you needQProcess
and why do you want to include another window without buttons?! You can't change external windows/apps and remove buttons usingQWidget::createWindowContainer
.@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-quickat the bottom of the page it says it possible to embed a foreign window
from the screenshot , there is no window buttons , it appears just like other Qt quick controls
-
@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-quickat the bottom of the page it says it possible to embed a foreign window
from the screenshot , there is no window buttons , it appears just like other Qt quick controls
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 ofQProcess
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.
-
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 ofQProcess
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.
@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 :)
-
@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 :)
@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 }