unik-qml-blogger run qml code with mouse contextual menu

You can run this examples into unik-qml-blogger!

Select any code segment and Press right mouse button

Run this example in mode 1

This mode make and run a main.qml file in a temp location. You can see this path in the Debug panel fron the unik-qml-blogger.

/*Start code*/
import QtQuick 2.0
import QtQuick.Controls 2.0
ApplicationWindow{
     id:app
     visible: true
     width:500
     height:300
     color: 'red'
     Text{
          text: 'This code is run from web!\nIts run in mode 1'
          anchors.centerIn: parent
     }
     Component.onCompleted: {         
          unik.log('App from Blogger!\nMode 1')
     }
}
/*End code*/

Run this example in mode 2

This mode make and run a main.qml in the first comment location. This path is appended with the path seted into the currentFolder button of unik-qml-blogger. This example run at currentFolder+'/'+exampleMode2/main.qml. . You can see this path in the Debug panel fron the unik-qml-blogger.

Note: The file name in this mode is always seted by first line comment. Will can be other file name. For example: //myFolder/Button.qml

/*Start code*/
//exampleMode2/main.qml
import QtQuick 2.0
import QtQuick.Controls 2.0
ApplicationWindow{
     id:app
     visible: true
     width:500
     height:300
     color: 'red'
     Text{
          text: 'This code is run from web!\nIts run in mode 2'
          anchors.centerIn: parent
     }
     Component.onCompleted: {       
          unik.log('App from Blogger!\nMode 2')
     }
}
/*End code*/

Run this example in mode 3

This mode make and run a main.qml file in a temp location. This mode not require the ApplicationWindow component. This mode will to add a full code for run the selected code. You can see this path and full code in the Debug panel fron the unik-qml-blogger.

/*Start code*/
          Text{
               text: 'This code is run from web!\nIts run in mode 3'
               anchors.centerIn: parent
               font.pixelSize: 40
               wrapMode: Text.WordWrap
          }
          Component.onCompleted: {      
               unik.log('App from Blogger!\nMode 3')
          }
     /*End code*/

Comentarios

Entradas populares