-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
871 lines (789 loc) · 32.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>5 reasons Why You Should Use The Latest Qt for Python</title>
<link rel="stylesheet" href="dist/reset.css">
<link rel="stylesheet" href="dist/reveal.css">
<link rel="stylesheet" href="css/qt-theme.css" id="theme">
<link rel="stylesheet" href="css/qt.css" id="theme">
<link rel="stylesheet" href="css/extras.css">
<!-- Theme used for syntax highlighted code -->
<link rel="stylesheet" href="plugin/highlight/monokai.css">
<!-- Printing and PDF exports -->
<script>
if( window.location.search.match( /print-pdf/gi ) ) {
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'css/print/pdf.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
}
</script>
</head>
<body>
<div class="reveal">
<div class="slides">
<!--***************************************************************************-->
<section data-background-image="img/background_general.jpg" data-background-opacity=1>
</section>
<section data-background-image="img/background_half.jpg" data-background-opacity=1>
<div id="left">
<h3><i class="qt-yellow">5 reasons</i> <span style="font-weight: normal;">Why You Should Use The <i class="qt-purple">Latest</i> Qt for Python</span></h3>
<hr style="width: 70px; border: 1px solid #ff00ff; background-color: #ff00ff; margin-left: 0px;"/>
<p style="font-size: 80%;">
<i class="green">Shyamnath</i> Premnadh <br>
<img class="clean-img" src="img/github_white.png">
<img class="clean-img" src="img/linkedin.png">
</p>
</div>
</section>
<!--***************************************************************************-->
<section>
<h2><i class="green">Hi</i><i class="yellow">,</i> there 👋</h2>
<div class="boxed" id="left70">
<p style="text-align: left;">
<br>
<font style="font-size: 80%;">Shyamnath Premnadh <i class="yellow">aka</i> <i class="qt-green">Shyam</i></font> <br>
<font style="font-size: 60%;"><i class="blue">Qt for Python</i></font> <br>
<font style="font-size: 60%;">Senior Software Engineer <i class="qt-green">@ TQtC</i></font>
</p>
</div>
<div id="right30">
<p style="width: 80%; text-align: left;">
<img src="img/shyam.JPG" />
</p>
</div>
</section>
<section>
<h3>Slides</h3>
<p style="font-size: 65%;">
<a href="https://shyamnathp.github.io/Qt-World-Summit-2022/">https://shyamnathp.github.io/Qt-World-Summit-2022/</a>
</p>
</section>
<section>
<h3>What is <i class="qt-green">Qt</i> for <i class="qt-yellow">Python</i>?</h3>
</section>
<section data-auto-animate>
<p>The <i class="qt-purple">official</i> set of <i class="qt-yellow">Python bindings</i> for the Qt framework.</p>
</section>
<section data-auto-animate>
<p>The <i class="qt-purple">official</i> set of <i class="qt-yellow">Python bindings</i> for the Qt framework.</p>
<p><i class="qt-green">...but not only that</i> 🤔.</p>
</section>
<section data-auto-animate>
<p>The <i class="qt-purple">official</i> set of <i class="qt-yellow">Python bindings</i> for the Qt framework.</p>
<p><i class="qt-green">...but not only that</i> 🤔.</p>
<p>Qt for Python is an entire <i class="qt-green">application suite</i></p>
</section>
<section>
<img style="width: 85%;" src="img/qt_for_python.jpg" />
</section>
<!-- <section>
<h3>So, Why should you use <i class="qt-green">Qt</i> for <i class="qt-yellow">Python</i>?</h3>
<div class="fragment">
<img style="width: 100%;" src="img/tiobe_index.png" />
<p style="font-size: 65%;">
<a href="https://www.tiobe.com/tiobe-index/">https://www.tiobe.com/tiobe-index/</a>
</p>
</div>
</section> -->
<section>
<h3>Why should you use <i class="qt-green">Qt</i> for <i class="qt-yellow">Python</i>?</h3>
<p style="font-size: 80%"><i class="qt-yellow">(as a Python developer)</i></p>
</section>
<section>
<h3>Power of <i class="qt-green">Qt</i> in <i class="qt-yellow">Python</i> 💪</h3>
<div id="left" class="fragment fade-in" data-fragment-index="1">
<h3>6.3</h3>
<div style="font-size: 60%;">
<ul>
<li><i class="qt-green">Classes:</i></li>
<ul>
<li>QPyQmlPropertyValueSource</li>
<li>QtCBorTag</li>
</ul>
<li><i class="qt-yellow">Modules:</i></li>
<ul>
<li>QtNfc</li>
<li>QtQuick3d</li>
</ul>
<li><i class="qt-purple">Tools:</i></li>
<ul>
<li>pyside6-metaobjectdump</li>
<li>pyside6-qmltyperegistrar</li>
<li>pyside6-qmllint</li>
</ul>
<li>...</li>
</ul>
</div>
</div>
<div id="rightl" class="fragment fade-in" data-fragment-index="2">
<h3>6.4</h3>
<div style="font-size: 60%;">
<ul>
<li><i class="qt-green">Classes:</i></li>
<ul>
<li>QLoggingCategory</li>
</ul>
<li><i class="qt-yellow">Modules:</i></li>
<ul>
<li>QtPdf</li>
<li>QtPdfWidgets</li>
<li>QtHttpServer</li>
<li>QtSpatialAudio</li>
</ul>
<li><i class="qt-purple">Tools:</i></li>
<ul>
<li>pyside6-qml</li>
<li>pyside6-deploy</li>
<li>pyside6-qtpy2cpp</li>
</ul>
<li>...</li>
</ul>
</div>
</div>
</section>
<section>
<h3><i class="qt-purple">Bridge to other</i> <i class="qt-yellow">Python</i> modules</h3>
<div id="left">
<video style="width: 100%"controls muted data-autoplay src="videos/pyside_scikitimage.mp4"></video>
</div>
<div id="right" style="text-align:left !important; margin-top: 70px !important;">
<p style="font-size: 60%;"><i class="green">pyside-setup/examples/sckikit/</i> - PySide6, matplotlib, numpy, scikit-image</p>
</div>
<div style="font-size: 60%; text-align: left;">
<ul>
<li><i class="green">pyside-setup/examples/</i></li>
<ul>
<li><i class="qt-purple">external/</i></li>
<ul>
<li>matplotlib/widget3d/ - PySide6, matplotlib, numpy</li>
<li>pandas/ - PySide6, pandas</li>
<li>datavisualization/</li>
<ul>
<li>surface_numpy/ - PySide6, numpy</li>
<li>surface_model_numpy/ - PySide6, numpy</li>
</ul>
</ul>
<li><i class="qt-yellow">async/</i> - PySide6, trio</li>
</ul>
</ul>
</div>
</section>
<section>
<h3>Pythonicity 🐍(1/2)</h3>
<div class="container">
<div class="fragment" style="float: left; width: 30%;">
<pre style="font-size: 40%;width: 100%;"><code class="python" data-trim data-noescape>
# Common Qt structure
# - Using setter/getter
# - No writable properties
table = QTableWidget()
table.setColumnCount(2)
button = QPushButton("Add")
button.setEnabled(False)
layout = QVBoxLayout()
layout.addWidget(table)
layout.addWidget(button)
layout.setSpacing(2)
</code></pre>
</div>
<div class="fragment" style="display: inline-block;width:30%;">
<pre style="font-size: 40%;width: 100%;"><code class="python" data-trim data-noescape>
from __feature__ import (
snake_case
)
table = QTableWidget()
table.set_column_count(2)
button = QPushButton("Add")
button.set_enabled(False)
layout = QVBoxLayout()
layout.add_widget(table)
layout.add_widget(button)
layout.set_spacing(2)
</code></pre>
</div>
<div class="fragment" style="float: right; width: 30%;">
<pre style="font-size: 40%;width: 100%;"><code class="python" data-trim data-noescape>
from __feature__ import (
snake_case, true_property
)
table = QTableWidget()
table.column_count = 2
button = QPushButton("Add")
button.enabled = False
layout = QVBoxLayout()
layout.add_widget(table)
layout.add_widget(button)
layout.spacing = 2
</code></pre>
</div>
</div>
</section>
<section>
<h3>Pythonicity 🐍(2/2)</h3>
<div style="font-size: 70%;">
<p>Pythonic Enums and Flags - <i class="qt-green">Default in 6.4</i></p>
<ul>
<li>Compatible with the old Shiboken Enums</li>
<li>No changes in code - Forgiveness Mode</li>
</ul>
</div>
<!-- <div class="fragment" style="float: left; width: 47%;">
<pre style="font-size: 40%;width: 100%;">
<code class="c++" data-trim data-noescape>
flags = Qt.Alignment()
enum = Qt.AlignLeft
item.setForeground(QColor(Qt.green))
flags_type = QPainter.RenderHints
flags = QPainter.RenderHints()
chart_view.setRenderHint(QPainter.Antialiasing)
</code></pre>
</div>
<div class="fragment" style="float: right; width: 47%;">
<pre style="font-size: 40%;width: 100%;">
<code class="c++" data-trim data-noescape>
flags = Qt.AlignmentFlag(0)
enum = Qt.AlignmentFlag.AlignLeft
item.setForeground(QColor(Qt.GlobalColor.green))
flags_type = QPainter.RenderHint
flags = QPainter.RenderHint(0)
chart_view.setRenderHint(QPainter.RenderHint.Antialiasing)
</code></pre>
</div> -->
</section>
<section>
<h3>Opaque Containers 🚀</h3>
<ul style="font-size: 70%;">
<li>Passing Python containers to C++ is inefficient</li>
<li><code class="qt-green">opaque-container</code> to the rescue</li>
<ul>
<li>Wrapper around underlying C++ container</li>
</ul>
<li>Opaque containers available to you</li>
<ul>
<li>QIntList, QPointList, QPointFList, QVector2DList, QVector3DList, QVector4DList</li>
</ul>
</ul>
<table class="fragment" style="font-size: 70%;">
<thead><tr>
<th></th>
<th><i class="qt-purple">Appending</i></th>
<th><i class="qt-yellow">Popping(first element)</i></th>
</tr></thead>
<tbody>
<tr>
<td>QPointList</td>
<td>0.55s</td>
<td>0.07s</td>
</tr>
<tr>
<td>Python list</td>
<td>0.79s</td>
<td>0.69s</td>
</tr>
<tr>
<td>Python deque</td>
<td>0.84s</td>
<td>0.29s</td>
</tr>
</tbody>
</table>
<p class="fragment" style="font-size: 60%; text-align: left;">Read more: <a href="https://doc.qt.io/qtforpython/shiboken6/typesystem_containers.html">https://doc.qt.io/qtforpython/shiboken6/typesystem_containers.html</a></p>
</section>
<section>
<h3>Why should I use <i class="qt-green">Qt</i> for <i class="qt-yellow">Python</i>?</h3>
<p style="font-size: 80%"><i class="blue">(as a C++ developer)</i></p>
</section>
<section>
<h3>Development Speed 👑</h3>
<ul style="font-size: 70%;">
<li>What is building?</li>
<li>'pip' is your friend</li>
<li>Include what you want with 'import'</li>
<li>Write verbose and simple code</li>
</ul>
<div class="fragment" id="center">
<pre style="font-size: 50%; width: 100%; text-align: left;" ><code class="python" data-trim data-noescape>
# Qt for Python
button = QPushButton()
button.clicked.connect(lambda: print("Button clicked"))
</code></pre>
<pre style="font-size: 50%; width: 100%; text-align: left;"><code class="c++" data-trim data-noescape>
// Qt
auto button = QPushButton();
connect(button, &QPushButton::clicked, [](){std::cout<<"button clicked";});
</code></pre>
</div>
</section>
<section>
<h3> Find <i class="qt-purple">performance</i> from other sources 🏎️</h3>
<ul>
<li class="fragment" style="font-size: 70%;">C++ -> native exe -> faster . <i class="qt-yellow">But...</i></li>
<li class="fragment" style="font-size: 70%;">Don't overlook computing power of present systems</li>
</ul>
<div class="fragment">
<div style="float: left; width: 40%;">
<img style="width: 100%;" src="img/c++_tetrix.gif" />
</div>
<div style="float: right; width: 40%;">
<img style="width: 100%;" src="img/python_tetrix.gif" />
</div>
</div>
</section>
<section>
<h3>Testing 👨🔬</h3>
<ul style="font-size: 70%;">
<li>Easier</li>
<ul>
<li>Python uses duck-typing</li>
<li>Less complex code -> easy to test</li>
<li>Achieve Test Driven Development(TDD)</li>
</ul>
<li>Mocking is easier in Python</li>
<ul>
<li>Not restricted to public and virtual functions</li>
</ul>
</ul>
<p style="font-size: 70%;"><i class="qt-green">Popular Python Packages</i>: unittest, pytest</p>
<!-- <pre style="font-size: 40%;width: 100%;"><code class="python" data-trim data-noescape>
@pytest.fixture
def value():
return 6
def test_divisible_by_3(value):
assert value % 3 == 0
</code></pre> -->
</section>
<section>
<h3>Why should you use <i class="qt-green">Qt</i> for <i class="qt-yellow">Python</i>?</h3>
<p style="font-size: 80%"><i class="blue">(as any developer)</i></p>
</section>
<section>
<h3>Documentation and Examples</h3>
<iframe width="1000" height="500" data-src="https://doc.qt.io/qtforpython/"></iframe>
</section>
<section>
<h3>Strong Community</h3>
<ul style="font-size: 80%;">
<li><i class="yellow">Telegram</i> <a href="https://t.me/qtforpython">https://t.me/qtforpython</a></li>
<li><i class="yellow">IRC/Matrix</i> #qt-pyside on Libera.chat</li>
<li><i class="yellow">Mailing list</i> <a href="http://lists.qt-project.org/mailman/listinfo/pyside">lists.qt-project.org/mailman/listinfo/pyside</a></li>
</ul>
<p style="font-size: 80%;">
More platforms at <a href="https://wiki.qt.io/Qt_for_Python#Community">wiki.qt.io/Qt_for_Python#Community</a>
</p>
</ul>
</section>
<section>
<h3><i class="qt-green">Feature 1</i></h3>
<h4>Python Wheels: Divide and Conquer</h4>
</section>
<section>
<h3>What are Python Wheels?</h3>
<img class="fragment" style="width: 50%;" src="img/python_wheels.png" />
<p class="fragment"><i class="qt-yellow">No</i>, not these wheels </p>
</section>
<section>
<h3>What are Python Wheels?</h3>
<div style="font-size: 60%;">
<ul>
<li>Essentialy .zip files</li>
<li>Build distributables of Python packages</li>
<li>Ready to install</li>
</ul>
</div>
<div style="float: left; width: 40%;">
<p style="font-size: 60%; text-align: left;">What happens when you do 'pip install PySide6'?<p>
<ul style="font-size: 50%;">
<li>Downloads PySide6 wheels from PyPi(if not, download source and build)</li>
<li>Extracts it into site-packages/ of your Python</li>
</ul>
</div>
<div style="float: right; width: 60%;">
<img style="width: 100%;" src="img/pyside_6.2.3_wheels.png" />
</div>
</section>
<section>
<h3><i class="qt-yellow">Divide</i> and <i class="qt-purple">Conquer</i></h3>
<div id="left" class="fragment fade-in" data-fragment-index="1">
<p>PySide6-Essentials</p>
<div style="font-size: 50%; float: left !important;">
<ul>
<li>Core</li>
<li>Gui</li>
<li>Widgets</li>
<li>Help</li>
<li>Network</li>
<li>Concurrent</li>
<li>DBus</li>
<li>Qml</li>
<li>Quick</li>
<li>Wayland</li>
<li>UiTools</li>
</ul>
</div>
<div style="font-size: 50%; margin-left: 150px;">
<ul>
<li>Designer</li>
<li>OpenGL</li>
<li>OpenGLWidgets</li>
<li>PrintSupport</li>
<li>QuickControls2</li>
<li>QuickWidgets</li>
<li>Xml</li>
<li>Test</li>
<li>Sql</li>
<li>SvgWidgets</li>
</ul>
</div>
</div>
<div id="rightl" class="fragment fade-in" data-fragment-index="2">
<p>PySide6-AddOns</p>
<div style="font-size: 50%;">
<ul>
<li>Everything Else</li>
</ul>
</div>
</div>
<p class="fragment" style="font-size: 60%; text-align: left; margin-top: 250px;"><code>pip install <i class="qt-green">pyside6</i></code></p>
<p class="fragment" style="font-size: 60%; margin-top: 200px;"><code><i class="qt-yellow">New</i> M2M Python Wheels for Commercial Users</i></code></p>
</section>
<section>
<h3><i class="qt-green">Feature 2</i></h3>
<h4>QML Improvements</h4>
</section>
<section>
<h3>New <i class="qt-green">QML</i> Decorators ✨(1/2)</h3>
<table style="font-size: 70%;">
<thead><tr>
<th>Qt Macro</th>
<th>Decorator</th>
</tr></thead>
<tbody><tr>
<td>QML_ANONYMOUS</td>
<td>@QmlAnonymous</td>
</tr>
<tr>
<td>QML_ATTACHED</td>
<td>@QmlAttached</td>
</tr>
<tr>
<td>QML_EXTENDED</td>
<td>@QmlExtended</td>
</tr>
<tr>
<td>QML_FOREIGN</td>
<td>@QmlForeign</td>
</tr>
<tr>
<td>QML_NAMED_ELEMENT</td>
<td>@QmlNamedElement</td>
</tr>
<tr>
<td>QML_UNCREATABLE</td>
<td>@QmlUncreatable</td>
</tr>
</tbody>
</table>
</section>
<section>
<h3>New <i class="qt-green">QML</i> Decorators ✨(2/2)</h3>
<div class="container">
<div class="fragment" style="float: left; width: 40%;">
<pre style="font-size: 40%;width: 100%;"><code class="c++" data-trim data-noescape>
// C++
struct QLineEditForeign
{
Q_GADGET
QML_FOREIGN(QLineEdit)
QML_NAMED_ELEMENT(QLineEdit)
QML_EXTENDED(LineEditExtension)
};
</code></pre>
</div>
<div class="fragment" style="float: right; width: 40%;">
<pre style="font-size: 40%;width: 100%;"><code class="python" data-trim data-noescape>
# Python
@QmlNamedElement("QLineEdit")
@QmlExtended(LineEditExtension)
@QmlForeign(QLineEdit)
class LineEditForeign(QObject):
def __init__(self, parent=None):
super().__init__(parent)
</code></pre>
</div>
</div>
</section>
<section>
<h3>pyside6-<i class="qt-green">qml</i> (1/2)</h3>
<ul style="font-size: 70% ;">
<li>Prototype and Visualize QML files</li>
<li>No need to write Python code</li>
<li>Pseudo QML Python plugins</li>
<ul>
<li>Easy import of QML Types defined in Python</li>
<li>Don't specify if file in same directory as the QML file</li>
</ul>
</ul>
</section>
<section>
<h3>pyside6-<i class="qt-green">qml</i> (2/2)</h3>
<video style="width: 80%;" controls muted data-autoplay src="videos/pyside6-qml.mp4"></video>
</section>
<section>
<h3><i class="qt-green">Feature 3</i></h3>
<h4>Deployment</h4>
</section>
<section>
<h3>pyside6-<i class="qt-green">deploy</i> (1/2)</h3>
<ul style="font-size: 60%;">
<li>Desktop Deployment - Windows, Linux and MacOS</li>
<li>Based on Nuitka</li>
<ul>
<li>Python compiler - Python to C code</li>
<li>Only adds the required modules</li>
</ul>
<li>Wrapper around Nuitka</li>
<ul>
<li>Easy to use</li>
<li>Saves user from a ton of Nuitka cli options</li>
<li>Installs all dependencies for optimizations</li>
</ul>
</ul>
<div class="fragment" style="font-size: 60%;">
<p><i class="qt-green">How do you use it?</i></p>
<ul style="font-size: 80%;">
<li><code>pyside6-deploy /path/to/main.py</code></li>
<li><code>pyside6-deploy (if main file is called main.py)</code></li>
<li><code>pyside6-deploy -c /path/to/pysidedeploy.spec</code></li>
</ul>
<div>
<p><i class="red">Note:</i> QML executable are heavy</p>
</section>
<section>
<h3>pyside6-<i class="qt-green">deploy</i> (2/2)</h3>
<video style="width: 100%"controls muted data-autoplay src="videos/tetrix.mp4"></video>
</section>
<section>
<h3><i class="qt-green">Feature 4</i></h3>
<h4>Cross compilation ⚔️</h4>
</section>
<section>
<h3>Cross Compilation - Linux <i class="qt-yellow">Embedded</i></h3>
<p style="font-size: 70%; text-align: left;">What is cross-compilation?</p>
<p style="font-size: 70%; text-align: left;">Compile on host to deploy on a target with a different architecture</p>
<div style="font-size: 70%; text-align: left;">
<p><i class="qt-purple">Motivation</i></p>
<ul>
<li>Easy UI Development in Embedded Devices e.g: Raspberry PI</li>
<li>Base for deploying to other platforms e.g: Mobile</li>
<ul>
<p><i class="qt-green">Success</i></p>
<ul>
<li>Raspberry Pi devices - based on Arch Linux ARM and Manjaro ARM</li>
<ul>
</div>
</section>
<section>
<h3>Cross Compilation - Linux <i class="qt-yellow">Embedded</i></h3>
<section>
<p><i class="qt-yellow">Step 1</i>: Copy sysroot of the target system</p>
<ul style="font-size: 70%;">
<li>Requires Qt 6.3 or above</li>
<li>Fix symlinks after copy - turn absolute symlinks to relative symlinks</li>
</ul>
</section>
<section>
<p><i class="qt-yellow">Step 2</i>: Create a toolchain file</p>
<pre style="font-size: 50%; width: 100%; text-align: left;"><code class="bash" data-trim data-noescape>
# toolchain-aarch64.cmake
cmake_minimum_required(VERSION 3.18)
include_guard(GLOBAL)
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(TARGET_SYSROOT /path/to/your/target/sysroot)
set(CROSS_COMPILER /path/to/your/crosscompiling/compilers/)
set(CMAKE_SYSROOT ${TARGET_SYSROOT})
set(ENV{PKG_CONFIG_PATH} "")
set(ENV{PKG_CONFIG_LIBDIR} ${CMAKE_SYSROOT}/usr/lib/pkgconfig:${CMAKE_SYSROOT}/usr/share/pkgconfig)
set(ENV{PKG_CONFIG_SYSROOT_DIR} ${CMAKE_SYSROOT})
set(CMAKE_C_COMPILER ${CROSS_COMPILER}/aarch64-none-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER ${CROSS_COMPILER}/aarch64-none-linux-gnu-g++)
set(QT_COMPILER_FLAGS "-march=armv8-a")
set(QT_COMPILER_FLAGS_RELEASE "-O2 -pipe")
set(QT_LINKER_FLAGS "-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
include(CMakeInitializeConfigs)
function(cmake_initialize_per_config_variable _PREFIX _DOCSTRING)
if (_PREFIX MATCHES "CMAKE_(C|CXX|ASM)_FLAGS")
set(CMAKE_${CMAKE_MATCH_1}_FLAGS_INIT "${QT_COMPILER_FLAGS}")
foreach (config DEBUG RELEASE MINSIZEREL RELWITHDEBINFO)
if (DEFINED QT_COMPILER_FLAGS_${config})
set(CMAKE_${CMAKE_MATCH_1}_FLAGS_${config}_INIT "${QT_COMPILER_FLAGS_${config}}")
endif()
endforeach()
endif()
if (_PREFIX MATCHES "CMAKE_(SHARED|MODULE|EXE)_LINKER_FLAGS")
foreach (config SHARED MODULE EXE)
set(CMAKE_${config}_LINKER_FLAGS_INIT "${QT_LINKER_FLAGS}")
endforeach()
endif()
_cmake_initialize_per_config_variable(${ARGV})
endfunction()
</code></pre>
</section>
<section>
<p><i class="qt-yellow">Step 3</i>: Run the following line</p>
<pre style="font-size: 50%; width: 100%; text-align: left;"><code class="bash" data-trim data-noescape>
python setup.py bdist_wheel \
--parallel=8 --ignore-git --reuse-build --standalone --limited-api=yes \
--cmake-toolchain-file=/opt/toolchain-aarch64.cmake \
--qt-host-path=/opt/Qt/6.3.0/gcc_64 \
--plat-name=linux_aarch64
</code></pre>
</section>
</section>
<section>
<h3><i class="qt-green">Feature 5</i></h3>
<h4>Shiboken supports more</h4>
</section>
<section>
<section>
<h4>Spaceship Operator 🚀</h4>
<div class="container">
<div class="fragment" style="float: left; width: 45%;">
<pre style="font-size: 40%;width: 100%;"><code class="c++" data-trim data-noescape>
struct Item {
int value;
constexpr Item(int value): value{value} { }
bool operator==(const Item& rhs) const { return value == rhs.value; }
bool operator!=(const Item& rhs) const { return !(*this == rhs); }
bool operator<(const Item& rhs) const { return value < rhs.value; }
bool operator<=(const Item& rhs) const { return !(rhs < *this); }
bool operator>(const Item& rhs) const { return rhs < *this; }
bool operator>=(const Item& rhs) const { return !(*this < rhs); }
};
</code></pre>
</div>
<div class="fragment" style="float: right; width: 50%;">
<pre style="font-size: 40%;width: 100%;"><code class="c++" data-trim data-noescape>
#include <compare>
struct Item {
int value;
constexpr Item(int value): value{value} { }
auto operator<=>(const Item&) const = default;
};
</code></pre>
</div>
</div>
</section>
<section>
<h4><code>std::unique_ptr</code></h4>
<pre style="font-size: 40%;width: 100%;"><code class="xml" data-trim data-noescape>
<smart-pointer-type name="unique_ptr" type="unique" getter="get"
value-check-method="operator bool"
reset-method="reset"
instantiations="Integer,int">
<include file-name="memory" location="global"/>
</smart-pointer-type>
</code></pre>
</section>
<section>
<h4><code>std::optional</code></h4>
<pre style="font-size: 40%;width: 100%;"><code class="xml" data-trim data-noescape>
<smart-pointer-type name="optional" type="value-handle" getter="value"
value-check-method="has_value"
instantiations="Integer,int">
<include file-name="optional" location="global"/>
</smart-pointer-type>
</code></pre>
</section>
</section>
<section>
<h2><i class="qt-yellow">5</i> reasons 🎤</h2>
<ul>
<li>Wheels: Divide and Conquer</li>
<li>QML improvements</li>
<li>Deployment</li>
<li>Cross compilation</li>
<li>Shiboken supports more</li>
</ul>
</section>
<section>
<h2>Future 🔮</h2>
<ul>
<li>Cross compilation - Yocto and Raspberry Pi OS</li>
<li>Android Deployment</li>
<li>WebAssembly support</li>
<li><code>asyncio</code> support</li>
</ul>
</section>
<section>
<h3>Resources</h3>
<ul>
<li>Product landing page <a href="https://qt.io/qt-for-python">qt.io/qt-for-python</a></li>
<li>Wiki page <a href="https://pyside.org">pyside.org</a></li>
<li>Official docs <a href="https://doc.qt.io/qtforpython">doc.qt.io/qtforpython</a></li>
</ul>
</section>
<section data-background-image="img/background_half.jpg" data-background-opacity=1>
<div id="left">
<h3><i class="qt-yellow">5 reasons</i> <span style="font-weight: normal;">Why You Should Use The <i class="qt-purple">Latest</i> Qt for Python</span></h3>
<hr style="width: 70px; border: 1px solid #ff00ff; background-color: #ff00ff; margin-left: 0px;"/>
<p style="font-size: 80%;">
<i class="green">Shyamnath</i> Premnadh <br>
<img class="clean-img" src="img/github_white.png">
<img class="clean-img" src="img/linkedin.png">
</p>
</div>
</section>
</div>
</div>
<script src="dist/reveal.js"></script>
<script src="plugin/notes/notes.js"></script>
<script src="plugin/markdown/markdown.js"></script>
<script src="plugin/highlight/highlight.js"></script>
<script>
// More info about initialization & config:
// - https://revealjs.com/initialization/
// - https://revealjs.com/config/
Reveal.initialize({
hash: true,
transitionSpeed: 'fast',
// Learn about plugins: https://revealjs.com/plugins/
plugins: [ RevealMarkdown, RevealHighlight, RevealNotes ]
});
</script>
<!-- Hack to have a footer-->
<!-- 1. Style header/footer <div> so they are positioned as desired: in css/qt.css -->
<!-- 2. Create hidden header/footer <div> -->
<div id="hidden" style="display:none;">
<div id="header">
<div id="header-left"><img src="img/qt.png" style="width: 100px;margin-left: 30px;" /></div>
<div id="header-right"></div>
<div id="footer-left">
<p style="font-size: 14pt;margin-left: 20px;">
<img class="clean-img" src="img/qt.png" />
<i class="white">Qt World Summit 2022 | November 9, 2022</i>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script type="text/javascript">
// 3. On Reveal.js ready event, copy header/footer <div> into each `.slide-background` <div>
var header = $('#header').html();
if ( window.location.search.match( /print-pdf/gi ) ) {
Reveal.addEventListener( 'ready', function( event ) {
$('.slide-background').append(header);
});
}
else {
$('div.reveal').append(header);
}
</script>
</body>
</html>