Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 1.39 KB | None | 0 0
  1. import QtWebEngine 1.5
  2. import QtQuick 2.10
  3. import QtQuick.Layouts 1.3
  4.  
  5. StackLayout {
  6.   width: 1920
  7.   height: 1080
  8.   objectName: "tabs"
  9.  
  10.   ColumnLayout{
  11.     Image {
  12.       source: "bg.png"
  13.       fillMode: Image.Pad
  14.       horizontalAlignment: Image.AlignLeft
  15.       verticalAlignment: Image.AlignTop
  16.     }
  17.    
  18.     Text {
  19.       objectName: "text"
  20.       color: "white"
  21.       font.family: "DejaVu"
  22.       font.pointSize: 24
  23.       Layout.fillHeight: true
  24.       Layout.fillWidth: true
  25.       horizontalAlignment: Text.AlignHCenter
  26.       verticalAlignment: Text.AlignVCenter
  27.     }
  28.   }
  29.  
  30.   WebEngineView {
  31.     profile:  WebEngineProfile{
  32.       offTheRecord: true
  33.       spellCheckEnabled: false
  34.     }
  35.    
  36.     id: game_webview
  37.     objectName: "game"
  38.     backgroundColor: "black"
  39.     antialiasing: true
  40.  
  41.     signal game_reload()
  42.     signal game_url(string url)
  43.  
  44.     Component.onCompleted: {
  45.       game_reload.connect(reload)
  46.       game_url.connect(setUrl)
  47.     }
  48.  
  49.     onContextMenuRequested: function(request) {
  50.       request.accepted = true;
  51.     }
  52.  
  53.     function setUrl(newurl) {
  54.       url = Qt.resolvedUrl(newurl)
  55.     }
  56.    
  57.     onRenderProcessTerminated: function(status, exit) {
  58.       game_timer.running = true;
  59.     }
  60.  
  61.     Timer {
  62.       id: game_timer
  63.       interval: 0
  64.       running: false
  65.       repeat: false
  66.       onTriggered: game_webview.reload()
  67.     }
  68.   }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement