Skip to content

Instantly share code, notes, and snippets.

Avatar

sacha schutz dridk

View GitHub Profile
@dridk
dridk / gist:4252345
Created Dec 10, 2012
enable qDebug in blackberry10 SDK
View gist:4252345
void myMessageOutput(QtMsgType type, const char* msg){
fprintf(stdout, "%s\n", msg);
fflush(stdout);
}
int main(int argc, char **argv)
{
Application app(argc, argv);
View gist:4196853
Label
{
text:myData.name
}
@dridk
dridk / gist:4196848
Created Dec 3, 2012
pass contexte qml
View gist:4196848
// En C++ , passer votre QVariant au contexte qml
qml->setContextProperty("myData",data);
@dridk
dridk / gist:4196811
Created Dec 3, 2012
qxtjson example
View gist:4196811
//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);
View gist:4196701
JsonDataAccess jda;
QVariant list = jda.load("contacts.json");
qDebug()<<list.toMap().value("widget").toMap("window").value("title").toString();
//affiche Sample Konfabulator Widget
View gist:4196683
{"widget": {
"debug": "on",
"window": {
"title": "Sample Konfabulator Widget",
"name": "main_window",
"width": 500,
"height": 500
},
"image": {
"src": "Images/Sun.png",
View gist:4172745
// Default empty project template
import bb.cascades 1.0
// creates one page with a label
Page {
titleBar: TitleBar {
options: [
Option {
text: "title"
} ,
@dridk
dridk / gist:4157558
Created Nov 27, 2012
qml repeater exemple
View gist:4157558
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
View gist:4157525
import QtQuick 1.0
Row {
Repeater {
model: 3
Rectangle {
width: 100; height: 40
border.width: 1
color: "yellow"
}
View gist:4144537
// Default empty project template
import bb.cascades 1.0
import org.labsquare 1.0
// creates one page with a label
Page {
Container {
layout: DockLayout {}
WebImageView {
id:img
url:"http://syvolc.briolet.fr/wp-uploads/2010/11/qt-logo1.jpg"
You can’t perform that action at this time.