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

Finding memory leaks with Valgrind

As discussed in Chapter 3, Designing Your Application with Qt Designer, you should really get in the habit of using Qt's parent-child relationship when managing the memory for the classes based on QObject in your application to avoid memory leaks. In my time of writing Qt applications, the only time I've had to deal with memory leaks was when I didn't use memory management based on QObject. In addition, using classes such as QSharedPointer for pointers that aren't based on QObject is a good idea too.

Sometimes, though, you might introduce a memory leak that you can't find on your own. In that case, a tool such as Valgrind can be a lifesaver; it tracks every memory allocation and free operation in your application, alerting you when your program terminates if it hasn't freed all the memory it allocates.

Tip

Unfortunately, Valgrind is supported by Mac OS X and Linux-only. If you're writing pure Qt code, this shouldn't...

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