qmlfrontend/Page1.qml
changeset 14915 a3ad06ac390e
parent 14854 aed75d439027
child 15217 b32c52c76977
equal deleted inserted replaced
14914:9ab78e08a34c 14915:a3ad06ac390e
     3 
     3 
     4 Page1Form {
     4 Page1Form {
     5   focus: true
     5   focus: true
     6 
     6 
     7   property HWEngine hwEngine
     7   property HWEngine hwEngine
       
     8   property NetSession netSession
     8 
     9 
     9   Component {
    10   Component {
    10     id: hwEngineComponent
    11     id: hwEngineComponent
    11 
    12 
    12     HWEngine {
    13     HWEngine {
    13       engineLibrary: "./libhedgewars_engine.so"
    14       engineLibrary: "./libhedgewars_engine.so"
    14       previewAcceptor: PreviewAcceptor
    15       previewAcceptor: PreviewAcceptor
    15       onPreviewImageChanged: previewImage.source = "image://preview/image"
    16       onPreviewImageChanged: previewImage.source = "image://preview/image"
    16       onPreviewIsRendering: previewImage.source = "qrc:/res/iconTime.png"
    17       onPreviewIsRendering: previewImage.source = "qrc:/res/iconTime.png"
       
    18     }
       
    19   }
       
    20 
       
    21   Component {
       
    22     id: netSessionComponent
       
    23 
       
    24     NetSession {
       
    25       nickname: "test0272"
       
    26       url: "hwnet://gameserver.hedgewars.org:46632"
    17     }
    27     }
    18   }
    28   }
    19 
    29 
    20   Component.onCompleted: {
    30   Component.onCompleted: {
    21     hwEngine = hwEngineComponent.createObject()
    31     hwEngine = hwEngineComponent.createObject()
    38     visible: !gameView.engineInstance
    48     visible: !gameView.engineInstance
    39     onClicked: {
    49     onClicked: {
    40       hwEngine.getPreview()
    50       hwEngine.getPreview()
    41     }
    51     }
    42   }
    52   }
       
    53   netButton.onClicked: {
       
    54     netSession = netSessionComponent.createObject()
       
    55     netSession.open()
       
    56   }
    43 
    57 
    44   Keys.onPressed: {
    58   Keys.onPressed: {
    45     if (event.key === Qt.Key_Enter)
    59     if (event.key === Qt.Key_Enter)
    46       gameView.engineInstance.longEvent(EngineInstance.Attack,
    60       gameView.engineInstance.longEvent(EngineInstance.Attack,
    47                                         EngineInstance.Set)
    61                                         EngineInstance.Set)