Skip to content

Instantly share code, notes, and snippets.

View dridk's full-sized avatar

sacha schutz dridk

View GitHub Profile
Q_DECL_EXPORT int main(int argc, char *argv[])
{
QApplication app(argc, argv);
GameView *view = new GameView;
view->show();
return app.exec();
@dridk
dridk / gist:3949466
Created October 24, 2012 22:57
QML mode
import bb.cascades 1.0
Page {
Button {
id: rotatingButton
text: "My Rotating Button"
animations: [
RotateTransition {
id: rotButton
toAngleZ: 360
@dridk
dridk / gist:3949483
Created October 24, 2012 23:01
C++ mode
// Create the root page and the button
Page* root = new Page;
Button* myButton = Button::create("My Rotating Button");
// Create a rotation animation and associate it with the button
RotateTransition* rotation = RotateTransition::create(myButton)
.toAngleZ(360)
.duration(350);
// Connect the button's clicked() signal to the animation's play() slot, so that
@dridk
dridk / gist:4126663
Created November 21, 2012 18:23
Comment remplir une listView avec un ArrayDataModel ? 1
// Drilldown navigation project template
import bb.cascades 1.0
Page {
Container {
Button {
text: "add"
onClicked: {
@dridk
dridk / gist:4144520
Created November 25, 2012 17:45
git image
Image
{
source:"http://img.clubic.com/04027682-photo-qt-logo.jpg"
}
/*
* WebImageView.h
*
* Created on: 4 oct. 2012
* Author: schutz
*/
#ifndef WEBIMAGEVIEW_H_
#define WEBIMAGEVIEW_H_
/*
* WebImageView.cpp
*
* Created on: 4 oct. 2012
* Author: schutz
*/
#include "WebImageView.h"
#include <bb/cascades/Image>
@dridk
dridk / gist:4144537
Created November 25, 2012 17:52
main.qml
// 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"
@dridk
dridk / gist:4157525
Created November 27, 2012 22:17
qml repeater
import QtQuick 1.0
Row {
Repeater {
model: 3
Rectangle {
width: 100; height: 40
border.width: 1
color: "yellow"
}
@dridk
dridk / gist:4157558
Created November 27, 2012 22:22
qml repeater exemple
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