Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Application Development with Qt Creator - Second Edition
  • Toc
  • feedback
Application Development with Qt Creator - Second Edition

Application Development with Qt Creator - Second Edition

4 (25)
close
Application Development with Qt Creator - Second Edition

Application Development with Qt Creator - Second Edition

4 (25)

Overview of this book

This book is great for developers who are new to Qt and Qt Creator and who are interested in harnessing the power of Qt for cross-platform development. If you have basic experience programming in C++, you have what it takes to create engaging cross-platform applications using Qt and Qt Creator!
Table of Contents (15 chapters)
close
14
Index

Drawing with QPainter on QPaintDevice instances


At its core, graphics painting requires two things: something that knows how to paint and something that can be painted on. Qt defines the QPainter class as the former and the QPaintDevice as the interface for classes for the latter. You'll seldom instantiate each, but you use both of these classes a lot if you're doing graphics programming; typically, you'll have an instance of a subclass of QPaintDevice, ask it for its associated QPainter, and then use QPainter to perform your drawing. This can happen when you're writing a widget; you'll be passed a QPainter subclass, for example, when you need to paint the widget's contents.

There are several subclasses of QPaintDevice:

  • QWidget: This class and its subclasses are used by the widget hierarchy

  • QImage: This is a container class for offscreen images that are optimized for input/output and individual pixel access

  • QPixmap: This is a container class for offscreen images that's highly optimized for...

bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete