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
import QtQuick 2.2 | |
Rectangle { | |
id: root | |
width: 360 | |
height: 360 | |
Timer { | |
id: d |
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
#include "qmlsettings.h" | |
#include <QtCore/QSettings> | |
QmlSettings::QmlSettings(QObject *parent) : | |
QQmlPropertyMap (parent), | |
m_settings (new QSettings(this)) | |
{ | |
m_settings->beginGroup("qml"); | |
foreach (const auto &key, m_settings->allKeys()) { |
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
var scale | |
var flickable | |
var target |
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
import QtQuick 2.1 | |
Item { | |
id: root | |
property color color | |
width: 64; height: 64 | |
Canvas { | |
id: canvas | |
property point center: Qt.point(width / 2, height / 2) |
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
import QtQuick 2.0 | |
Rectangle { | |
id: board | |
width: 480 | |
height: 480 | |
color: "black" | |
Grid { | |
id: grid |
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
TEMPLATE = lib | |
QT += declarative | |
CONFIG += qt plugin | |
TARGET = $$qtLibraryTarget($$TARGET) | |
# for qtcreator | |
uri = com.example.bootstrap | |
#DESTDIR = $$replace(uri, \\., /) |
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
.pragma library | |
function parseResponse(xml) { | |
try { | |
if (xml.documentElement.firstChild.tagName === 'fault') { | |
throw new Error("TODO: XML-RPC fault") | |
} | |
return _parseValue(_querySelector(xml.documentElement, "params param value")) | |
} |
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
.pragma library | |
function Settings(applicationName, applicationVersion) { | |
this.db = openDatabaseSync(applicationName, applicationVersion) | |
this.db.transaction(function(tx) { | |
tx.executeSql('CREATE TABLE IF NOT EXISTS settings(name TEXT UNIQUE, value TEXT)') | |
}) | |
} |
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
int64_t pow_r(int64_t a, int64_t b) | |
{ | |
if (b == 0) | |
return 1; | |
if (b == 1) | |
return a; | |
int64_t res = pow_r(a, b/2); | |
res *= res; |
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
#include <algorithm> // iter_swap | |
#include <vector> | |
#include <assert.h> | |
using namespace std; | |
template<typename IT> | |
bool is_sorted(IT begin, IT end) | |
{ |