Skip to Content
Introduction to Design Patterns in C++ with Qt, 2nd Edition
book

Introduction to Design Patterns in C++ with Qt, 2nd Edition

by Alan Ezust, Paul Ezust
September 2011
Intermediate to advanced
768 pages
15h 18m
English
Pearson
Content preview from Introduction to Design Patterns in C++ with Qt, 2nd Edition

Chapter 17: Concurrency

QProcess and QThread provide two approaches to concurrency. This chapter discusses how to create and communicate with processes and threads and offers techniques for monitoring and debugging them.

17.1 QProcess and Process Control

QProcess is a convenient (and cross-platform) class for starting and controlling other processes. It is derived from QObject and takes full advantage of signals and slots to make it easier to “hook up” with other Qt classes.

Now consider a simple example that starts a process and views its continually running output.1 Example 17.1 shows the definition of a simple class derived from QProcess.

Example 17.1 src/logtail/logtail.h

[ . . . . ]#include <QObject>#include <QProcess>class LogTail : public ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

An Introduction to Design Patterns in C++ with Qt 4

An Introduction to Design Patterns in C++ with Qt 4

Alan Ezust, Paul Ezust
Programming with Qt, 2nd Edition

Programming with Qt, 2nd Edition

Matthias Kalle Dalheimer

Publisher Resources

ISBN: 9780132851619Purchase book