Reputation: 1539
Newbie to QT QML and sorry if its just very simple ask.
I have simple piece of code that demonstrate WebEngine Qt Quick example.
/* runtime.qml*/
import QtQuick 2.1
import QtQuick.Controls 1.1
import QtWebEngine 1.1
ApplicationWindow {
width: 1080
height: 1488
visible: true
flags: Qt.WindowFullScreen | Qt.FramelessWindowHint
WebEngineView {
url: "http://www.qt.io"
anchors.fill: parent
}
}
It simply would display a web page and is invoked by following script:
#!/bin/sh
exec /usr/bin/qt5/qmlscene "$1" runtime.qml
This script is triggered when widget placed on some "other window" is clicked
Now, I want that surface created by runtime.qml to be destroyed when someone goes back to "other window" from where script is triggered.
Upvotes: 0
Views: 1139
Reputation: 1199
You can use a close button to close the window, like this:
Image {
id: quitButton
width: 50
height: 50
fillMode: Image.PreserveAspectFit
source: mouseAreaQuitButton.containsMouse ?
"../images/titleBar/quit_hover.png" :
"../images/titleBar/quit.png"
MouseArea {
id: mouseAreaQuitButton
anchors.fill: parent
hoverEnabled: true
onClicked: Qt.quit()
}
}
Upvotes: -1
Reputation: 1198
Qt.quit()
will do the trick :
MouseArea{
anchors.fill: parent
onClicked: {
Qt.quit()
}
}
your question is not clear enough you may need a Timer
too, are you using a Loader
for runtime.qml or loading it?
or instead of using windows you may want to look at Popup which can be opened or closed.
Upvotes: 0