Introducing Qt Quick's support for declarative user interface development

Most of the programming you do at the lowest level is imperative: you describe how an algorithm should work (take this value and square it; search for the first occurrence of this string and replace it; format this data this way; and so forth). With Qt Quick, your programming is largely declarative: instead of saying how you say what. For example, in C++ with Qt, we might write code like this to draw a rectangle:

QRect r(0, 0, 16, 16); 
QPainter p; 
p.setBrush(QBrush(Qt::blue)); 
p.drawRect(r); 

This code creates a rectangle of 16 x 16 pixels, allocates a QPainter object that does the drawing, tells the painter that its brush should be colored blue, and then tells the ...

Get Application Development with Qt Creator now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.