SlideShare una empresa de Scribd logo
1 de 50
Descargar para leer sin conexión
QMLQt Quick
на практике
Хомяков Сергей
Какой UI требует рынок?
Требуется тесное
взаимодействие между
разработчиком
и дизайнером
horizontalLayoutWidget->setGeometry(QRect(10, 0, 501, 51));
horizontalLayout = new QHBoxLayout(horizontalLayoutWidget);
horizontalLayout->setSpacing(6);
horizontalLayout->setContentsMargins(11, 11, 11, 11);
horizontalLayout->setContentsMargins(0, 0, 0, 0);
pushButton_2 = new QPushButton(horizontalLayoutWidget);
horizontalLayout->addWidget(pushButton_2);
pushButton_4 = new QPushButton(horizontalLayoutWidget);
horizontalLayout->addWidget(pushButton_4);
pushButton_3 = new QPushButton(horizontalLayoutWidget);
horizontalLayout->addWidget(pushButton_3);
pushButton = new QPushButton(horizontalLayoutWidget);
horizontalLayout->addWidget(pushButton);
horizontalSlider = new QSlider(centralWidget);
horizontalSlider->setGeometry(QRect(10, 60, 501, 16));
horizontalSlider->setOrientation(Qt::Horizontal);
textEdit = new QTextEdit(centralWidget);
textEdit->setGeometry(QRect(20, 90, 481, 201));
MainWindow->setCentralWidget(centralWidget);
RowLayout {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: 18
Button { text: qsTr("Button 1") }
Button { text: qsTr("Button 2") }
Button { text: qsTr("Button 3") }
Button { text: qsTr("Button 4") }
}
Slider {
x: 143; y: 57
width: 355; height: 28
}
TextArea {
x: 142; y: 105
width: 355; height: 150
}
Что такое QML?
QML
это JSON-подобный декларативный язык программирования,
основанный на JavaScript, использующий С++ API для интеграции с Qt
Qt Quick
это scenegraph-based UI framework, использующий в качестве языка
программирования QML и позиционирующий себя как инструмент
для быстрой разработки и прототипирования
Где уместно использовать Qt Quick?
Там где вы уже используете Qt
Там где требуется не стандартный (вычурный) UI
Там где необходим кросплатформенный “look and feel”
Там где есть постоянно меняющиеся требования к дизайну и бизнес-
логике
Hello World
Hello World
Hello World
Hello World
import QtQuick 2.0
Rectangle {
id: root
width: 120; height: 240
color: "#D8D8D8"
Image {
id: world
x: (parent.width - width)/2
y: 40
source: 'assets/world.png'
}
Text {
y: world.y + world.height + 20
width: root.width
horizontalAlignment: Text.AlignHCenter
text: 'Hello World'
}
}
import QtQuick 2.2
Rectangle {
id: photo
objectName: "photo"
property bool thumbnail: false
property alias image: photoImage.source
signal clicked();
color: "gray"
x: 20; y: 20
height: 150
width: {
if(photoImage.width > 200) {
photoImage.width;
} else {
200;
}
}
function doSomething(dx) {
return dx + photoImage.width;
}
onHeightChanged: {
var tmp = doSomething(photo.height);
console.log( tmp );
}
QtObject {
id: p_attr
readonly property color borderSelectedColor: "red"
readonly property color borderUnSelectedColor: "black"
property int animationDuration: 200
}
Rectangle {
id: border
anchors.centerIn: parent
Image { id: photoImage; anchors.centerIn: parent }
}
MouseArea {
anchors.fill: parent
onClicked: photo.clicked();
}
states:[
State {
name: "Selected"
PropertyChanges { target: border; color: p_attr.borderSelectedColor }
},
State {
name: "UnSelected"
PropertyChanges { target: border; color: p_attr.borderUnSelectedColor }
}
]
transitions: Transition {
to: "Selected"
ColorAnimation { target: border; duration: p_attr.animationDuration }
}
}
import QtQuick 2.2
Rectangle {
id: photo
objectName: "photo"
property bool thumbnail: false
property alias image: photoImage.source
signal clicked();
color: "gray"
x: 20; y: 20
height: 150
width: {
if(photoImage.width > 200) {
photoImage.width;
} else {
200;
}
}
function doSomething(dx) {
return dx + photoImage.width;
}
onHeightChanged: {
var tmp = doSomething(photo.height);
console.log( tmp );
}
QtObject {
id: p_attr
readonly property color borderSelectedColor: "red"
readonly property color borderUnSelectedColor: "black"
property int animationDuration: 200
}
Rectangle {
id: border
anchors.centerIn: parent
Image { id: photoImage; anchors.centerIn: parent }
}
MouseArea {
anchors.fill: parent
onClicked: photo.clicked();
}
states:[
State {
name: "Selected"
PropertyChanges { target: border; color: p_attr.borderSelectedColor }
},
State {
name: "UnSelected"
PropertyChanges { target: border; color: p_attr.borderUnSelectedColor }
}
]
transitions: Transition {
to: "Selected"
ColorAnimation { target: border; duration: p_attr.animationDuration }
}
}
import QtQuick 2.2
Rectangle {
id: photo
objectName: "photo"
property bool thumbnail: false
property alias image: photoImage.source
signal clicked();
color: "gray"
x: 20; y: 20
height: 150
width: {
if(photoImage.width > 200) {
photoImage.width;
} else {
200;
}
}
function doSomething(dx) {
return dx + photoImage.width;
}
onHeightChanged: {
var tmp = doSomething(photo.height);
console.log( tmp );
}
QtObject {
id: p_attr
readonly property color borderSelectedColor: "red"
readonly property color borderUnSelectedColor: "black"
property int animationDuration: 200
}
Rectangle {
id: border
anchors.centerIn: parent
Image { id: photoImage; anchors.centerIn: parent }
}
MouseArea {
anchors.fill: parent
onClicked: photo.clicked();
}
states:[
State {
name: "Selected"
PropertyChanges { target: border; color: p_attr.borderSelectedColor }
},
State {
name: "UnSelected"
PropertyChanges { target: border; color: p_attr.borderUnSelectedColor }
}
]
transitions: Transition {
to: "Selected"
ColorAnimation { target: border; duration: p_attr.animationDuration }
}
}
import QtQuick 2.2
Rectangle {
id: photo
objectName: "photo"
property bool thumbnail: false
property alias image: photoImage.source
signal clicked();
color: "gray"
x: 20; y: 20
height: 150
width: {
if(photoImage.width > 200) {
photoImage.width;
} else {
200;
}
}
function doSomething(dx) {
return dx + photoImage.width;
}
onHeightChanged: {
var tmp = doSomething(photo.height);
console.log( tmp );
}
QtObject {
id: p_attr
readonly property color borderSelectedColor: "red"
readonly property color borderUnSelectedColor: "black"
property int animationDuration: 200
}
Rectangle {
id: border
anchors.centerIn: parent
Image { id: photoImage; anchors.centerIn: parent }
}
MouseArea {
anchors.fill: parent
onClicked: photo.clicked();
}
states:[
State {
name: "Selected"
PropertyChanges { target: border; color: p_attr.borderSelectedColor }
},
State {
name: "UnSelected"
PropertyChanges { target: border; color: p_attr.borderUnSelectedColor }
}
]
transitions: Transition {
to: "Selected"
ColorAnimation { target: border; duration: p_attr.animationDuration }
}
}
import QtQuick 2.2
Rectangle {
id: photo
objectName: "photo"
property bool thumbnail: false
property alias image: photoImage.source
signal clicked();
color: "gray"
x: 20; y: 20
height: 150
width: {
if(photoImage.width > 200) {
photoImage.width;
} else {
200;
}
}
function doSomething(dx) {
return dx + photoImage.width;
}
onHeightChanged: {
var tmp = doSomething(photo.height);
console.log( tmp );
}
QtObject {
id: p_attr
readonly property color borderSelectedColor: "red"
readonly property color borderUnSelectedColor: "black"
property int animationDuration: 200
}
Rectangle {
id: border
anchors.centerIn: parent
Image { id: photoImage; anchors.centerIn: parent }
}
MouseArea {
anchors.fill: parent
onClicked: photo.clicked();
}
states:[
State {
name: "Selected"
PropertyChanges { target: border; color: p_attr.borderSelectedColor }
},
State {
name: "UnSelected"
PropertyChanges { target: border; color: p_attr.borderUnSelectedColor }
}
]
transitions: Transition {
to: "Selected"
ColorAnimation { target: border; duration: p_attr.animationDuration }
}
}
import QtQuick 2.2
Rectangle {
id: photo
objectName: "photo"
property bool thumbnail: false
property alias image: photoImage.source
signal clicked();
color: "gray"
x: 20; y: 20
height: 150
width: {
if(photoImage.width > 200) {
photoImage.width;
} else {
200;
}
}
function doSomething(dx) {
return dx + photoImage.width;
}
onHeightChanged: {
var tmp = doSomething(photo.height);
console.log( tmp );
}
QtObject {
id: p_attr
readonly property color borderSelectedColor: "red"
readonly property color borderUnSelectedColor: "black"
property int animationDuration: 200
}
Rectangle {
id: border
anchors.centerIn: parent
Image { id: photoImage; anchors.centerIn: parent }
}
MouseArea {
anchors.fill: parent
onClicked: photo.clicked();
}
states:[
State {
name: "Selected"
PropertyChanges { target: border; color: p_attr.borderSelectedColor }
},
State {
name: "UnSelected"
PropertyChanges { target: border; color: p_attr.borderUnSelectedColor }
}
]
transitions: Transition {
to: "Selected"
ColorAnimation { target: border; duration: p_attr.animationDuration }
}
}
import QtQuick 2.2
Rectangle {
id: photo
objectName: "photo"
property bool thumbnail: false
property alias image: photoImage.source
signal clicked();
color: "gray"
x: 20; y: 20
height: 150
width: {
if(photoImage.width > 200) {
photoImage.width;
} else {
200;
}
}
function doSomething(dx) {
return dx + photoImage.width;
}
onHeightChanged: {
var tmp = doSomething(photo.height);
console.log( tmp );
}
QtObject {
id: p_attr
readonly property color borderSelectedColor: "red"
readonly property color borderUnSelectedColor: "black"
property int animationDuration: 200
}
Rectangle {
id: border
anchors.centerIn: parent
Image { id: photoImage; anchors.centerIn: parent }
}
MouseArea {
anchors.fill: parent
onClicked: photo.clicked();
}
states:[
State {
name: "Selected"
PropertyChanges { target: border; color: p_attr.borderSelectedColor }
},
State {
name: "UnSelected"
PropertyChanges { target: border; color: p_attr.borderUnSelectedColor }
}
]
transitions: Transition {
to: "Selected"
ColorAnimation { target: border; duration: p_attr.animationDuration }
}
}
import QtQuick 2.2
Rectangle {
id: photo
objectName: "photo"
property bool thumbnail: false
property alias image: photoImage.source
signal clicked();
color: "gray"
x: 20; y: 20
height: 150
width: {
if(photoImage.width > 200) {
photoImage.width;
} else {
200;
}
}
function doSomething(dx) {
return dx + photoImage.width;
}
onHeightChanged: {
var tmp = doSomething(photo.height);
console.log( tmp );
}
QtObject {
id: p_attr
readonly property color borderSelectedColor: "red"
readonly property color borderUnSelectedColor: "black"
property int animationDuration: 200
}
Rectangle {
id: border
anchors.centerIn: parent
Image { id: photoImage; anchors.centerIn: parent }
}
MouseArea {
anchors.fill: parent
onClicked: photo.clicked();
}
states:[
State {
name: "Selected"
PropertyChanges { target: border; color: p_attr.borderSelectedColor }
},
State {
name: "UnSelected"
PropertyChanges { target: border; color: p_attr.borderUnSelectedColor }
}
]
transitions: Transition {
to: "Selected"
ColorAnimation { target: border; duration: p_attr.animationDuration }
}
}
import QtQuick 2.2
Rectangle {
id: photo
objectName: "photo"
property bool thumbnail: false
property alias image: photoImage.source
signal clicked();
color: "gray"
x: 20; y: 20
height: 150
width: {
if(photoImage.width > 200) {
photoImage.width;
} else {
200;
}
}
function doSomething(dx) {
return dx + photoImage.width;
}
onHeightChanged: {
var tmp = doSomething(photo.height);
console.log( tmp );
}
QtObject {
id: p_attr
readonly property color borderSelectedColor: "red"
readonly property color borderUnSelectedColor: "black"
property int animationDuration: 200
}
Rectangle {
id: border
anchors.centerIn: parent
Image { id: photoImage; anchors.centerIn: parent }
}
MouseArea {
anchors.fill: parent
onClicked: photo.clicked();
}
states:[
State {
name: "Selected"
PropertyChanges { target: border; color: p_attr.borderSelectedColor }
},
State {
name: "UnSelected"
PropertyChanges { target: border; color: p_attr.borderUnSelectedColor }
}
]
transitions: Transition {
to: "Selected"
ColorAnimation { target: border; duration: p_attr.animationDuration }
}
}
// Circle.qml
import QtQuick 2.0
Rectangle {
property real diameter : 30
width: diameter
height: diameter
radius: diameter
}
import QtQuick 2.0
Rectangle {
width: 120; height: 240
Column {
anchors.fill: parent
Repeater {
model: 3
Circle {
color: "blue"
diameter: 90
}
}
}
}
Позиционирование
и выравнивание
Якоря бывают двух видов:
-ссылающиеся на элемент (centerIn, fill)
-ссылающиеся на другой якорь ( left, right, top, bottom, …. )
import QtQuick 2.0
Rectangle {
id: root
width: 120; height: 240
color: "#D8D8D8"
Image {
id: world
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: 40
source: 'assets/world.png'
}
Text {
anchors.top: world.bottom
anchors.topMargin: 20
anchors.horizontalCenter: world.horizontalCenter
text: 'Hello World'
}
}
Hello World
Причём тут С++?
С++ API позволяет:
– экспортировать в QML C++ обьекты наследованные от QObject
– экспортировать в QML не визуальные типы
– классы на основе QQuickPaintedItem для визуальных элементов с
поддержкой QPainter
– классы на основе QQuickItem для визуальных элементов сцены
Экспорт С++ объекта
class User : public QObject
{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(int age READ age WRITE setAge NOTIFY ageChanged)
public:
User(const QString &name, int age, QObject *parent = 0);
...
}
void main( int argc, char* argv[] ) {
...
User *currentUser = new User("Alice", 29);
QQuickView *view = new QQuickView;
QQmlContext *context = view->engine()->rootContext();
context->setContextProperty("currentUser", currentUser);
...
}
void main( int argc, char* argv[] ) {
...
User *currentUser = new User("Alice", 29);
QQuickView *view = new QQuickView;
QQmlContext *context = view->engine()->rootContext();
context->setContextProperty("currentUser", currentUser);
...
}
Text {
text : currentUser.name
}
Экспорт С++ типа
#include <QObject>
class CustomTimer : public QObject
{
Q_OBJECT
Q_PROPERTY( int interval READ interval WRITE setInterval NOTIFY intervalChanged )
public:
CustomTimer(QObject *parent = 0);
int interval() const;
public slots:
void start();
void stop();
void setInterval(int arg);
signals:
void intervalChanged(int arg);
void timeout();
private:
QTimer* m_timer;
int m_interval;
};
#include <QGuiApplication>
#include <QQuickView>
#include "CustomTimer.h"
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
qmlRegisterType<CustomTimer>("CustomComponents", 1, 0, "CustomTimer");
QQuickView view;
view.setSource(QUrl("qrc:///main.qml"));
view.show();
return app.exec();
}
import CustomComponents 1.0
Rectangle {
id: root
Component.onCompleted: {
timer.start();
}
……..
CustomTimer {
id: timer
interval: 3000
onTimeout: {
console.log( "Timer timeout!" );
root.color = "red";
}
}
}
Экспорт QQuickPaintedltem
#include <QQuickPaintedItem>
class EllipseItem : public QQuickPaintedItem
{
Q_OBJECT
public:
EllipseItem(QQuickItem *parent = 0);
void paint(QPainter *painter);
};
void EllipseItem::paint(QPainter *painter)
{
const qreal halfPenWidth = qMax(painter->pen().width() / 2.0, 1.0);
QRectF rect = boundingRect();
rect.adjust(halfPenWidth, halfPenWidth, -halfPenWidth, -halfPenWidth);
painter->drawEllipse(rect);
}
#include <QGuiApplication>
#include <QQuickView>
#include "EllipseItem.h"
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
qmlRegisterType<EllipseItem>("CustomComponents", 1, 0, "Ellipse");
QQuickView view;
view.setSource(QUrl("qrc:///main.qml"));
view.show();
return app.exec();
}
import CustomComponents 1.0
Rectangle {
id: root
EllipseItem {
anchors.centerIn: parent
width: 64
height: 48
}
}
Экспорт QQuickltem
#include <QQuickItem>
#include <QSGGeometry>
#include <QSGFlatColorMaterial>
class TriangleItem : public QQuickItem
{
Q_OBJECT
public:
TriangleItem(QQuickItem *parent = 0);
protected:
QSGNode *updatePaintNode(QSGNode *node, UpdatePaintNodeData *data);
private:
QSGGeometry m_geometry;
QSGFlatColorMaterial m_material;
};
QSGNode *TriangleItem::updatePaintNode(QSGNode *n, UpdatePaintNodeData *)
{
QSGGeometryNode *node = static_cast<QSGGeometryNode *>(n);
if (!node) node = new QSGGeometryNode();
QSGGeometry::Point2D *v = m_geometry.vertexDataAsPoint2D();
const QRectF rect = boundingRect();
v[0].x = rect.left();
v[0].y = rect.bottom();
v[1].x = rect.left() + rect.width()/2;
v[1].y = rect.top();
v[2].x = rect.right();
v[2].y = rect.bottom();
node->setGeometry(&m_geometry);
node->setMaterial(&m_material);
return node;
}
QSGNode * QQuickCustomItem::updatePaintNode(QSGNode * node, UpdatePaintNodeData * nodedata)
{
TexureHolderNode * texture_node = static_cast<TexureHolderNode *>(node);
if (!texture_node) texture_node = new TexureHolderNode();
if (texture_node->fbo_ && (texture_node->fbo_->width() != width() || texture_node->fbo_->height() != height()))
{
texture_node->fbo_.reset();
}
if (texture_node->fbo_.isNull())
{
QSize fboSize(qMax<int>(1, int(width())), qMax<int>(1, int(height())));
QOpenGLFramebufferObjectFormat format;
texture_node->fbo_.reset(new QOpenGLFramebufferObject(fboSize, format));
texture_node->setTexture( window()->createTextureFromId( texture_node->fbo_->texture(), texture_node->fbo_->size(), 0) );
texture_node->setRect(0, 0, width(), height());
redraw_texture_needed_ = true;
}
if (redraw_texture_needed_)
{
redraw_texture_needed_ = false;
texture_node->fbo_->bind();
{
paintGL();
}
texture_node->fbo_->bindDefault();
texture_node->markDirty(QSGNode::DirtyMaterial);
}
return texture_node;
}
class TexureHolderNode
: public QSGSimpleTextureNode
{
public:
TexureHolderNode() {}
QScopedPointer<QOpenGLFramebufferObject> fbo_;
};
https://github.com/2gis/qtandroidextensions
Что нужно оставлять
в плюсах, что лучше перенести в
QML?
Инструменты разработки
и отладки
Autopilot-Qt5QtCreator GammaRay Squish
– qt.io/ru/download-open-source
– kdab.com/gammaray
– froglogic.com/squish
– wiki.ubuntu.com/Touch/Testing/Autopilot
Вопросы?
Хомяков Сергей
s.homyakov@2gis.ru

Más contenido relacionado

La actualidad más candente

Александр Зимин – Анимация как средство самовыражения
Александр Зимин – Анимация как средство самовыраженияАлександр Зимин – Анимация как средство самовыражения
Александр Зимин – Анимация как средство самовыраженияCocoaHeads
 
Integration of Google-map in Rails Application
Integration of Google-map in Rails ApplicationIntegration of Google-map in Rails Application
Integration of Google-map in Rails ApplicationSwati Jadhav
 
Enhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsEnhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsNaman Dwivedi
 
The Ring programming language version 1.9 book - Part 14 of 210
The Ring programming language version 1.9 book - Part 14 of 210The Ring programming language version 1.9 book - Part 14 of 210
The Ring programming language version 1.9 book - Part 14 of 210Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 12 of 202
The Ring programming language version 1.8 book - Part 12 of 202The Ring programming language version 1.8 book - Part 12 of 202
The Ring programming language version 1.8 book - Part 12 of 202Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 63 of 196
The Ring programming language version 1.7 book - Part 63 of 196The Ring programming language version 1.7 book - Part 63 of 196
The Ring programming language version 1.7 book - Part 63 of 196Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 70 of 184
The Ring programming language version 1.5.3 book - Part 70 of 184The Ring programming language version 1.5.3 book - Part 70 of 184
The Ring programming language version 1.5.3 book - Part 70 of 184Mahmoud Samir Fayed
 
Building Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice NinjaBuilding Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice NinjaDroidConTLV
 
How Quick Can We Be? Data Visualization Techniques for Engineers.
How Quick Can We Be? Data Visualization Techniques for Engineers. How Quick Can We Be? Data Visualization Techniques for Engineers.
How Quick Can We Be? Data Visualization Techniques for Engineers. Avni Khatri
 
The Ring programming language version 1.5.2 book - Part 63 of 181
The Ring programming language version 1.5.2 book - Part 63 of 181The Ring programming language version 1.5.2 book - Part 63 of 181
The Ring programming language version 1.5.2 book - Part 63 of 181Mahmoud Samir Fayed
 
Lec 11 12_sept [compatibility mode]
Lec 11 12_sept [compatibility mode]Lec 11 12_sept [compatibility mode]
Lec 11 12_sept [compatibility mode]Palak Sanghani
 
The Ring programming language version 1.4.1 book - Part 18 of 31
The Ring programming language version 1.4.1 book - Part 18 of 31The Ring programming language version 1.4.1 book - Part 18 of 31
The Ring programming language version 1.4.1 book - Part 18 of 31Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 70 of 212
The Ring programming language version 1.10 book - Part 70 of 212The Ring programming language version 1.10 book - Part 70 of 212
The Ring programming language version 1.10 book - Part 70 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 73 of 189
The Ring programming language version 1.6 book - Part 73 of 189The Ring programming language version 1.6 book - Part 73 of 189
The Ring programming language version 1.6 book - Part 73 of 189Mahmoud Samir Fayed
 

La actualidad más candente (18)

Games 3 dl4-example
Games 3 dl4-exampleGames 3 dl4-example
Games 3 dl4-example
 
Александр Зимин – Анимация как средство самовыражения
Александр Зимин – Анимация как средство самовыраженияАлександр Зимин – Анимация как средство самовыражения
Александр Зимин – Анимация как средство самовыражения
 
Integration of Google-map in Rails Application
Integration of Google-map in Rails ApplicationIntegration of Google-map in Rails Application
Integration of Google-map in Rails Application
 
Real life XNA
Real life XNAReal life XNA
Real life XNA
 
iOS Training Session-3
iOS Training Session-3iOS Training Session-3
iOS Training Session-3
 
Enhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsEnhancing UI/UX using Java animations
Enhancing UI/UX using Java animations
 
The Ring programming language version 1.9 book - Part 14 of 210
The Ring programming language version 1.9 book - Part 14 of 210The Ring programming language version 1.9 book - Part 14 of 210
The Ring programming language version 1.9 book - Part 14 of 210
 
The Ring programming language version 1.8 book - Part 12 of 202
The Ring programming language version 1.8 book - Part 12 of 202The Ring programming language version 1.8 book - Part 12 of 202
The Ring programming language version 1.8 book - Part 12 of 202
 
The Ring programming language version 1.7 book - Part 63 of 196
The Ring programming language version 1.7 book - Part 63 of 196The Ring programming language version 1.7 book - Part 63 of 196
The Ring programming language version 1.7 book - Part 63 of 196
 
The Ring programming language version 1.5.3 book - Part 70 of 184
The Ring programming language version 1.5.3 book - Part 70 of 184The Ring programming language version 1.5.3 book - Part 70 of 184
The Ring programming language version 1.5.3 book - Part 70 of 184
 
Building Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice NinjaBuilding Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice Ninja
 
How Quick Can We Be? Data Visualization Techniques for Engineers.
How Quick Can We Be? Data Visualization Techniques for Engineers. How Quick Can We Be? Data Visualization Techniques for Engineers.
How Quick Can We Be? Data Visualization Techniques for Engineers.
 
The Ring programming language version 1.5.2 book - Part 63 of 181
The Ring programming language version 1.5.2 book - Part 63 of 181The Ring programming language version 1.5.2 book - Part 63 of 181
The Ring programming language version 1.5.2 book - Part 63 of 181
 
Lec 11 12_sept [compatibility mode]
Lec 11 12_sept [compatibility mode]Lec 11 12_sept [compatibility mode]
Lec 11 12_sept [compatibility mode]
 
The Ring programming language version 1.4.1 book - Part 18 of 31
The Ring programming language version 1.4.1 book - Part 18 of 31The Ring programming language version 1.4.1 book - Part 18 of 31
The Ring programming language version 1.4.1 book - Part 18 of 31
 
Canvas al ajillo
Canvas al ajilloCanvas al ajillo
Canvas al ajillo
 
The Ring programming language version 1.10 book - Part 70 of 212
The Ring programming language version 1.10 book - Part 70 of 212The Ring programming language version 1.10 book - Part 70 of 212
The Ring programming language version 1.10 book - Part 70 of 212
 
The Ring programming language version 1.6 book - Part 73 of 189
The Ring programming language version 1.6 book - Part 73 of 189The Ring programming language version 1.6 book - Part 73 of 189
The Ring programming language version 1.6 book - Part 73 of 189
 

Destacado

Как мы уменьшили количество ошибок в Unreal Engine с помощью статического ана...
Как мы уменьшили количество ошибок в Unreal Engine с помощью статического ана...Как мы уменьшили количество ошибок в Unreal Engine с помощью статического ана...
Как мы уменьшили количество ошибок в Unreal Engine с помощью статического ана...Platonov Sergey
 
Дмитрий Кашицын, Вывод типов в динамических и не очень языках II
Дмитрий Кашицын, Вывод типов в динамических и не очень языках IIДмитрий Кашицын, Вывод типов в динамических и не очень языках II
Дмитрий Кашицын, Вывод типов в динамических и не очень языках IIPlatonov Sergey
 
Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.Platonov Sergey
 
Павел Беликов, Опыт мигрирования крупного проекта с Windows-only на Linux
Павел Беликов, Опыт мигрирования крупного проекта с Windows-only на LinuxПавел Беликов, Опыт мигрирования крупного проекта с Windows-only на Linux
Павел Беликов, Опыт мигрирования крупного проекта с Windows-only на LinuxPlatonov Sergey
 
Функциональный микроскоп: линзы в C++
Функциональный микроскоп: линзы в C++Функциональный микроскоп: линзы в C++
Функциональный микроскоп: линзы в C++Platonov Sergey
 
Визуализация автомобильных маршрутов
Визуализация автомобильных маршрутовВизуализация автомобильных маршрутов
Визуализация автомобильных маршрутовPlatonov Sergey
 
HPX: C++11 runtime система для параллельных и распределённых вычислений
HPX: C++11 runtime система для параллельных и распределённых вычисленийHPX: C++11 runtime система для параллельных и распределённых вычислений
HPX: C++11 runtime система для параллельных и распределённых вычисленийPlatonov Sergey
 
Ranges calendar-novosibirsk-2015-08
Ranges calendar-novosibirsk-2015-08Ranges calendar-novosibirsk-2015-08
Ranges calendar-novosibirsk-2015-08Platonov Sergey
 
Тененёв Анатолий, Boost.Asio в алгоритмической торговле
Тененёв Анатолий, Boost.Asio в алгоритмической торговлеТененёв Анатолий, Boost.Asio в алгоритмической торговле
Тененёв Анатолий, Boost.Asio в алгоритмической торговлеPlatonov Sergey
 
Дмитрий Кашицын, Вывод типов в динамических и не очень языках I
Дмитрий Кашицын, Вывод типов в динамических и не очень языках IДмитрий Кашицын, Вывод типов в динамических и не очень языках I
Дмитрий Кашицын, Вывод типов в динамических и не очень языках IPlatonov Sergey
 
Антон Бикинеев, Reflection in C++Next
Антон Бикинеев,  Reflection in C++NextАнтон Бикинеев,  Reflection in C++Next
Антон Бикинеев, Reflection in C++NextSergey Platonov
 
Григорий Демченко, Универсальный адаптер
Григорий Демченко, Универсальный адаптерГригорий Демченко, Универсальный адаптер
Григорий Демченко, Универсальный адаптерSergey Platonov
 
Использование юнит-тестов для повышения качества разработки
Использование юнит-тестов для повышения качества разработкиИспользование юнит-тестов для повышения качества разработки
Использование юнит-тестов для повышения качества разработкиvictor-yastrebov
 
Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...
Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...
Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...Platonov Sergey
 
Сергей Шамбир, Адаптация Promise/A+ для взаимодействия между C++ и Javascript
Сергей Шамбир, Адаптация Promise/A+ для взаимодействия между C++ и JavascriptСергей Шамбир, Адаптация Promise/A+ для взаимодействия между C++ и Javascript
Сергей Шамбир, Адаптация Promise/A+ для взаимодействия между C++ и JavascriptSergey Platonov
 
Полухин Антон, Как делать не надо: C++ велосипедостроение для профессионалов
Полухин Антон, Как делать не надо: C++ велосипедостроение для профессионаловПолухин Антон, Как делать не надо: C++ велосипедостроение для профессионалов
Полухин Антон, Как делать не надо: C++ велосипедостроение для профессионаловSergey Platonov
 
Алексей Кутумов, C++ без исключений, часть 3
Алексей Кутумов,  C++ без исключений, часть 3Алексей Кутумов,  C++ без исключений, часть 3
Алексей Кутумов, C++ без исключений, часть 3Platonov Sergey
 

Destacado (20)

C++ exceptions
C++ exceptionsC++ exceptions
C++ exceptions
 
Как мы уменьшили количество ошибок в Unreal Engine с помощью статического ана...
Как мы уменьшили количество ошибок в Unreal Engine с помощью статического ана...Как мы уменьшили количество ошибок в Unreal Engine с помощью статического ана...
Как мы уменьшили количество ошибок в Unreal Engine с помощью статического ана...
 
Дмитрий Кашицын, Вывод типов в динамических и не очень языках II
Дмитрий Кашицын, Вывод типов в динамических и не очень языках IIДмитрий Кашицын, Вывод типов в динамических и не очень языках II
Дмитрий Кашицын, Вывод типов в динамических и не очень языках II
 
Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.
 
Павел Беликов, Опыт мигрирования крупного проекта с Windows-only на Linux
Павел Беликов, Опыт мигрирования крупного проекта с Windows-only на LinuxПавел Беликов, Опыт мигрирования крупного проекта с Windows-only на Linux
Павел Беликов, Опыт мигрирования крупного проекта с Windows-only на Linux
 
Функциональный микроскоп: линзы в C++
Функциональный микроскоп: линзы в C++Функциональный микроскоп: линзы в C++
Функциональный микроскоп: линзы в C++
 
Визуализация автомобильных маршрутов
Визуализация автомобильных маршрутовВизуализация автомобильных маршрутов
Визуализация автомобильных маршрутов
 
HPX: C++11 runtime система для параллельных и распределённых вычислений
HPX: C++11 runtime система для параллельных и распределённых вычисленийHPX: C++11 runtime система для параллельных и распределённых вычислений
HPX: C++11 runtime система для параллельных и распределённых вычислений
 
Ranges calendar-novosibirsk-2015-08
Ranges calendar-novosibirsk-2015-08Ranges calendar-novosibirsk-2015-08
Ranges calendar-novosibirsk-2015-08
 
Тененёв Анатолий, Boost.Asio в алгоритмической торговле
Тененёв Анатолий, Boost.Asio в алгоритмической торговлеТененёв Анатолий, Boost.Asio в алгоритмической торговле
Тененёв Анатолий, Boost.Asio в алгоритмической торговле
 
Дмитрий Кашицын, Вывод типов в динамических и не очень языках I
Дмитрий Кашицын, Вывод типов в динамических и не очень языках IДмитрий Кашицын, Вывод типов в динамических и не очень языках I
Дмитрий Кашицын, Вывод типов в динамических и не очень языках I
 
Антон Бикинеев, Reflection in C++Next
Антон Бикинеев,  Reflection in C++NextАнтон Бикинеев,  Reflection in C++Next
Антон Бикинеев, Reflection in C++Next
 
Григорий Демченко, Универсальный адаптер
Григорий Демченко, Универсальный адаптерГригорий Демченко, Универсальный адаптер
Григорий Демченко, Универсальный адаптер
 
Использование юнит-тестов для повышения качества разработки
Использование юнит-тестов для повышения качества разработкиИспользование юнит-тестов для повышения качества разработки
Использование юнит-тестов для повышения качества разработки
 
Clang tidy
Clang tidyClang tidy
Clang tidy
 
Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...
Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...
Евгений Рыжков, Андрей Карпов Как потратить 10 лет на разработку анализатора ...
 
Сергей Шамбир, Адаптация Promise/A+ для взаимодействия между C++ и Javascript
Сергей Шамбир, Адаптация Promise/A+ для взаимодействия между C++ и JavascriptСергей Шамбир, Адаптация Promise/A+ для взаимодействия между C++ и Javascript
Сергей Шамбир, Адаптация Promise/A+ для взаимодействия между C++ и Javascript
 
Parallel STL
Parallel STLParallel STL
Parallel STL
 
Полухин Антон, Как делать не надо: C++ велосипедостроение для профессионалов
Полухин Антон, Как делать не надо: C++ велосипедостроение для профессионаловПолухин Антон, Как делать не надо: C++ велосипедостроение для профессионалов
Полухин Антон, Как делать не надо: C++ велосипедостроение для профессионалов
 
Алексей Кутумов, C++ без исключений, часть 3
Алексей Кутумов,  C++ без исключений, часть 3Алексей Кутумов,  C++ без исключений, часть 3
Алексей Кутумов, C++ без исключений, часть 3
 

Similar a QML\Qt Quick на практике

Ubuntu app development
Ubuntu app development Ubuntu app development
Ubuntu app development Xiaoguo Liu
 
UI Design From Scratch - Part 5 - transcript.pdf
UI Design From Scratch - Part 5 - transcript.pdfUI Design From Scratch - Part 5 - transcript.pdf
UI Design From Scratch - Part 5 - transcript.pdfShaiAlmog1
 
Creating an Uber Clone - Part XXII.pdf
Creating an Uber Clone - Part XXII.pdfCreating an Uber Clone - Part XXII.pdf
Creating an Uber Clone - Part XXII.pdfShaiAlmog1
 
I need to create a page looks like a picture. But it looks different.pdf
I need to create a page looks like a picture. But it looks different.pdfI need to create a page looks like a picture. But it looks different.pdf
I need to create a page looks like a picture. But it looks different.pdfallurafashions98
 
Making Games in JavaScript
Making Games in JavaScriptMaking Games in JavaScript
Making Games in JavaScriptSam Cartwright
 
Creating an Uber Clone - Part XXII - Transcript.pdf
Creating an Uber Clone - Part XXII - Transcript.pdfCreating an Uber Clone - Part XXII - Transcript.pdf
Creating an Uber Clone - Part XXII - Transcript.pdfShaiAlmog1
 
Yahoo Open Source - The Tour & Mystery of AppDevKit (MOPCON 2016)
Yahoo Open Source - The Tour & Mystery of AppDevKit (MOPCON 2016)Yahoo Open Source - The Tour & Mystery of AppDevKit (MOPCON 2016)
Yahoo Open Source - The Tour & Mystery of AppDevKit (MOPCON 2016)anistar sung
 
Creating an Uber Clone - Part IV - Transcript.pdf
Creating an Uber Clone - Part IV - Transcript.pdfCreating an Uber Clone - Part IV - Transcript.pdf
Creating an Uber Clone - Part IV - Transcript.pdfShaiAlmog1
 
UI Design From Scratch - Part 5.pdf
UI Design From Scratch - Part 5.pdfUI Design From Scratch - Part 5.pdf
UI Design From Scratch - Part 5.pdfShaiAlmog1
 
Creating an Uber Clone - Part XXI.pdf
Creating an Uber Clone - Part XXI.pdfCreating an Uber Clone - Part XXI.pdf
Creating an Uber Clone - Part XXI.pdfShaiAlmog1
 
Version1.0 StartHTML000000232 EndHTML000065057 StartFragment0000.docx
Version1.0 StartHTML000000232 EndHTML000065057 StartFragment0000.docxVersion1.0 StartHTML000000232 EndHTML000065057 StartFragment0000.docx
Version1.0 StartHTML000000232 EndHTML000065057 StartFragment0000.docxtienboileau
 
Exploring Canvas
Exploring CanvasExploring Canvas
Exploring CanvasKevin Hoyt
 
Kotlin Mullets
Kotlin MulletsKotlin Mullets
Kotlin MulletsJames Ward
 
Synchronizing without internet - Multipeer Connectivity (iOS)
Synchronizing without internet - Multipeer Connectivity (iOS)Synchronizing without internet - Multipeer Connectivity (iOS)
Synchronizing without internet - Multipeer Connectivity (iOS)Jorge Maroto
 
Petri Niemi Qt Advanced Part 2
Petri Niemi Qt Advanced Part 2Petri Niemi Qt Advanced Part 2
Petri Niemi Qt Advanced Part 2NokiaAppForum
 
AWS IoTで家庭内IoTをやってみた【JAWS DAYS 2016】
AWS IoTで家庭内IoTをやってみた【JAWS DAYS 2016】AWS IoTで家庭内IoTをやってみた【JAWS DAYS 2016】
AWS IoTで家庭内IoTをやってみた【JAWS DAYS 2016】tsuchimon
 

Similar a QML\Qt Quick на практике (20)

Ubuntu app development
Ubuntu app development Ubuntu app development
Ubuntu app development
 
UI Design From Scratch - Part 5 - transcript.pdf
UI Design From Scratch - Part 5 - transcript.pdfUI Design From Scratch - Part 5 - transcript.pdf
UI Design From Scratch - Part 5 - transcript.pdf
 
Creating an Uber Clone - Part XXII.pdf
Creating an Uber Clone - Part XXII.pdfCreating an Uber Clone - Part XXII.pdf
Creating an Uber Clone - Part XXII.pdf
 
I need to create a page looks like a picture. But it looks different.pdf
I need to create a page looks like a picture. But it looks different.pdfI need to create a page looks like a picture. But it looks different.pdf
I need to create a page looks like a picture. But it looks different.pdf
 
Game dev 101 part 3
Game dev 101 part 3Game dev 101 part 3
Game dev 101 part 3
 
Making Games in JavaScript
Making Games in JavaScriptMaking Games in JavaScript
Making Games in JavaScript
 
Creating an Uber Clone - Part XXII - Transcript.pdf
Creating an Uber Clone - Part XXII - Transcript.pdfCreating an Uber Clone - Part XXII - Transcript.pdf
Creating an Uber Clone - Part XXII - Transcript.pdf
 
662305 LAB13
662305 LAB13662305 LAB13
662305 LAB13
 
Yahoo Open Source - The Tour & Mystery of AppDevKit (MOPCON 2016)
Yahoo Open Source - The Tour & Mystery of AppDevKit (MOPCON 2016)Yahoo Open Source - The Tour & Mystery of AppDevKit (MOPCON 2016)
Yahoo Open Source - The Tour & Mystery of AppDevKit (MOPCON 2016)
 
Creating an Uber Clone - Part IV - Transcript.pdf
Creating an Uber Clone - Part IV - Transcript.pdfCreating an Uber Clone - Part IV - Transcript.pdf
Creating an Uber Clone - Part IV - Transcript.pdf
 
UI Design From Scratch - Part 5.pdf
UI Design From Scratch - Part 5.pdfUI Design From Scratch - Part 5.pdf
UI Design From Scratch - Part 5.pdf
 
Creating an Uber Clone - Part XXI.pdf
Creating an Uber Clone - Part XXI.pdfCreating an Uber Clone - Part XXI.pdf
Creating an Uber Clone - Part XXI.pdf
 
Version1.0 StartHTML000000232 EndHTML000065057 StartFragment0000.docx
Version1.0 StartHTML000000232 EndHTML000065057 StartFragment0000.docxVersion1.0 StartHTML000000232 EndHTML000065057 StartFragment0000.docx
Version1.0 StartHTML000000232 EndHTML000065057 StartFragment0000.docx
 
Exploring Canvas
Exploring CanvasExploring Canvas
Exploring Canvas
 
Kotlin Mullets
Kotlin MulletsKotlin Mullets
Kotlin Mullets
 
Synchronizing without internet - Multipeer Connectivity (iOS)
Synchronizing without internet - Multipeer Connectivity (iOS)Synchronizing without internet - Multipeer Connectivity (iOS)
Synchronizing without internet - Multipeer Connectivity (iOS)
 
Applications
ApplicationsApplications
Applications
 
Petri Niemi Qt Advanced Part 2
Petri Niemi Qt Advanced Part 2Petri Niemi Qt Advanced Part 2
Petri Niemi Qt Advanced Part 2
 
AWS IoTで家庭内IoTをやってみた【JAWS DAYS 2016】
AWS IoTで家庭内IoTをやってみた【JAWS DAYS 2016】AWS IoTで家庭内IoTをやってみた【JAWS DAYS 2016】
AWS IoTで家庭内IoTをやってみた【JAWS DAYS 2016】
 
Intro to HTML5
Intro to HTML5Intro to HTML5
Intro to HTML5
 

Más de Platonov Sergey

Евгений Зуев, С++ в России: Стандарт языка и его реализация
Евгений Зуев, С++ в России: Стандарт языка и его реализацияЕвгений Зуев, С++ в России: Стандарт языка и его реализация
Евгений Зуев, С++ в России: Стандарт языка и его реализацияPlatonov Sergey
 
Использование maven для сборки больших модульных c++ проектов на примере Odin...
Использование maven для сборки больших модульных c++ проектов на примере Odin...Использование maven для сборки больших модульных c++ проектов на примере Odin...
Использование maven для сборки больших модульных c++ проектов на примере Odin...Platonov Sergey
 
Дракон в мешке: от LLVM к C++ и проблемам неопределенного поведения
Дракон в мешке: от LLVM к C++ и проблемам неопределенного поведенияДракон в мешке: от LLVM к C++ и проблемам неопределенного поведения
Дракон в мешке: от LLVM к C++ и проблемам неопределенного поведенияPlatonov Sergey
 
One definition rule - что это такое, и как с этим жить
One definition rule - что это такое, и как с этим житьOne definition rule - что это такое, и как с этим жить
One definition rule - что это такое, и как с этим житьPlatonov Sergey
 
DI в C++ тонкости и нюансы
DI в C++ тонкости и нюансыDI в C++ тонкости и нюансы
DI в C++ тонкости и нюансыPlatonov Sergey
 
Аскетичная разработка браузера
Аскетичная разработка браузераАскетичная разработка браузера
Аскетичная разработка браузераPlatonov Sergey
 
Денис Кормалев Метаобъектная система Qt
Денис Кормалев Метаобъектная система QtДенис Кормалев Метаобъектная система Qt
Денис Кормалев Метаобъектная система QtPlatonov Sergey
 
Максим Хижинский Lock-free maps
Максим Хижинский Lock-free mapsМаксим Хижинский Lock-free maps
Максим Хижинский Lock-free mapsPlatonov Sergey
 
Владислав Шаклеин. Смешивание управляемого и неуправляемого C++ кода в Micros...
Владислав Шаклеин. Смешивание управляемого и неуправляемого C++ кода в Micros...Владислав Шаклеин. Смешивание управляемого и неуправляемого C++ кода в Micros...
Владислав Шаклеин. Смешивание управляемого и неуправляемого C++ кода в Micros...Platonov Sergey
 
High quality library from scratch
High quality library from scratchHigh quality library from scratch
High quality library from scratchPlatonov Sergey
 
С++ without new and delete
С++ without new and deleteС++ without new and delete
С++ without new and deletePlatonov Sergey
 
Categories for the Working C++ Programmer
Categories for the Working C++ ProgrammerCategories for the Working C++ Programmer
Categories for the Working C++ ProgrammerPlatonov Sergey
 
Библиотека Boost с нуля на примере Boost.DLL
Библиотека Boost с нуля на примере Boost.DLLБиблиотека Boost с нуля на примере Boost.DLL
Библиотека Boost с нуля на примере Boost.DLLPlatonov Sergey
 
Оптимизация трассирования с использованием Expression templates
Оптимизация трассирования с использованием Expression templatesОптимизация трассирования с использованием Expression templates
Оптимизация трассирования с использованием Expression templatesPlatonov Sergey
 
Практика Lock-free. RealTime-сервер
Практика Lock-free. RealTime-серверПрактика Lock-free. RealTime-сервер
Практика Lock-free. RealTime-серверPlatonov Sergey
 
С++ without new and delete
С++ without new and deleteС++ without new and delete
С++ without new and deletePlatonov Sergey
 

Más de Platonov Sergey (17)

Евгений Зуев, С++ в России: Стандарт языка и его реализация
Евгений Зуев, С++ в России: Стандарт языка и его реализацияЕвгений Зуев, С++ в России: Стандарт языка и его реализация
Евгений Зуев, С++ в России: Стандарт языка и его реализация
 
Использование maven для сборки больших модульных c++ проектов на примере Odin...
Использование maven для сборки больших модульных c++ проектов на примере Odin...Использование maven для сборки больших модульных c++ проектов на примере Odin...
Использование maven для сборки больших модульных c++ проектов на примере Odin...
 
Дракон в мешке: от LLVM к C++ и проблемам неопределенного поведения
Дракон в мешке: от LLVM к C++ и проблемам неопределенного поведенияДракон в мешке: от LLVM к C++ и проблемам неопределенного поведения
Дракон в мешке: от LLVM к C++ и проблемам неопределенного поведения
 
One definition rule - что это такое, и как с этим жить
One definition rule - что это такое, и как с этим житьOne definition rule - что это такое, и как с этим жить
One definition rule - что это такое, и как с этим жить
 
DI в C++ тонкости и нюансы
DI в C++ тонкости и нюансыDI в C++ тонкости и нюансы
DI в C++ тонкости и нюансы
 
Аскетичная разработка браузера
Аскетичная разработка браузераАскетичная разработка браузера
Аскетичная разработка браузера
 
Concepts lite
Concepts liteConcepts lite
Concepts lite
 
Денис Кормалев Метаобъектная система Qt
Денис Кормалев Метаобъектная система QtДенис Кормалев Метаобъектная система Qt
Денис Кормалев Метаобъектная система Qt
 
Максим Хижинский Lock-free maps
Максим Хижинский Lock-free mapsМаксим Хижинский Lock-free maps
Максим Хижинский Lock-free maps
 
Владислав Шаклеин. Смешивание управляемого и неуправляемого C++ кода в Micros...
Владислав Шаклеин. Смешивание управляемого и неуправляемого C++ кода в Micros...Владислав Шаклеин. Смешивание управляемого и неуправляемого C++ кода в Micros...
Владислав Шаклеин. Смешивание управляемого и неуправляемого C++ кода в Micros...
 
High quality library from scratch
High quality library from scratchHigh quality library from scratch
High quality library from scratch
 
С++ without new and delete
С++ without new and deleteС++ without new and delete
С++ without new and delete
 
Categories for the Working C++ Programmer
Categories for the Working C++ ProgrammerCategories for the Working C++ Programmer
Categories for the Working C++ Programmer
 
Библиотека Boost с нуля на примере Boost.DLL
Библиотека Boost с нуля на примере Boost.DLLБиблиотека Boost с нуля на примере Boost.DLL
Библиотека Boost с нуля на примере Boost.DLL
 
Оптимизация трассирования с использованием Expression templates
Оптимизация трассирования с использованием Expression templatesОптимизация трассирования с использованием Expression templates
Оптимизация трассирования с использованием Expression templates
 
Практика Lock-free. RealTime-сервер
Практика Lock-free. RealTime-серверПрактика Lock-free. RealTime-сервер
Практика Lock-free. RealTime-сервер
 
С++ without new and delete
С++ without new and deleteС++ without new and delete
С++ without new and delete
 

Último

What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 

Último (20)

What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 

QML\Qt Quick на практике

  • 3.
  • 5. horizontalLayoutWidget->setGeometry(QRect(10, 0, 501, 51)); horizontalLayout = new QHBoxLayout(horizontalLayoutWidget); horizontalLayout->setSpacing(6); horizontalLayout->setContentsMargins(11, 11, 11, 11); horizontalLayout->setContentsMargins(0, 0, 0, 0); pushButton_2 = new QPushButton(horizontalLayoutWidget); horizontalLayout->addWidget(pushButton_2); pushButton_4 = new QPushButton(horizontalLayoutWidget); horizontalLayout->addWidget(pushButton_4); pushButton_3 = new QPushButton(horizontalLayoutWidget); horizontalLayout->addWidget(pushButton_3); pushButton = new QPushButton(horizontalLayoutWidget); horizontalLayout->addWidget(pushButton); horizontalSlider = new QSlider(centralWidget); horizontalSlider->setGeometry(QRect(10, 60, 501, 16)); horizontalSlider->setOrientation(Qt::Horizontal); textEdit = new QTextEdit(centralWidget); textEdit->setGeometry(QRect(20, 90, 481, 201)); MainWindow->setCentralWidget(centralWidget);
  • 6. RowLayout { anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top anchors.topMargin: 18 Button { text: qsTr("Button 1") } Button { text: qsTr("Button 2") } Button { text: qsTr("Button 3") } Button { text: qsTr("Button 4") } } Slider { x: 143; y: 57 width: 355; height: 28 } TextArea { x: 142; y: 105 width: 355; height: 150 }
  • 8. QML это JSON-подобный декларативный язык программирования, основанный на JavaScript, использующий С++ API для интеграции с Qt Qt Quick это scenegraph-based UI framework, использующий в качестве языка программирования QML и позиционирующий себя как инструмент для быстрой разработки и прототипирования
  • 9. Где уместно использовать Qt Quick? Там где вы уже используете Qt Там где требуется не стандартный (вычурный) UI Там где необходим кросплатформенный “look and feel” Там где есть постоянно меняющиеся требования к дизайну и бизнес- логике
  • 13. Hello World import QtQuick 2.0 Rectangle { id: root width: 120; height: 240 color: "#D8D8D8" Image { id: world x: (parent.width - width)/2 y: 40 source: 'assets/world.png' } Text { y: world.y + world.height + 20 width: root.width horizontalAlignment: Text.AlignHCenter text: 'Hello World' } }
  • 14. import QtQuick 2.2 Rectangle { id: photo objectName: "photo" property bool thumbnail: false property alias image: photoImage.source signal clicked(); color: "gray" x: 20; y: 20 height: 150 width: { if(photoImage.width > 200) { photoImage.width; } else { 200; } } function doSomething(dx) { return dx + photoImage.width; } onHeightChanged: { var tmp = doSomething(photo.height); console.log( tmp ); } QtObject { id: p_attr readonly property color borderSelectedColor: "red" readonly property color borderUnSelectedColor: "black" property int animationDuration: 200 } Rectangle { id: border anchors.centerIn: parent Image { id: photoImage; anchors.centerIn: parent } } MouseArea { anchors.fill: parent onClicked: photo.clicked(); } states:[ State { name: "Selected" PropertyChanges { target: border; color: p_attr.borderSelectedColor } }, State { name: "UnSelected" PropertyChanges { target: border; color: p_attr.borderUnSelectedColor } } ] transitions: Transition { to: "Selected" ColorAnimation { target: border; duration: p_attr.animationDuration } } }
  • 15. import QtQuick 2.2 Rectangle { id: photo objectName: "photo" property bool thumbnail: false property alias image: photoImage.source signal clicked(); color: "gray" x: 20; y: 20 height: 150 width: { if(photoImage.width > 200) { photoImage.width; } else { 200; } } function doSomething(dx) { return dx + photoImage.width; } onHeightChanged: { var tmp = doSomething(photo.height); console.log( tmp ); } QtObject { id: p_attr readonly property color borderSelectedColor: "red" readonly property color borderUnSelectedColor: "black" property int animationDuration: 200 } Rectangle { id: border anchors.centerIn: parent Image { id: photoImage; anchors.centerIn: parent } } MouseArea { anchors.fill: parent onClicked: photo.clicked(); } states:[ State { name: "Selected" PropertyChanges { target: border; color: p_attr.borderSelectedColor } }, State { name: "UnSelected" PropertyChanges { target: border; color: p_attr.borderUnSelectedColor } } ] transitions: Transition { to: "Selected" ColorAnimation { target: border; duration: p_attr.animationDuration } } }
  • 16. import QtQuick 2.2 Rectangle { id: photo objectName: "photo" property bool thumbnail: false property alias image: photoImage.source signal clicked(); color: "gray" x: 20; y: 20 height: 150 width: { if(photoImage.width > 200) { photoImage.width; } else { 200; } } function doSomething(dx) { return dx + photoImage.width; } onHeightChanged: { var tmp = doSomething(photo.height); console.log( tmp ); } QtObject { id: p_attr readonly property color borderSelectedColor: "red" readonly property color borderUnSelectedColor: "black" property int animationDuration: 200 } Rectangle { id: border anchors.centerIn: parent Image { id: photoImage; anchors.centerIn: parent } } MouseArea { anchors.fill: parent onClicked: photo.clicked(); } states:[ State { name: "Selected" PropertyChanges { target: border; color: p_attr.borderSelectedColor } }, State { name: "UnSelected" PropertyChanges { target: border; color: p_attr.borderUnSelectedColor } } ] transitions: Transition { to: "Selected" ColorAnimation { target: border; duration: p_attr.animationDuration } } }
  • 17. import QtQuick 2.2 Rectangle { id: photo objectName: "photo" property bool thumbnail: false property alias image: photoImage.source signal clicked(); color: "gray" x: 20; y: 20 height: 150 width: { if(photoImage.width > 200) { photoImage.width; } else { 200; } } function doSomething(dx) { return dx + photoImage.width; } onHeightChanged: { var tmp = doSomething(photo.height); console.log( tmp ); } QtObject { id: p_attr readonly property color borderSelectedColor: "red" readonly property color borderUnSelectedColor: "black" property int animationDuration: 200 } Rectangle { id: border anchors.centerIn: parent Image { id: photoImage; anchors.centerIn: parent } } MouseArea { anchors.fill: parent onClicked: photo.clicked(); } states:[ State { name: "Selected" PropertyChanges { target: border; color: p_attr.borderSelectedColor } }, State { name: "UnSelected" PropertyChanges { target: border; color: p_attr.borderUnSelectedColor } } ] transitions: Transition { to: "Selected" ColorAnimation { target: border; duration: p_attr.animationDuration } } }
  • 18. import QtQuick 2.2 Rectangle { id: photo objectName: "photo" property bool thumbnail: false property alias image: photoImage.source signal clicked(); color: "gray" x: 20; y: 20 height: 150 width: { if(photoImage.width > 200) { photoImage.width; } else { 200; } } function doSomething(dx) { return dx + photoImage.width; } onHeightChanged: { var tmp = doSomething(photo.height); console.log( tmp ); } QtObject { id: p_attr readonly property color borderSelectedColor: "red" readonly property color borderUnSelectedColor: "black" property int animationDuration: 200 } Rectangle { id: border anchors.centerIn: parent Image { id: photoImage; anchors.centerIn: parent } } MouseArea { anchors.fill: parent onClicked: photo.clicked(); } states:[ State { name: "Selected" PropertyChanges { target: border; color: p_attr.borderSelectedColor } }, State { name: "UnSelected" PropertyChanges { target: border; color: p_attr.borderUnSelectedColor } } ] transitions: Transition { to: "Selected" ColorAnimation { target: border; duration: p_attr.animationDuration } } }
  • 19. import QtQuick 2.2 Rectangle { id: photo objectName: "photo" property bool thumbnail: false property alias image: photoImage.source signal clicked(); color: "gray" x: 20; y: 20 height: 150 width: { if(photoImage.width > 200) { photoImage.width; } else { 200; } } function doSomething(dx) { return dx + photoImage.width; } onHeightChanged: { var tmp = doSomething(photo.height); console.log( tmp ); } QtObject { id: p_attr readonly property color borderSelectedColor: "red" readonly property color borderUnSelectedColor: "black" property int animationDuration: 200 } Rectangle { id: border anchors.centerIn: parent Image { id: photoImage; anchors.centerIn: parent } } MouseArea { anchors.fill: parent onClicked: photo.clicked(); } states:[ State { name: "Selected" PropertyChanges { target: border; color: p_attr.borderSelectedColor } }, State { name: "UnSelected" PropertyChanges { target: border; color: p_attr.borderUnSelectedColor } } ] transitions: Transition { to: "Selected" ColorAnimation { target: border; duration: p_attr.animationDuration } } }
  • 20. import QtQuick 2.2 Rectangle { id: photo objectName: "photo" property bool thumbnail: false property alias image: photoImage.source signal clicked(); color: "gray" x: 20; y: 20 height: 150 width: { if(photoImage.width > 200) { photoImage.width; } else { 200; } } function doSomething(dx) { return dx + photoImage.width; } onHeightChanged: { var tmp = doSomething(photo.height); console.log( tmp ); } QtObject { id: p_attr readonly property color borderSelectedColor: "red" readonly property color borderUnSelectedColor: "black" property int animationDuration: 200 } Rectangle { id: border anchors.centerIn: parent Image { id: photoImage; anchors.centerIn: parent } } MouseArea { anchors.fill: parent onClicked: photo.clicked(); } states:[ State { name: "Selected" PropertyChanges { target: border; color: p_attr.borderSelectedColor } }, State { name: "UnSelected" PropertyChanges { target: border; color: p_attr.borderUnSelectedColor } } ] transitions: Transition { to: "Selected" ColorAnimation { target: border; duration: p_attr.animationDuration } } }
  • 21. import QtQuick 2.2 Rectangle { id: photo objectName: "photo" property bool thumbnail: false property alias image: photoImage.source signal clicked(); color: "gray" x: 20; y: 20 height: 150 width: { if(photoImage.width > 200) { photoImage.width; } else { 200; } } function doSomething(dx) { return dx + photoImage.width; } onHeightChanged: { var tmp = doSomething(photo.height); console.log( tmp ); } QtObject { id: p_attr readonly property color borderSelectedColor: "red" readonly property color borderUnSelectedColor: "black" property int animationDuration: 200 } Rectangle { id: border anchors.centerIn: parent Image { id: photoImage; anchors.centerIn: parent } } MouseArea { anchors.fill: parent onClicked: photo.clicked(); } states:[ State { name: "Selected" PropertyChanges { target: border; color: p_attr.borderSelectedColor } }, State { name: "UnSelected" PropertyChanges { target: border; color: p_attr.borderUnSelectedColor } } ] transitions: Transition { to: "Selected" ColorAnimation { target: border; duration: p_attr.animationDuration } } }
  • 22. import QtQuick 2.2 Rectangle { id: photo objectName: "photo" property bool thumbnail: false property alias image: photoImage.source signal clicked(); color: "gray" x: 20; y: 20 height: 150 width: { if(photoImage.width > 200) { photoImage.width; } else { 200; } } function doSomething(dx) { return dx + photoImage.width; } onHeightChanged: { var tmp = doSomething(photo.height); console.log( tmp ); } QtObject { id: p_attr readonly property color borderSelectedColor: "red" readonly property color borderUnSelectedColor: "black" property int animationDuration: 200 } Rectangle { id: border anchors.centerIn: parent Image { id: photoImage; anchors.centerIn: parent } } MouseArea { anchors.fill: parent onClicked: photo.clicked(); } states:[ State { name: "Selected" PropertyChanges { target: border; color: p_attr.borderSelectedColor } }, State { name: "UnSelected" PropertyChanges { target: border; color: p_attr.borderUnSelectedColor } } ] transitions: Transition { to: "Selected" ColorAnimation { target: border; duration: p_attr.animationDuration } } }
  • 23. // Circle.qml import QtQuick 2.0 Rectangle { property real diameter : 30 width: diameter height: diameter radius: diameter } import QtQuick 2.0 Rectangle { width: 120; height: 240 Column { anchors.fill: parent Repeater { model: 3 Circle { color: "blue" diameter: 90 } } } }
  • 25. Якоря бывают двух видов: -ссылающиеся на элемент (centerIn, fill) -ссылающиеся на другой якорь ( left, right, top, bottom, …. )
  • 26. import QtQuick 2.0 Rectangle { id: root width: 120; height: 240 color: "#D8D8D8" Image { id: world anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top anchors.topMargin: 40 source: 'assets/world.png' } Text { anchors.top: world.bottom anchors.topMargin: 20 anchors.horizontalCenter: world.horizontalCenter text: 'Hello World' } } Hello World
  • 28. С++ API позволяет: – экспортировать в QML C++ обьекты наследованные от QObject – экспортировать в QML не визуальные типы – классы на основе QQuickPaintedItem для визуальных элементов с поддержкой QPainter – классы на основе QQuickItem для визуальных элементов сцены
  • 30. class User : public QObject { Q_OBJECT Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) Q_PROPERTY(int age READ age WRITE setAge NOTIFY ageChanged) public: User(const QString &name, int age, QObject *parent = 0); ... }
  • 31. void main( int argc, char* argv[] ) { ... User *currentUser = new User("Alice", 29); QQuickView *view = new QQuickView; QQmlContext *context = view->engine()->rootContext(); context->setContextProperty("currentUser", currentUser); ... }
  • 32. void main( int argc, char* argv[] ) { ... User *currentUser = new User("Alice", 29); QQuickView *view = new QQuickView; QQmlContext *context = view->engine()->rootContext(); context->setContextProperty("currentUser", currentUser); ... } Text { text : currentUser.name }
  • 34. #include <QObject> class CustomTimer : public QObject { Q_OBJECT Q_PROPERTY( int interval READ interval WRITE setInterval NOTIFY intervalChanged ) public: CustomTimer(QObject *parent = 0); int interval() const; public slots: void start(); void stop(); void setInterval(int arg); signals: void intervalChanged(int arg); void timeout(); private: QTimer* m_timer; int m_interval; };
  • 35. #include <QGuiApplication> #include <QQuickView> #include "CustomTimer.h" int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); qmlRegisterType<CustomTimer>("CustomComponents", 1, 0, "CustomTimer"); QQuickView view; view.setSource(QUrl("qrc:///main.qml")); view.show(); return app.exec(); }
  • 36. import CustomComponents 1.0 Rectangle { id: root Component.onCompleted: { timer.start(); } …….. CustomTimer { id: timer interval: 3000 onTimeout: { console.log( "Timer timeout!" ); root.color = "red"; } } }
  • 38. #include <QQuickPaintedItem> class EllipseItem : public QQuickPaintedItem { Q_OBJECT public: EllipseItem(QQuickItem *parent = 0); void paint(QPainter *painter); }; void EllipseItem::paint(QPainter *painter) { const qreal halfPenWidth = qMax(painter->pen().width() / 2.0, 1.0); QRectF rect = boundingRect(); rect.adjust(halfPenWidth, halfPenWidth, -halfPenWidth, -halfPenWidth); painter->drawEllipse(rect); }
  • 39. #include <QGuiApplication> #include <QQuickView> #include "EllipseItem.h" int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); qmlRegisterType<EllipseItem>("CustomComponents", 1, 0, "Ellipse"); QQuickView view; view.setSource(QUrl("qrc:///main.qml")); view.show(); return app.exec(); }
  • 40. import CustomComponents 1.0 Rectangle { id: root EllipseItem { anchors.centerIn: parent width: 64 height: 48 } }
  • 42. #include <QQuickItem> #include <QSGGeometry> #include <QSGFlatColorMaterial> class TriangleItem : public QQuickItem { Q_OBJECT public: TriangleItem(QQuickItem *parent = 0); protected: QSGNode *updatePaintNode(QSGNode *node, UpdatePaintNodeData *data); private: QSGGeometry m_geometry; QSGFlatColorMaterial m_material; };
  • 43. QSGNode *TriangleItem::updatePaintNode(QSGNode *n, UpdatePaintNodeData *) { QSGGeometryNode *node = static_cast<QSGGeometryNode *>(n); if (!node) node = new QSGGeometryNode(); QSGGeometry::Point2D *v = m_geometry.vertexDataAsPoint2D(); const QRectF rect = boundingRect(); v[0].x = rect.left(); v[0].y = rect.bottom(); v[1].x = rect.left() + rect.width()/2; v[1].y = rect.top(); v[2].x = rect.right(); v[2].y = rect.bottom(); node->setGeometry(&m_geometry); node->setMaterial(&m_material); return node; }
  • 44. QSGNode * QQuickCustomItem::updatePaintNode(QSGNode * node, UpdatePaintNodeData * nodedata) { TexureHolderNode * texture_node = static_cast<TexureHolderNode *>(node); if (!texture_node) texture_node = new TexureHolderNode(); if (texture_node->fbo_ && (texture_node->fbo_->width() != width() || texture_node->fbo_->height() != height())) { texture_node->fbo_.reset(); } if (texture_node->fbo_.isNull()) { QSize fboSize(qMax<int>(1, int(width())), qMax<int>(1, int(height()))); QOpenGLFramebufferObjectFormat format; texture_node->fbo_.reset(new QOpenGLFramebufferObject(fboSize, format)); texture_node->setTexture( window()->createTextureFromId( texture_node->fbo_->texture(), texture_node->fbo_->size(), 0) ); texture_node->setRect(0, 0, width(), height()); redraw_texture_needed_ = true; } if (redraw_texture_needed_) { redraw_texture_needed_ = false; texture_node->fbo_->bind(); { paintGL(); } texture_node->fbo_->bindDefault(); texture_node->markDirty(QSGNode::DirtyMaterial); } return texture_node; } class TexureHolderNode : public QSGSimpleTextureNode { public: TexureHolderNode() {} QScopedPointer<QOpenGLFramebufferObject> fbo_; };
  • 45.
  • 47. Что нужно оставлять в плюсах, что лучше перенести в QML?
  • 49. Autopilot-Qt5QtCreator GammaRay Squish – qt.io/ru/download-open-source – kdab.com/gammaray – froglogic.com/squish – wiki.ubuntu.com/Touch/Testing/Autopilot