1. 首页
  2. 编程语言
  3. C++ 
  4. Mastering Qt 5

Mastering Qt 5

上传者: 2019-06-24 00:46:02上传 PDF文件 6.81MB 热度 17次
About This Book, Unleash the power of Qt 5 with C++14Integrate useful third-party libraries such as OpenCVPackage and deploy your application on multiple platforms, Who This Book Is For, This book will appeal to developers and programmers who would like to build GUI-based applications. Knowledge of Table of contentsMastering QtCreditsabout the authorsabout the reviewerwww.packtpub.comWhy subscribe?refaceWhat this book coversWhat you need for this bookWho this book is forConventionsReader feedbackCustomer supportDownloading the example codeErrataPiracyQuestions1. Get Your Qt Feet WetCreating a projectMain Window structureQt DesignerSignals and slotsCustom WidgetAdding a taskUsing a DIalogDistributing code responsibilityEmitting a custom signal using lambdasSimplifying with the auto type and a range-based for loopSummaryDiscovering QMake SecretsDesigning a cross-platform projectAdding the Windows implementationAdding the Linux implementationAdding the mac os implementationTrans forming Sys Info into a singletonExploring ot ChartsCpu widget using CHartsMemory using chartsThe pro file in depthUnder the hood of amakeBeneath obJeCt and signals/slotsSummary3. Dividing Your Project and Ruling Your CodeDesigning a maintainable projectDefining data classesStoring your data in a databaseProtecting your code with a smart pointerImplementing the modelSummary4. Conquering the Desktop UICreating a GUI linked to a core shared libraryListing your albums with AlbumList WidgetCreating a ThumbnailProxyModelDisplaying the selected album with AlbumWidgetEnhancing thumbnails with PictureDelegateDisplaying a picture with Picture WidgetCcomposing yourGallery appSummar5. Dominating the mobile ulStarting with Qt Quick and QMLChecking your development environmentCreating a Qt Quick projectPreparing your Qt Quick gallery entry-pointDisplaying albums with list viewTheming the application with a Qml singletonLoading a database on mobileCreating a new album from a custom InputDialogoading images with an Image ProviderDisplaying thumbnails in a grid ViewSwiping through full resolution picturesSummary6. Even Ot Deserves a Slice of raspberry piDiscovering QtdConfiguring Ot for your raspberry piCreating an entry point for your Qt3D codeSetting up the sceneAssembling your Ot3D entitiesPreparing the board gameCrafting entities from the factoryBuilding a snake engine in JavaScriptVarying the HUd with OML statesProfiling your QML applicationSummary1. Third-Party libraries Without a headacheCreating your Ot Designer pluginConfiguring the project for WindowsConfiguring the proiect for linuxConfiguring the project for macImplementing your OpenCV filtersDesigning the UI with Filter WidgetExposing your plugin to Ot DesignerUsing your Ot Designer pluginBuilding the image-filter applicationSummary8. Animations-Its Alive. Alive!Preparing an sdKCreating your pluginsLoading your plugins dynamicallyUSing the plugins inside the applicationiscovering the animation framew orkMaking your thumbnails jumpFading the picture inFlashing the thumbnail in a sequenceSuummar9. Keeping Your Sanity with Mul tithreadingDiscovering othreadFlying over Ot multithreading technologiesArchitecting the Mandelbrot projectDefining a Job class with RUnnableUsing QThreadPool in MandelbrotCalculatorDisplaying the fractal with Mandelbrot WidgetSummar0. Need IPC? Get Your minions to workArchitecturing an IPC projectLaying down the foundations with an SDKWorking with DAta Stream and Rtcp SocketInteracting with sockets in the workerInteracting with sockets from the applicationBuilding your own OTcpServerSummar1. Having fun with serializationArchitecting the drum machine proiectCreating a drum trackMaking your objects serializable with Q VariantSerializing objects in JSoN formatSerializing objects in XML formatSerializing objects in binary formatPlaying low latency sounds with OSoundEffectTriggering a QButton with your keyboardBringing playback Worker toAccepting mouse drag and drop eventsSummar12.You Shall (Not) Pass with QTestDiscovering ot TestExecuting your testsWriting factorized tests with datasetsBenchmarking your codeTesting your GUISpying on your application with oSignalSpySummar3. All Packed and Ready to deployPackaging your applicationPackaging for WindowsPackaging for Linux with a distribution packagePackaging for Linux with applmagePackaging for Mac os XPackaging for AndroidPackaging for ioSSummary14.Ot Hat Tips and TricksManaging your workspace with sessionsearching with the locatorIncreasing the compilation speedExamining the memory with ot CreatorGenerating random numbersSilencing unused variable warningsLogging custom objects to QDebugmproving log messagesSaving your logs to a fileGenerating a command-line interfaceSendingandreceivinghttpdataSummarMastering Qt 5Mastering Qt 5Copyright o 2016 Packt PublishingAll rights reserved. No part of this book may be reproduced, stored in a retrieval system, ortransmitted in any form or by any means, without the prior written permission of the publisher, exceptin the case of brief quotations embedded in critical articles or reviewsEvery effort has been made in the preparation of this book to ensure the accuracy of the informationpresented. However, the information contained in this book is sold without warranty, either expressor implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be heldliable for any damages caused or alleged to be caused directly or indirectly by thinIs OO0kPackt Publishing has endeavored to provide trademark information about all of the companies andproducts mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannotguarantee the accuracy of this informationFirst published: December 2016Production reference: 1121216Published by Packt Publishing Ltdivery Place35 Livery streetBirminghamB3 2PB. UKISBN978-1-78646-712-6www.packtpub.comCreditsAuthorsCopy EditorGuillaume LazarSafis EditingRobin PenaRe vie werProject CoordinatorRay rischpaterIzzat ContractorCommis sioning EditorProofre aderKunal ParikhSafis EditinAcquisition EditorIndexerSonali verne karRekha nairContent Developme nt editor Production CoordinatorRohit Kumar SinghAparna bhagatTechnical editorVivek palaAbout the authorsGuillaume Lazar is a software engineer living near Paris in France. He has worked for differentcompanies, from startups to multinationals, for the last 7 years. He took the opportunity to observeand learn from many team organizations and technologiesHe eventually founded his own software development company, NeuronalMotion, at the age of 27with his friend robin pena in 2014. Information about it and its open source projects can be foundonthecomapny'swebsitewww.neuronalmotion.com.NeuronalMotion represents to Guillaume"a different way of working. The current hierarchicalorganization that applies to most companies seems obsolete to him. With his own company, he wantsto try something different, where each employee will be autonomousAlthough he defines himself as a Qt framework lover, he likes to mix different technologies andplatforms. He also spends time on game development, machine learning, and electronics, because"things" become alive.Creating examples and writing chapters for this book was a serious challenge this year. somesections were fundamentally changed to match ot evolution. I would not have been able toachieve this task alone. I wish to thank robin Penea, my friend and the coauthor of this bookHe gave his all to create with me a robust ot book with modern C+t Our review team, rohitKumar Singh, Ray rischpater; Quentin Canu, Chistophe Dongieux, and Hugo Loi, have doneexcellent work they corrected us and raised some important issues. I also want to thankPackt for the good follow up during the writing process. Finally, i thank my family and,particularly, Sophie, my girlfriend, for her supportRobin Penea is a software engineer living in France. He has worked for several companies over thelast 7 years, on many different technologies(ranging from server application development toembedded programmingHe founded NeuronalMotion with Guillaume Lazar in 20 14 to implement his vision ofentrepreneurship and project development. He aims to achieve a self-organized company moreinformationisavailableatwww.neuronalmotion.comBesides developing with Qt, he likes to tinker with the Android AOSP framework, learn newprogramming language paradigms, and discover how to interweave technology and real lifeThis book would not have existed without guillaume lazar; my friend and the coauthor of thebook. He was truly dedicated to designing and crafting the best possible book. I wish to thankour reviewers, Rohit Kumar Singh, Ray rischpater, quentin Canu, Christophe dongieux, andHugo Loi. Their input was invaluable and definitely raised the quality of the book Packtplayed a sensible role, listening to our requests and changes, guiding us through the writing,and monitoring our mental states during this year with benevolence. I also wish to thank my
用户评论