This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ScrollView { | |
| scrollViewProperties.pinchToZoomEnabled: true | |
| scrollViewProperties.initialScalingMethod: ScalingMethod.AspectFit | |
| scrollViewProperties.minContentScale: 1 | |
| scrollViewProperties.maxContentScale: 10 | |
| scrollViewProperties.scrollMode: ScrollMode.Both | |
| Container { | |
| WebView { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ScrollView { | |
| scrollViewProperties.pinchToZoomEnabled: true | |
| scrollViewProperties.initialScalingMethod: ScalingMethod.AspectFit | |
| scrollViewProperties.minContentScale: 1 | |
| scrollViewProperties.maxContentScale: 10 | |
| scrollViewProperties.scrollMode: ScrollMode.Both | |
| Container { | |
| WebView { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void myMessageOutput(QtMsgType type, const char* msg){ | |
| fprintf(stdout, "%s\n", msg); | |
| fflush(stdout); | |
| } | |
| int main(int argc, char **argv) | |
| { | |
| Application app(argc, argv); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Label | |
| { | |
| text:myData.name | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // En C++ , passer votre QVariant au contexte qml | |
| qml->setContextProperty("myData",data); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //parser un json (QString) vers un QVariant | |
| QString source = "{"name": "sacha"} | |
| QVariant data = QxtJson::parse(source); | |
| //affiche "sacha" | |
| qDebug()<<data.toMap().value("name").toString(); | |
| //ecrire du json | |
| QVariantMap data; | |
| data.insert("name", "olivier"); | |
| QString source = QxtJson::parse(data); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| JsonDataAccess jda; | |
| QVariant list = jda.load("contacts.json"); | |
| qDebug()<<list.toMap().value("widget").toMap("window").value("title").toString(); | |
| //affiche Sample Konfabulator Widget |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"widget": { | |
| "debug": "on", | |
| "window": { | |
| "title": "Sample Konfabulator Widget", | |
| "name": "main_window", | |
| "width": 500, | |
| "height": 500 | |
| }, | |
| "image": { | |
| "src": "Images/Sun.png", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Default empty project template | |
| import bb.cascades 1.0 | |
| // creates one page with a label | |
| Page { | |
| titleBar: TitleBar { | |
| options: [ | |
| Option { | |
| text: "title" | |
| } , |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Container { | |
| horizontalAlignment: HorizontalAlignment.Fill | |
| verticalAlignment: VerticalAlignment.Fill | |
| leftPadding: 30 | |
| topPadding: 30 | |
| rightPadding: 30 | |
| Repeater { | |
| // Use a simple number (N) as model -> the delegate will be repeated N times |