C++
HawwwMv.ru
Windows, Mac OS X Linux , ,-, , , ,, XML, QML JavaScript
230
5.3
--
2015
C++
004.438++ 32.973.26-018.1
68
.68 Qt 5.3. C++. .:
-, 2015. 928 .: . ( )ISBN 978-5-9775-3346-1 Windows, Mac OS X Linux
Qt 5.3. , , , . Qt Creator Qt Quick. Qt 5, , -. .
004.438++ 32.973.26-018.1
: . .
05.03.15. 701001/16. . . . . 74,82.
1500 . "-", 191036, -, ., 20.
""199034, -, 9 , 12/28
ISBN 978-5-9775-3346-1 2015 , "-", 2015
20
22
23 23
32
I. QT 43
1. Qt 45 Qt 45 Qt 46
Qt 48 QtCore 48 QtGui 49 QtWidgets 49 QtQuick QtQML 50 QtNetwork 51 QtXml QtXmlPatterns 51 QtSql 51 QtOpenGL 51 QtWebK.it QtWebKitWidgets 51 QtMultimedia QtMultimediaWidgets 51 QtScript QtScriptTools 51 QtSvg 52
52
2. 53 55
58 60 61
4
66 67
68 70 71
3. Qt 72 72Qt Assistant 72 qmake 72 Qt 76 77 RCC 78 Qt- 79 79
GDB (GNU Debugger) 80 83
Qt 86 Qt 87 89
4. 90 91 92
Java 93 STL 94 foreach 96
96 QVector 97
QByteArray 98 QBitArray 99
QList QLinkedList 99 QStack 101 QQueue 101
102 QMap QMultiMap 103 QHash QMultiHash 104 QSet 105
107 108 109 109 109
110 111
QVariant 113 114 115
5
II. 117
5. ? 119 QWidget 119
122 123 123 124
127 127 128 130
6. 131 (layout managers) 131
133 QBoxLayout 133 QHBoxLayout 135 QVBoxLayout 136
137 QGridLayout 138
144 QSplitter 144 145
7. 146 146 150 153 155
8. , 156 ? QAbstractButton 156
156 156 157
157 160 161 162 165
9. 166 QAbstractSlider 166
166 166 167 167
6
167 169 170 172
10. 173 173 175
178 (syntax highlighting) 178
? 184 185 186
187 188
11. 189 189
189 191 191 191 192
193 196
196 198 199 200 201
12. , - 202 203
203 205 206 208
210 210 214 215 (Proxy model) 222 - 224 226
13. 227 230
7
III. 231
14. 233 235
235 QKeyEvent 235 QFocusEvent 238
. QPaintEvent 238 239
QMouseEvent 239 QWheelEvent 243 enterEvent() leaveEvent() 243
. QTimerEvent 243 (drag & drop) 244
QDragEnterEvent 244 QDragLeaveEvent 244 QDragMoveEvent 244 QDropEvent 244
244 QChildEvent 244 QCloseEvent 244 QHideEvent 245 QMoveEvent 245 QShowEvent 245 QResizeEvent 245
246 event() 247 250 251
15. 252 252 255
16. 256 259
IV. 261
17. 263 263
263 264 266 266 267
267 QColor 267 RGB 268
8
HSV 269 CMYK 270 271 272
273
18. 274 QPainter 275 277
277 278
279 (Anti-aliasing) 280 281
281 282 283 283
286 286
287 288 288 288 288
(painter path) 289 290 (composition mode) 291 294 296
19. 297 297
BMP 297 GIF 298 PNG 298 JPEG 298 298
- 300 Qlmage 300 Qlmage 307
- 308 QPixmap 308 QPixmapCache 310 QBitmap 310 QPixmap 310 311
314
9
20. 316 318 321
21. 322 324 324 325 327 333 335
22. 336 QMovie 336SVG- 338 339
342 346
349
23. OpenGL 350 OpenGL 350 Qt OpenGL 352 OpenGL- 352 OpenGL- 355 OpenGL 356 359 363
24. 364 QPrinter 364 369
25. 370 370 375
26. 376 378 382 383
383 384 384
QStyle 388 388
389 390 391 392
396
10
27. 397 397
WAV-: QSound 398 : QMediaPlayer 399 QMediaPlayer 406
408
V. 409
28. 411 418 420
29. 421 421 422
drag 424 drop 426 428
433
30. 435 435 lupdate 437 Qt Linguist 438 lrelease. , 439 441 443 444
31. 445 445 449 450 451
32. 452 452 QDialog 453
453 454 454
458 458 460 461 462 463
11
464 465
466 468 469 469 470 About Qt 470 471
471
33. 473 473 475 (Online Help) 476 478
34. , SDI- MDT- 480 QMainWindow 480 QAction 481 482 484 485 487SDI- MDI- 489
SDI- 489MDI- 493
501
35. (Desktop) 502 502 507 511 511
VI. QT 513
36. , / 515/. QlODevice 515
. QFile 517 QBuffer 518 QTemporaryF 519
. QDir 519 520
. QFilelnfo 523 ? 523 524 524 524 524
12
525 / 527
QTextStream 527 QDataStream 529
529
37. , 531 531
QDate 531 QTime 533 QDateTime 534
534 535 QTimer 537 QBasicTimer 539
539
38. 540 540 543
545 545
- 546 551
554 554 556 556 557
QtConcurrent 557 559
39. 561 561
- 562 - 563 - 568
UDP- UDP- 572 576 583 585 586
40. XML 587 XML- 587XML Qt 589 DOM 589
XML- 590 XML- 592
13
SAX 594 XML- 594
QXmlStreamReader XML 597 XQuery 599 602
41. 603 SQL 603
604 604 604 605 605
SQL Qt 605 ( ) 607 SQL ( ) 608 SQL- ( ) 611
612 613 615
616
42. 617 617
618 (plug-ins) 621
Qt 621 623
627 629
43. Qt API 630 Windows API 632 Linux 635 Mac OS X 635 639 641
44. Qt Designer. 642 Qt Designer 642 645 (layout) 646 647 648 650 650 652 653 655
14
45. 657 658
661 663 664 665
46. WebKit 666 667 ? 668 668 Web- 670
670 670 671 Web-, 671
676
47. Qt Creator 677 678 Hello Qt Creator 679 Qt Creator 684
685 685 685
688 ? 688 688 689 689 694
694 694 694 695, 695 696
696 697 698 699 699 699
Step Over 700 Step Into 701 Step Out 701
701 (Local and Watches) 702 (Call Stack) 703
703
15
48. Qt 4 Qt 5 705 Qt 5 Qt 4 705 Qt 5 705
706 706 qFindChildren() 707 707WebKit 707 707 Plug-ins 707 QPrinter 708 708 708
Qt 5 Qt 4 708 711
VII. QT SCRIPT 713
49. 715 716 719, 720 721
50. 723 723 724 724
725 725 725 726 726
726 728 728
728 728 729 730 731
732 732
if... else 732 switch 733
733 734
break continue 734
16
for 734 while 734 do...while 735
with 735 735
try...catch 736 throw 736
737 738
739 741 742 744 744
745
51. Qt Script 746 Global 746 Number 746 Boolean 746 String 747
747 747 747 747
RegExp 747 748 748
Array 748 749 749 749 750 750 750 750
Date 751 Math 752
752 753 753 753 753 754 754 754
Function 755 755
17
52. Qt Script 756 QScriptValue 756 QScriptContext 756 QScriptEngine 757 759
760, 767
Qt Script 770 773
VIII. QT QUICK 775
53. Qt Quick 777 ? 777 QML 779 779 JavaScript QML 783 784
54. 786 786 788
790 792 794 797 799
55. 800 800 807 811
56. 812 812 813
Image 813 Borderlmage 816
817 818 819 821
57. 822 822 825 829
830 832
834
18
58. 835 835
837 838 839
840 842 845
845 848
851
59. / 852 852
852XML- 853
855 Flickable 855 ListView 856 GridView 858 PathView 860
863
60. Qt Quick C++ 864 QML C++ 864 C++ QML 865 877
878
879
1. ASCII 881
2. 884
3. 887
4. 891
901
,
,
(Goes)
.
Let's start with a fictional story. Imagine ten years ago, someone came to me and asked: Is itpossible to write a feature-rich graphical application, and then compile and run this applicationnatively on all different major operating systems? On Linux, on UNIX, on Windows, and on theMacintosh? Back then as a young computer scientist I would probably have answered,No, that's not possible. And if it was, the system would be very difficult to use, and limited by theweakest platform. Better choose one platform, or write your code several times.A few years later I discovered Qt and how wrong I was!Qt makes true cross-platform programming a reality, without limiting your choices and creativity.It gives users what users want: fast, native applications that look and feel just right. It givesdevelopers what developers want: a framework that lets us write less code, and create more.A framework that makes programming fun again, no matter whether we do commercial work orcontribute to Open Source projects.Too good to be true? You don't believe me? Well, the proof is easy. I'll pass the word on to Max,who will tell you exactly how it's done. Max, your turn.Before I leave, let me wish you good luck with your first Qt-steps. But be careful, it may very wellturn into a lifetime addiction. Either way, I hope you will have as much fun using Qt as we havecreating it for you.
Matthias EttrichOctober 1st, 2004, Oslo
. , 10 - : , ? Linux, UNIX, Windows, Macintosh? , , , : , . , . . Qt
Top Related